From 2b494c7324f224a010fc3c6b0cbee73f3233e968 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Fri, 7 Jun 2024 13:04:52 +0000 Subject: [PATCH 1/3] Fix preStop Manifest --- manifest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.yaml b/manifest.yaml index cb11b8c..bb0e6f1 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -196,7 +196,7 @@ spec: - "bash" args: - "k8s-queues.sh" - PreStop: + preStop: exec: command: ["/bin/sh","-c","kill -s TERM 1; while test $(ps ax | grep -v grep | grep bash | wc -l) -gt 0; do sleep 2s; done"] envFrom: From fd0f14fc9c32b5d187728fadef0a8e478bbab3bd Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Fri, 7 Jun 2024 13:16:47 +0000 Subject: [PATCH 2/3] fix queue worker manifest --- manifest.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifest.yaml b/manifest.yaml index bb0e6f1..5d7fca1 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -188,6 +188,10 @@ spec: containers: - name: ${CI_PROJECT_PATH_SLUG}-queue-worker image: $IMAGE_TAG + lifecycle: + preStop: + exec: + command: ["/bin/sh","-c","kill -s TERM 1; while test $(ps ax | grep -v grep | grep bash | wc -l) -gt 0; do sleep 2s; done"] resources: limits: memory: 512Mi @@ -196,9 +200,6 @@ spec: - "bash" args: - "k8s-queues.sh" - preStop: - exec: - command: ["/bin/sh","-c","kill -s TERM 1; while test $(ps ax | grep -v grep | grep bash | wc -l) -gt 0; do sleep 2s; done"] envFrom: - configMapRef: name: ${CI_PROJECT_PATH_SLUG}-config-map From fdb5ddabd716bbbe52693f9803d2af89e1c036a2 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Fri, 28 Jun 2024 14:47:08 +0200 Subject: [PATCH 3/3] Migration vers new K8S Cluster --- manifest.yaml | 22 ++++------------------ production-resources.yaml | 13 +++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 production-resources.yaml diff --git a/manifest.yaml b/manifest.yaml index 5d7fca1..c21a40a 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -10,7 +10,7 @@ data: APP_DEBUG: "${APP_APP_DEBUG}" APP_URL: "https://www.${APP_DOMAIN}" LOG_CHANNEL: "k8s" - DB_HOST: "mariadb-service.common-services" + DB_HOST: "mariadb.common-services" DB_DATABASE: "${APP_DB_DATABASE}" DB_USERNAME: "${APP_DB_USERNAME}" DB_PASSWORD: "${APP_DB_PASSWORD}" @@ -86,7 +86,7 @@ spec: targetPort: 443 --- -apiVersion: traefik.containo.us/v1alpha1 +apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: name: ${CI_PROJECT_PATH_SLUG}-ingress-route @@ -95,7 +95,7 @@ spec: - web - websecure routes: - - match: Host(`${APP_DOMAIN}`, `www.${APP_DOMAIN}`) + - match: Host(`${APP_DOMAIN}`) || Host(`www.${APP_DOMAIN}`) kind: Rule services: - name: ${CI_PROJECT_PATH_SLUG}-service @@ -104,21 +104,7 @@ spec: - name: redirect-no-www-to-www namespace: common-services tls: - secretName: $APP_DOMAIN - ---- -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: $APP_DOMAIN -spec: - dnsNames: - - $APP_DOMAIN - - www.${APP_DOMAIN} - secretName: $APP_DOMAIN - issuerRef: - name: $APP_CERT_ISSUER - kind: ClusterIssuer + secretName: ${CRT_TLS_NAME} --- apiVersion: batch/v1 diff --git a/production-resources.yaml b/production-resources.yaml new file mode 100644 index 0000000..c297d72 --- /dev/null +++ b/production-resources.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: $APP_DOMAIN +spec: + dnsNames: + - $APP_DOMAIN + - www.${APP_DOMAIN} + secretName: $APP_DOMAIN + issuerRef: + name: $APP_CERT_ISSUER + kind: ClusterIssuer