From 2ea6d8fa2cc210e02bb3946e3fb5dde6b2ab81b9 Mon Sep 17 00:00:00 2001 From: akshatsinha007 Date: Mon, 7 Apr 2025 11:46:25 +0530 Subject: [PATCH 1/3] Added liveness-readiness for microservices --- charts/devtron/Chart.yaml | 2 +- charts/devtron/devtron-bom.yaml | 11 ++++++++++- charts/devtron/templates/casbin.yaml | 4 ++-- charts/devtron/templates/dashboard.yaml | 20 ++++++++++++++++++++ charts/devtron/templates/devtron.yaml | 20 ++++++++++++++++++++ charts/devtron/templates/gitsensor.yaml | 20 ++++++++++++++++++++ charts/devtron/templates/kubelink.yaml | 20 ++++++++++++++++++++ charts/devtron/templates/kubewatch.yaml | 20 ++++++++++++++++++++ charts/devtron/templates/lens.yaml | 20 ++++++++++++++++++++ charts/devtron/templates/notifier.yaml | 21 ++++++++++++++++++++- charts/devtron/values.yaml | 9 +++++++++ 11 files changed, 162 insertions(+), 5 deletions(-) diff --git a/charts/devtron/Chart.yaml b/charts/devtron/Chart.yaml index 118ab2e31e..275a3d0a7d 100644 --- a/charts/devtron/Chart.yaml +++ b/charts/devtron/Chart.yaml @@ -11,7 +11,7 @@ keywords: - argocd - Hyperion engine: gotpl -version: 0.22.88 +version: 0.22.89 sources: - https://github.com/devtron-labs/charts dependencies: diff --git a/charts/devtron/devtron-bom.yaml b/charts/devtron/devtron-bom.yaml index 03047b2ceb..a7149efc87 100644 --- a/charts/devtron/devtron-bom.yaml +++ b/charts/devtron/devtron-bom.yaml @@ -37,6 +37,7 @@ components: registry: "" image: "dashboard:a400ce3c-690-31030" imagePullPolicy: IfNotPresent + healthPort: 8080 devtron: registry: "" image: "hyperion:846c2d90-280-31082" @@ -51,6 +52,7 @@ components: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: 1001 + healthPort: 8080 ciRunner: registry: "" image: "ci-runner:d79b15c6-138-31014" @@ -86,10 +88,12 @@ components: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: 1001 + healthPort: 50052 kubewatch: registry: "" image: "kubewatch:34abb17d-419-31007" imagePullPolicy: IfNotPresent + healthPort: 8080 configs: devtroncd_NAMESPACE: "devtron-ci" USE_CUSTOM_HTTP_TRANSPORT: "true" @@ -132,6 +136,7 @@ components: dbconfig: secretName: postgresql-postgresql keyName: postgresql-password + healthPort: 8080 # Values for lens lens: registry: "" @@ -148,6 +153,7 @@ components: dbconfig: secretName: postgresql-postgresql keyName: postgresql-password + healthPort: 8080 # Change below values for nats nats: registry: "" @@ -212,6 +218,7 @@ workflowController: security: imageScanner: image: "image-scanner:34abb17d-141-31016" + healthPort: 8080 configs: TRIVY_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-db TRIVY_JAVA_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-java-db @@ -222,6 +229,7 @@ security: # Values for notifier integration notifier: image: "notifier:c2173311-372-31015" + healthPort: 3000 minio: image: "minio:RELEASE.2021-02-14T04-01-33Z" mbImage: "minio-mc:RELEASE.2021-02-14T04-28-06Z" @@ -263,6 +271,7 @@ devtronEnterprise: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: 1001 + healthPort: 8080 scoop: enabled: false registry: "" @@ -271,4 +280,4 @@ devtronEnterprise: resources: {} configs: CLUSTER_ID: "1" - ORCHESTRATOR_URL: http://devtron-service.devtroncd.svc.cluster.local/orchestrator + ORCHESTRATOR_URL: http://devtron-service.devtroncd.svc.cluster.local/orchestrator \ No newline at end of file diff --git a/charts/devtron/templates/casbin.yaml b/charts/devtron/templates/casbin.yaml index 9d4abfed25..3c9cbb090b 100644 --- a/charts/devtron/templates/casbin.yaml +++ b/charts/devtron/templates/casbin.yaml @@ -55,7 +55,7 @@ spec: failureThreshold: 3 httpGet: path: /health - port: 8080 + port: {{ $.Values.devtronEnterprise.casbin.healthPort}} initialDelaySeconds: 20 periodSeconds: 10 successThreshold: 1 @@ -64,7 +64,7 @@ spec: failureThreshold: 3 httpGet: path: /health - port: 8080 + port: {{ $.Values.devtronEnterprise.casbin.healthPort}} initialDelaySeconds: 20 periodSeconds: 10 successThreshold: 1 diff --git a/charts/devtron/templates/dashboard.yaml b/charts/devtron/templates/dashboard.yaml index be35e89487..5f033101f2 100644 --- a/charts/devtron/templates/dashboard.yaml +++ b/charts/devtron/templates/dashboard.yaml @@ -90,6 +90,26 @@ spec: securityContext: {{- toYaml $.Values.global.containerSecurityContext | nindent 12 }} {{- end }} + livenessProbe: + failureThreshold: 3 + httpGet: + path: / + port: {{ $.Values.components.dashboard.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: / + port: {{ $.Values.components.dashboard.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 ports: - name: app containerPort: 8080 diff --git a/charts/devtron/templates/devtron.yaml b/charts/devtron/templates/devtron.yaml index 3cfa96570e..2ae211dba2 100644 --- a/charts/devtron/templates/devtron.yaml +++ b/charts/devtron/templates/devtron.yaml @@ -278,6 +278,26 @@ spec: - -c - ' curl -X POST -H "Content-Type: application/json" -d ''{"eventType": "SIG_TERM"}'' localhost:8080/orchestrator/telemetry/summary' + livenessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.devtron.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.devtron.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 ports: - name: devtron containerPort: 8080 diff --git a/charts/devtron/templates/gitsensor.yaml b/charts/devtron/templates/gitsensor.yaml index eed39814f6..3aa98912b3 100644 --- a/charts/devtron/templates/gitsensor.yaml +++ b/charts/devtron/templates/gitsensor.yaml @@ -112,6 +112,26 @@ spec: volumeMounts: - name: git-volume mountPath: /git-base/ + livenessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.gitsensor.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.gitsensor.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 env: - name: DEVTRON_APP_NAME value: git-sensor diff --git a/charts/devtron/templates/kubelink.yaml b/charts/devtron/templates/kubelink.yaml index 3c3de6cabd..eab17e5d96 100644 --- a/charts/devtron/templates/kubelink.yaml +++ b/charts/devtron/templates/kubelink.yaml @@ -85,6 +85,26 @@ spec: name: {{ .dbconfig.secretName }} key: {{ .dbconfig.keyName }} {{- end }} + livenessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.kubelink.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.kubelink.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 envFrom: - configMapRef: name: kubelink-cm diff --git a/charts/devtron/templates/kubewatch.yaml b/charts/devtron/templates/kubewatch.yaml index 4e792cad25..f66c81c613 100644 --- a/charts/devtron/templates/kubewatch.yaml +++ b/charts/devtron/templates/kubewatch.yaml @@ -188,6 +188,26 @@ spec: - name: app containerPort: 3000 protocol: TCP + livenessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.kubewatch.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.kubewatch.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 env: - name: POD_NAME valueFrom: diff --git a/charts/devtron/templates/lens.yaml b/charts/devtron/templates/lens.yaml index 6b7afc7aee..d442eee358 100644 --- a/charts/devtron/templates/lens.yaml +++ b/charts/devtron/templates/lens.yaml @@ -84,6 +84,26 @@ spec: securityContext: {{- toYaml $.Values.global.containerSecurityContext | nindent 12 }} {{- end }} + livenessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.lens.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.components.lens.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 ports: - name: app containerPort: 8080 diff --git a/charts/devtron/templates/notifier.yaml b/charts/devtron/templates/notifier.yaml index 282e2c5266..ebc256e8c3 100644 --- a/charts/devtron/templates/notifier.yaml +++ b/charts/devtron/templates/notifier.yaml @@ -88,7 +88,26 @@ spec: securityContext: {{- toYaml $.Values.global.containerSecurityContext | nindent 12 }} {{- end }} - + livenessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.notifier.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health + port: {{ $.Values.notifier.healthPort}} + scheme: HTTP + initialDelaySeconds: 20 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 ports: - name: app containerPort: 3000 diff --git a/charts/devtron/values.yaml b/charts/devtron/values.yaml index 7e9dbe0565..0c739c4789 100644 --- a/charts/devtron/values.yaml +++ b/charts/devtron/values.yaml @@ -85,12 +85,14 @@ components: registry: "" image: "dashboard:a400ce3c-690-31030" imagePullPolicy: IfNotPresent + healthPort: 8080 devtron: registry: "" image: "hyperion:846c2d90-280-31082" cicdImage: "devtron:846c2d90-434-31081" imagePullPolicy: IfNotPresent customOverrides: {} + healthPort: 8080 podSecurityContext: fsGroup: 1001 runAsGroup: 1001 @@ -133,6 +135,7 @@ components: registry: "" image: "kubelink:ccd98a22-564-31008" imagePullPolicy: IfNotPresent + healthPort: 50052 podSecurityContext: fsGroup: 1001 runAsGroup: 1001 @@ -159,6 +162,7 @@ components: registry: "" image: "kubewatch:34abb17d-419-31007" imagePullPolicy: IfNotPresent + healthPort: 8080 configs: devtroncd_NAMESPACE: "devtron-ci" USE_CUSTOM_HTTP_TRANSPORT: "true" @@ -194,6 +198,7 @@ components: enabled: false persistence: volumeSize: 2Gi + healthPort: 8080 configs: PG_ADDR: postgresql-postgresql.devtroncd PG_USER: postgres @@ -210,6 +215,7 @@ components: imagePullPolicy: IfNotPresent secrets: {} resources: {} + healthPort: 8080 configs: GIT_SENSOR_PROTOCOL: GRPC GIT_SENSOR_URL: git-sensor-service.devtroncd:90 @@ -409,6 +415,7 @@ security: enabled: false imageScanner: image: "image-scanner:34abb17d-141-31016" + healthPort: 8080 configs: TRIVY_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-db TRIVY_JAVA_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-java-db @@ -434,6 +441,7 @@ notifier: DB_PORT: "5432" DB_USER: postgres secrets: {} + healthPort: 3000 dbconfig: secretName: postgresql-postgresql keyName: postgresql-password @@ -484,6 +492,7 @@ devtronEnterprise: registry: "" image: "casbin:f6ff5f74-064b67e5-462-30822" imagePullPolicy: IfNotPresent + healthPort: 8080 configs: PG_ADDR: postgresql-postgresql.devtroncd PG_DATABASE: casbin From f4eab384dc3cfce313d9892d517112dce17426e3 Mon Sep 17 00:00:00 2001 From: akshatsinha007 <156403098+akshatsinha007@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:13:21 +0530 Subject: [PATCH 2/3] Update postgresql.yaml --- charts/devtron/templates/postgresql.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/devtron/templates/postgresql.yaml b/charts/devtron/templates/postgresql.yaml index 1295e16664..bba7c18c1f 100644 --- a/charts/devtron/templates/postgresql.yaml +++ b/charts/devtron/templates/postgresql.yaml @@ -515,6 +515,10 @@ spec: secretKeyRef: key: postgresql-password name: postgresql-postgresql + - name: POSTGRES_HOST_AUTH_METHOD + value: "md5" + - name: POSTGRES_INITDB_ARGS + value: "--auth-local=md5" envFrom: - secretRef: name: postgresql-postgresql From 3cb98c2a5dd1f28e0e03859dd06785318fd981af Mon Sep 17 00:00:00 2001 From: akshatsinha007 <156403098+akshatsinha007@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:43:11 +0530 Subject: [PATCH 3/3] Update devtron-bom.yaml --- charts/devtron/devtron-bom.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/devtron/devtron-bom.yaml b/charts/devtron/devtron-bom.yaml index a7149efc87..909133e0b7 100644 --- a/charts/devtron/devtron-bom.yaml +++ b/charts/devtron/devtron-bom.yaml @@ -66,6 +66,7 @@ components: registry: "" image: "kubelink:ccd98a22-564-31008" imagePullPolicy: IfNotPresent + healthPort: 50052 configs: ENABLE_HELM_RELEASE_CACHE: "true" USE_CUSTOM_HTTP_TRANSPORT: "true" @@ -88,7 +89,6 @@ components: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: 1001 - healthPort: 50052 kubewatch: registry: "" image: "kubewatch:34abb17d-419-31007" @@ -280,4 +280,4 @@ devtronEnterprise: resources: {} configs: CLUSTER_ID: "1" - ORCHESTRATOR_URL: http://devtron-service.devtroncd.svc.cluster.local/orchestrator \ No newline at end of file + ORCHESTRATOR_URL: http://devtron-service.devtroncd.svc.cluster.local/orchestrator