From d312844f1cfdfa4ef7d7cd7d380cc75281b19de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Mon, 27 May 2024 08:42:20 +0200 Subject: [PATCH] fix --- apps/taiga/taiga_ConfigMap.tf | 3 +- apps/taiga/taiga_Service.tf | 4 +-- apps/taiga/taiga_workload.tf | 56 +++++++++++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/apps/taiga/taiga_ConfigMap.tf b/apps/taiga/taiga_ConfigMap.tf index 46df3bd..3e360b9 100644 --- a/apps/taiga/taiga_ConfigMap.tf +++ b/apps/taiga/taiga_ConfigMap.tf @@ -13,6 +13,7 @@ resource "kubectl_manifest" "cm_env_back" { TAIGA_URL: https://${local.dns_name} TAIGA_SITES_DOMAIN: ${local.dns_name} TAIGA_SITES_SCHEME: https + TAIGA_ASYNC_RABBITMQ_HOST: ${kubectl_manifest.rabbit.name} SESSION_COOKIE_SECURE: "False" CSRF_COOKIE_SECURE: "False" ENABLE_TELEMETRY: "False" @@ -33,7 +34,7 @@ resource "kubectl_manifest" "cm_env_front" { apiVersion: v1 kind: ConfigMap metadata: - name: "${var.instance}-${var.component}-from" + name: "${var.instance}-${var.component}-front" labels: ${jsonencode(local.common_labels)} namespace: ${var.namespace} data: diff --git a/apps/taiga/taiga_Service.tf b/apps/taiga/taiga_Service.tf index 03f205e..7965135 100644 --- a/apps/taiga/taiga_Service.tf +++ b/apps/taiga/taiga_Service.tf @@ -96,9 +96,9 @@ resource "kubectl_manifest" "svc_front" { spec: type: ClusterIP ports: - - name: taiga-front + - name: http port: 80 - targetPort: taiga-front + targetPort: http selector: ${jsonencode(local.front_labels)} EOF } diff --git a/apps/taiga/taiga_workload.tf b/apps/taiga/taiga_workload.tf index 8ce5db7..7c5c5bd 100644 --- a/apps/taiga/taiga_workload.tf +++ b/apps/taiga/taiga_workload.tf @@ -3,7 +3,7 @@ resource "kubectl_manifest" "Deployment_taiga-events" { apiVersion: apps/v1 kind: Deployment metadata: - name: taiga-events + name: "${var.instance}-${var.component}-events" labels: ${jsonencode(local.event_all_labels)} namespace: ${var.namespace} spec: @@ -37,6 +37,26 @@ resource "kubectl_manifest" "Deployment_taiga-events" { ports: - name: taiga-events containerPort: 8888 + - name: health + containerPort: 3023 + livenessProbe: + httpGet: + path: /healthz + port: health + initialDelaySeconds: 20 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /healthz + port: health + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 EOF } # livenessProbe: @@ -63,7 +83,7 @@ resource "kubectl_manifest" "Deployment_taiga-front" { apiVersion: apps/v1 kind: Deployment metadata: - name: taiga-front + name: "${var.instance}-${var.component}-front" labels: ${jsonencode(local.front_all_labels)} namespace: ${var.namespace} spec: @@ -85,8 +105,21 @@ resource "kubectl_manifest" "Deployment_taiga-front" { - configMapRef: name: ${kubectl_manifest.cm_env_front.name} ports: - - name: taiga-front + - name: http containerPort: 80 + livenessProbe: + httpGet: + path: / + port: http + httpHeaders: + initialDelaySeconds: 3 + periodSeconds: 3 + readinessProbe: + httpGet: + path: /ready + port: http + initialDelaySeconds: 3 + periodSeconds: 3 EOF } @@ -95,7 +128,7 @@ resource "kubectl_manifest" "Deployment_taiga-protected" { apiVersion: apps/v1 kind: Deployment metadata: - name: taiga-protected + name: "${var.instance}-${var.component}-protected" labels: ${jsonencode(local.protected_all_labels)} namespace: ${var.namespace} spec: @@ -129,7 +162,7 @@ resource "kubectl_manifest" "Deployment_taiga-back" { apiVersion: apps/v1 kind: Deployment metadata: - name: taiga-back + name: "${var.instance}-${var.component}-back" labels: ${jsonencode(local.back_all_labels)} namespace: ${var.namespace} spec: @@ -256,5 +289,18 @@ resource "kubectl_manifest" "Deployment_taiga-back" { - name: taiga-conf configMap: name: ${kubectl_manifest.cm_nginx.name} + livenessProbe: + httpGet: + path: / + port: http + httpHeaders: + initialDelaySeconds: 3 + periodSeconds: 3 + readinessProbe: + httpGet: + path: /ready + port: http + initialDelaySeconds: 3 + periodSeconds: 3 EOF }