From 5a7d44327efb4cf3af854e3fe0e37600d3b9b4cd Mon Sep 17 00:00:00 2001 From: Christian Jakob <47860090+thesephirot@users.noreply.github.com> Date: Thu, 28 May 2020 14:12:37 +0200 Subject: [PATCH] moved base (#146) * moved base * as per PR * Update k8s/base/deployment.yaml Co-authored-by: Florian Forster Co-authored-by: Florian Forster --- k8s/base/deployment.yaml | 81 +++++++++++++++++++++++++++ k8s/base/flow.yaml | 18 ++++++ k8s/base/kustomization.yaml | 12 ++++ k8s/base/output.yaml | 13 +++++ k8s/base/service-accounts.yaml | 13 +++++ k8s/base/service-api-admin.yaml | 16 ++++++ k8s/base/service-api-auth.yaml | 19 +++++++ k8s/base/service-api-mangagement.yaml | 16 ++++++ k8s/base/service-console.yaml | 13 +++++ 9 files changed, 201 insertions(+) create mode 100644 k8s/base/deployment.yaml create mode 100644 k8s/base/flow.yaml create mode 100644 k8s/base/kustomization.yaml create mode 100644 k8s/base/output.yaml create mode 100644 k8s/base/service-accounts.yaml create mode 100644 k8s/base/service-api-admin.yaml create mode 100644 k8s/base/service-api-auth.yaml create mode 100644 k8s/base/service-api-mangagement.yaml create mode 100644 k8s/base/service-console.yaml diff --git a/k8s/base/deployment.yaml b/k8s/base/deployment.yaml new file mode 100644 index 0000000000..05777d819f --- /dev/null +++ b/k8s/base/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: zitadel + labels: + app: zitadel +spec: + replicas: 3 + selector: + matchLabels: + app: zitadel + version: v1 + template: + metadata: + labels: + app: zitadel + version: v1 + spec: + containers: + - name: zitadel + image: docker.pkg.github.com/caos/zitadel/zitadel:latest + imagePullPolicy: IfNotPresent + args: ["-login=false", "-console=false"] + ports: + - name: management-rest + containerPort: 60021 + - name: management-grpc + containerPort: 60020 + - name: auth-rest + containerPort: 60051 + - name: issuer-rest + containerPort: 60052 + - name: auth-grpc + containerPort: 60050 + - name: admin-rest + containerPort: 60091 + - name: admin-grpc + containerPort: 60090 + - name: console-http + containerPort: 9090 + - name: accounts-http + containerPort: 61121 + env: + - name: ZITADEL_GOOGLE_CHAT_URL + valueFrom: + secretKeyRef: + name: zitadel-secrets-vars + key: ZITADEL_GOOGLE_CHAT_URL + - name: ZITADEL_TWILIO_AUTH_TOKEN + valueFrom: + secretKeyRef: + name: zitadel-secrets-vars + key: ZITADEL_TWILIO_AUTH_TOKEN + - name: ZITADEL_TWILIO_SID + valueFrom: + secretKeyRef: + name: zitadel-secrets-vars + key: ZITADEL_TWILIO_SID + - name: ZITADEL_EMAILAPPKEY + valueFrom: + secretKeyRef: + name: zitadel-secrets-vars + key: ZITADEL_EMAILAPPKEY + envFrom: + - configMapRef: + name: zitadel-vars + volumeMounts: + - name: zitadel-secret + mountPath: /secret + - name: console-config + mountPath: /app/console/dist/assets/environment.json + subPath: environment.json + imagePullSecrets: + - name: githubsecret + volumes: + - name: zitadel-secret + secret: + secretName: zitadel-secret + - name: console-config + configMap: + name: console-config diff --git a/k8s/base/flow.yaml b/k8s/base/flow.yaml new file mode 100644 index 0000000000..eccd3587fa --- /dev/null +++ b/k8s/base/flow.yaml @@ -0,0 +1,18 @@ +apiVersion: logging.banzaicloud.io/v1beta1 +kind: Flow +metadata: + name: flow-zitadel +spec: + filters: + - parser: + remove_key_name_field: true + reserve_data: true + parse: + type: logfmt + - tag_normaliser: + metadata: ${namespace}.${container}.${pod} + metadata_name: ${namespace_name}.${container_name}.${pod_name} + selectors: + app: zitadel + outputRefs: + - output-loki \ No newline at end of file diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml new file mode 100644 index 0000000000..4bb37c1f08 --- /dev/null +++ b/k8s/base/kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: zitadel + +resources: +- deployment.yaml +- service-accounts.yaml +- service-api-admin.yaml +- service-api-auth.yaml +- service-api-mangagement.yaml +- service-console.yaml diff --git a/k8s/base/output.yaml b/k8s/base/output.yaml new file mode 100644 index 0000000000..9a8a103c41 --- /dev/null +++ b/k8s/base/output.yaml @@ -0,0 +1,13 @@ + +apiVersion: logging.banzaicloud.io/v1beta1 +kind: Output +metadata: + name: output-loki +spec: + loki: + buffer: + timekey: 1m + timekey_use_utc: true + timekey_wait: 30s + configure_kubernetes_labels: true + url: http://loki.caos-system:3100 diff --git a/k8s/base/service-accounts.yaml b/k8s/base/service-accounts.yaml new file mode 100644 index 0000000000..c272d7d3a6 --- /dev/null +++ b/k8s/base/service-accounts.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: accounts-v1 +spec: + ports: + - name: http + port: 80 + targetPort: accounts-http + selector: + app: zitadel + version: v1 diff --git a/k8s/base/service-api-admin.yaml b/k8s/base/service-api-admin.yaml new file mode 100644 index 0000000000..019670d253 --- /dev/null +++ b/k8s/base/service-api-admin.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: api-admin-v1 +spec: + ports: + - name: rest + port: 80 + targetPort: admin-rest + - name: grpc + port: 8080 + targetPort: admin-grpc + selector: + app: zitadel + version: v1 diff --git a/k8s/base/service-api-auth.yaml b/k8s/base/service-api-auth.yaml new file mode 100644 index 0000000000..d9fce7b340 --- /dev/null +++ b/k8s/base/service-api-auth.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: api-auth-v1 +spec: + ports: + - name: rest + port: 80 + targetPort: auth-rest + - name: issuer + port: 7070 + targetPort: issuer-rest + - name: grpc + port: 8080 + targetPort: auth-grpc + selector: + app: zitadel + version: v1 diff --git a/k8s/base/service-api-mangagement.yaml b/k8s/base/service-api-mangagement.yaml new file mode 100644 index 0000000000..86990edfd6 --- /dev/null +++ b/k8s/base/service-api-mangagement.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: api-management-v1 +spec: + ports: + - name: rest + port: 80 + targetPort: management-rest + - name: grpc + port: 8080 + targetPort: management-grpc + selector: + app: zitadel + version: v1 \ No newline at end of file diff --git a/k8s/base/service-console.yaml b/k8s/base/service-console.yaml new file mode 100644 index 0000000000..add413f196 --- /dev/null +++ b/k8s/base/service-console.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: console-v1 +spec: + ports: + - name: http + port: 80 + targetPort: console-http + selector: + app: zitadel + version: v1