From 3e3a654babf233f5a58ebc9265e0ee1ebb963da5 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 10 Aug 2023 11:37:25 +0200 Subject: [PATCH] Split into single deployments --- .../taiga/taiga-async-deployment.yml | 71 ++++++ .../taiga/taiga-async-rabbitmq-deployment.yml | 47 ++++ .../resources/taiga/taiga-back-deployment.yml | 118 +++++++++ src/main/resources/taiga/taiga-deployment.yml | 234 ------------------ .../taiga/taiga-events-deployment.yml | 42 ++++ .../taiga-events-rabbitmq-deployment.yml | 47 ++++ .../taiga/taiga-front-deployment.yml | 42 ++++ .../taiga/taiga-protected-deployment.yml | 42 ++++ 8 files changed, 409 insertions(+), 234 deletions(-) create mode 100644 src/main/resources/taiga/taiga-async-deployment.yml create mode 100644 src/main/resources/taiga/taiga-async-rabbitmq-deployment.yml create mode 100644 src/main/resources/taiga/taiga-back-deployment.yml delete mode 100644 src/main/resources/taiga/taiga-deployment.yml create mode 100644 src/main/resources/taiga/taiga-events-deployment.yml create mode 100644 src/main/resources/taiga/taiga-events-rabbitmq-deployment.yml create mode 100644 src/main/resources/taiga/taiga-front-deployment.yml create mode 100644 src/main/resources/taiga/taiga-protected-deployment.yml diff --git a/src/main/resources/taiga/taiga-async-deployment.yml b/src/main/resources/taiga/taiga-async-deployment.yml new file mode 100644 index 0000000..ea99592 --- /dev/null +++ b/src/main/resources/taiga/taiga-async-deployment.yml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-async-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + ### taiga-async + - name: taiga-async + image: taigaio/taiga-back:latest + imagePullPolicy: IfNotPresent + command: ["async_entrypoint.sh"] + ports: + - containerPort: 80 + volumeMounts: + - name: taiga-static + mountPath: /taiga-back/static + readOnly: false + - name: taiga-media + mountPath: /taiga-back/media + readOnly: false + envFrom: + - configMapRef: + name: taiga-back-configmap + - secretRef: + name: taiga-back-secret + - secretRef: + name: taiga-rabbitmq-secret + env: + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-user + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-password + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: postgres-config + key: postgres-db + - name: POSTGRES_HOST + value: "postgresql-service" + - name: POSTGRES_PORT + value: 5432 + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-async-rabbitmq-deployment.yml b/src/main/resources/taiga/taiga-async-rabbitmq-deployment.yml new file mode 100644 index 0000000..c519496 --- /dev/null +++ b/src/main/resources/taiga/taiga-async-rabbitmq-deployment.yml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-async-rabbitmq-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + - name: taiga-async-rabbitmq + image: rabbitmq:3.8-management-alpine + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + volumeMounts: + - name: taiga-async-rabbitmq-data + mountPath: /var/lib/rabbitmq + readOnly: false + envFrom: + - secretRef: + name: taiga-rabbitmq-secret + env: + - name: RABBITMQ_ERLANG_COOKIE + value: ERLANG_COOKIE_VALUE + - name: RABBITMQ_DEFAULT_VHOST + value: RABBITMQ_VHOST + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-back-deployment.yml b/src/main/resources/taiga/taiga-back-deployment.yml new file mode 100644 index 0000000..ea05d47 --- /dev/null +++ b/src/main/resources/taiga/taiga-back-deployment.yml @@ -0,0 +1,118 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-back-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + #################### Init ######################## + initContainers: + - name: taiga-manage + image: taigaio/taiga-back:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + command: + - python manage.py + - python manage.py createsuperuser + volumeMounts: + - name: taiga-static + mountPath: /taiga-back/static + readOnly: false + - name: taiga-media + mountPath: /taiga-back/media + readOnly: false + envFrom: + - configMapRef: + name: taiga-back-configmap + - secretRef: + name: taiga-back-secret + - secretRef: + name: taiga-rabbitmq-secret + env: + - name: POSTGRES_USER # ToDo: Does taiga need a specific postgres version? Maybe test this + valueFrom: # ToDo: How do i reach a container from another container? + secretKeyRef: # ToDo: maybe generate container URLs at c4k level? + name: postgres-secret + key: postgres-user + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-password + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: postgres-config + key: postgres-db + - name: POSTGRES_HOST + value: "postgresql-service" + - name: POSTGRES_PORT + value: 5432 + - name: CELERY_ENABLED + value: false + #################### Containers ######################## + containers: # ToDo: Research dependsOn keyword of docker compose and find functional translation for kubernetes + ### taiga-back + - name: taiga-back + image: taigaio/taiga-back:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 # ToDo: Check container ports + volumeMounts: + - name: taiga-static + mountPath: /taiga-back/static + readOnly: false + - name: taiga-media + mountPath: /taiga-back/media + readOnly: false + envFrom: + - configMapRef: + name: taiga-back-configmap + - secretRef: + name: taiga-back-secret + - secretRef: + name: taiga-rabbitmq-secret + env: + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-user + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-password + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: postgres-config + key: postgres-db + - name: POSTGRES_HOST + value: "postgresql-service" + - name: POSTGRES_PORT + value: 5432 + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-deployment.yml b/src/main/resources/taiga/taiga-deployment.yml deleted file mode 100644 index 335c710..0000000 --- a/src/main/resources/taiga/taiga-deployment.yml +++ /dev/null @@ -1,234 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: taiga-deployment - labels: - app.kubernetes.part-of: c4k-taiga -spec: - replicas: 1 - selector: - matchLabels: - app: taiga - template: - metadata: - labels: - app: taiga - spec: - #################### Init ######################## - initContainers: - - name: taiga-manage - image: taigaio/taiga-back:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - command: - - python manage.py - - python manage.py createsuperuser - volumeMounts: - - name: taiga-static - mountPath: /taiga-back/static - readOnly: false - - name: taiga-media - mountPath: /taiga-back/media - readOnly: false - envFrom: - - configMapRef: - name: taiga-back-configmap - - secretRef: - name: taiga-back-secret - - secretRef: - name: taiga-rabbitmq-secret - env: - - name: POSTGRES_USER # ToDo: Does taiga need a specific postgres version? Maybe test this - valueFrom: # ToDo: How do i reach a container from another container? - secretKeyRef: # ToDo: maybe generate container URLs at c4k level? - name: postgres-secret - key: postgres-user - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-password - - name: POSTGRES_DB - valueFrom: - configMapKeyRef: - name: postgres-config - key: postgres-db - - name: POSTGRES_HOST - value: "postgresql-service" - - name: POSTGRES_PORT - value: 5432 - - name: CELERY_ENABLED - value: false - #################### Containers ######################## - containers: # ToDo: Research dependsOn keyword of docker compose and find functional translation for kubernetes - ### taiga-back - - name: taiga-back - image: taigaio/taiga-back:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - volumeMounts: - - name: taiga-static - mountPath: /taiga-back/static - readOnly: false - - name: taiga-media - mountPath: /taiga-back/media - readOnly: false - envFrom: - - configMapRef: - name: taiga-back-configmap - - secretRef: - name: taiga-back-secret - - secretRef: - name: taiga-rabbitmq-secret - env: - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-user - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-password - - name: POSTGRES_DB - valueFrom: - configMapKeyRef: - name: postgres-config - key: postgres-db - - name: POSTGRES_HOST - value: "postgresql-service" - - name: POSTGRES_PORT - value: 5432 - ### taiga-async - - name: taiga-async - image: taigaio/taiga-back:latest - imagePullPolicy: IfNotPresent - command: ["async_entrypoint.sh"] - ports: - - containerPort: 80 - volumeMounts: - - name: taiga-static - mountPath: /taiga-back/static - readOnly: false - - name: taiga-media - mountPath: /taiga-back/media - readOnly: false - envFrom: - - configMapRef: - name: taiga-back-configmap - - secretRef: - name: taiga-back-secret - - secretRef: - name: taiga-rabbitmq-secret - env: - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-user - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-password - - name: POSTGRES_DB - valueFrom: - configMapKeyRef: - name: postgres-config - key: postgres-db - - name: POSTGRES_HOST - value: "postgresql-service" - - name: POSTGRES_PORT - value: 5432 - ### taiga-async-rabbitmq - - name: taiga-async-rabbitmq - image: rabbitmq:3.8-management-alpine - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - volumeMounts: - - name: taiga-async-rabbitmq-data - mountPath: /var/lib/rabbitmq - readOnly: false - envFrom: - - secretRef: - name: taiga-rabbitmq-secret - env: - - name: RABBITMQ_ERLANG_COOKIE - value: ERLANG_COOKIE_VALUE - - name: RABBITMQ_DEFAULT_VHOST - value: RABBITMQ_VHOST - ### taiga-front - - name: taiga-front - image: taigaio/taiga-front:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - env: - - name: TAIGA_URL - value: TAGA_SCHEME://TAIGA_DOMAIN - - name: TAIGA_WEBSOCKETS_URL - value: WEBSOCKETS_SCHEME://TAIGA_DOMAIN - - name: TAIGA_SUBPATH - value: SUBPATH - ### taiga-events - - name: taiga-events - image: taigaio/taiga-events:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - envFrom: # ToDo: check if all vars are needed - - configMapRef: - name: taiga-back-configmap - - secretRef: - name: taiga-back-secret - - secretRef: - name: taiga-rabbitmq-secret - ### taiga-events-rabbitmq - - name: taiga-events-rabbitmq - image: rabbitmq:3.8-management-alpine - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - volumeMounts: - - name: taiga-events-rabbitmq-data - mountPath: /var/lib/rabbitmq - readOnly: false - envFrom: - - secretRef: # ToDo secret key ref - name: taiga-rabbitmq-secret - env: - - name: RABBITMQ_ERLANG_COOKIE - value: ERLANG_COOKIE_VALUE - - name: RABBITMQ_DEFAULT_VHOST - value: RABBITMQ_VHOST - ### taiga-protected - - name: taiga-protected - image: taigaio/taiga-protected:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - envFrom: # ToDo secret key ref - secret_key - - secretRef: - name: taiga-back-secret - env: - - name: MAX_AGE - value: ATTACHMENTS_MAX_AGE -# - name: taiga-gateway # ToDo: How to replace the gateway in this setup? - - volumes: - - name: taiga-static - persistentVolumeClaim: - claimName: taiga-static - - name: taiga-media - persistentVolumeClaim: - claimName: taiga-media - - name: taiga-async-rabbitmq-data - persistentVolumeClaim: - claimName: taiga-async-rabbitmq-data - - name: taiga-events-rabbitmq-data - persistentVolumeClaim: - claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-events-deployment.yml b/src/main/resources/taiga/taiga-events-deployment.yml new file mode 100644 index 0000000..27b5da9 --- /dev/null +++ b/src/main/resources/taiga/taiga-events-deployment.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-events-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + - name: taiga-events + image: taigaio/taiga-events:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + envFrom: # ToDo: check if all vars are needed + - configMapRef: + name: taiga-back-configmap + - secretRef: + name: taiga-back-secret + - secretRef: + name: taiga-rabbitmq-secret + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-events-rabbitmq-deployment.yml b/src/main/resources/taiga/taiga-events-rabbitmq-deployment.yml new file mode 100644 index 0000000..6440235 --- /dev/null +++ b/src/main/resources/taiga/taiga-events-rabbitmq-deployment.yml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-events-rabbitmq-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + - name: taiga-events-rabbitmq + image: rabbitmq:3.8-management-alpine + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + volumeMounts: + - name: taiga-events-rabbitmq-data + mountPath: /var/lib/rabbitmq + readOnly: false + envFrom: + - secretRef: # ToDo secret key ref + name: taiga-rabbitmq-secret + env: + - name: RABBITMQ_ERLANG_COOKIE + value: ERLANG_COOKIE_VALUE + - name: RABBITMQ_DEFAULT_VHOST + value: RABBITMQ_VHOST + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-front-deployment.yml b/src/main/resources/taiga/taiga-front-deployment.yml new file mode 100644 index 0000000..5f3e742 --- /dev/null +++ b/src/main/resources/taiga/taiga-front-deployment.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-front-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + - name: taiga-front + image: taigaio/taiga-front:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + env: + - name: TAIGA_URL + value: TAGA_SCHEME://TAIGA_DOMAIN + - name: TAIGA_WEBSOCKETS_URL + value: WEBSOCKETS_SCHEME://TAIGA_DOMAIN + - name: TAIGA_SUBPATH + value: SUBPATH + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data diff --git a/src/main/resources/taiga/taiga-protected-deployment.yml b/src/main/resources/taiga/taiga-protected-deployment.yml new file mode 100644 index 0000000..e91bd21 --- /dev/null +++ b/src/main/resources/taiga/taiga-protected-deployment.yml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: taiga-protected-deployment + labels: + app.kubernetes.part-of: c4k-taiga +spec: + replicas: 1 + selector: + matchLabels: + app: taiga + template: + metadata: + labels: + app: taiga + spec: + - name: taiga-protected + image: taigaio/taiga-protected:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + envFrom: # ToDo secret key ref - secret_key + - secretRef: + name: taiga-back-secret + env: + - name: MAX_AGE + value: ATTACHMENTS_MAX_AGE +# - name: taiga-gateway # ToDo: How to replace the gateway in this setup? + + volumes: + - name: taiga-static + persistentVolumeClaim: + claimName: taiga-static + - name: taiga-media + persistentVolumeClaim: + claimName: taiga-media + - name: taiga-async-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-async-rabbitmq-data + - name: taiga-events-rabbitmq-data + persistentVolumeClaim: + claimName: taiga-events-rabbitmq-data