From 7dcae2d1836ccd718ac2da968bb62d89a3426631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=BE=D0=B2=D0=B0=D1=80=D0=B8=D1=89=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B8=D1=81=D1=82?= <46831212+ComradeProgrammer@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:25:25 +0800 Subject: [PATCH] fix: add k8s deployments example (#446) --- k8s.yaml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 k8s.yaml diff --git a/k8s.yaml b/k8s.yaml new file mode 100644 index 00000000..cadcd798 --- /dev/null +++ b/k8s.yaml @@ -0,0 +1,56 @@ +# this is only an EXAMPLE of deploying casddor in kubernetes +# please modify this file according to your requirements +apiVersion: v1 +kind: Service +metadata: + #EDIT IT: if you don't want to run casdoor in default namespace, please modify this field + #namespace: casdoor + name: casdoor-svc + labels: + app: casdoor +spec: + #EDIT IT: if you don't want to run casdoor in default namespace, please modify this filed + type: NodePort + ports: + - port: 8000 + selector: + app: casdoor +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + #EDIT IT: if you don't want to run casdoor in default namespace, please modify this field + #namespace: casdoor + name: casdoor-deployment + labels: + app: casdoor +spec: + #EDIT IT: if you don't use redis, casdoor should not have multiple replicas + replicas: 1 + selector: + matchLabels: + app: casdoor + template: + metadata: + labels: + app: casdoor + spec: + containers: + - name: casdoor-container + image: casbin/casdoor:latest + imagePullPolicy: Always + ports: + - containerPort: 8000 + volumeMounts: + # the mounted directory path in THE CONTAINER + - mountPath: /conf + name: conf + env: + - name: RUNNING_IN_DOCKER + value: "true" + #if you want to deploy this in real prod env, consider the config map + volumes: + - name: conf + hostPath: + #EDIT IT: the mounted directory path in THE HOST + path: /conf