From c5d85557370e2e24a1b32ce27e2b0b8716db4c7f Mon Sep 17 00:00:00 2001 From: Carsten Sonyi Date: Mon, 24 Jun 2024 19:24:21 +0200 Subject: [PATCH 1/2] feat: add liveness + readiness Probe to deployment --- .../templates/cert-manager/cert-manager.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/helm/cert-exporter/templates/cert-manager/cert-manager.yaml b/helm/cert-exporter/templates/cert-manager/cert-manager.yaml index 30624ff..589d4a5 100644 --- a/helm/cert-exporter/templates/cert-manager/cert-manager.yaml +++ b/helm/cert-exporter/templates/cert-manager/cert-manager.yaml @@ -51,6 +51,17 @@ spec: {{- toYaml .Values.certManager.resources | nindent 12 }} volumeMounts: {{- toYaml .Values.certManager.volumeMounts | nindent 12 }} + livenessProbe: + tcpSocket: + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /metrics + port: 8080 + failureThreshold: 1 + periodSeconds: 10 {{- with .Values.certManager.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} From 7d8bd75f4381889315303fe013af42d617dbb6d5 Mon Sep 17 00:00:00 2001 From: Carsten Sonyi Date: Mon, 24 Jun 2024 19:54:50 +0200 Subject: [PATCH 2/2] use .Values.certManager.containerPort instead of hard-coded values across the helm-chart --- helm/cert-exporter/templates/cert-manager/cert-manager.yaml | 6 +++--- helm/cert-exporter/templates/cert-manager/service.yaml | 2 +- helm/cert-exporter/values.yaml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/helm/cert-exporter/templates/cert-manager/cert-manager.yaml b/helm/cert-exporter/templates/cert-manager/cert-manager.yaml index 589d4a5..9142b2e 100644 --- a/helm/cert-exporter/templates/cert-manager/cert-manager.yaml +++ b/helm/cert-exporter/templates/cert-manager/cert-manager.yaml @@ -45,7 +45,7 @@ spec: {{- end}} ports: - name: http - containerPort: 8080 + containerPort: {{ .Values.certManager.containerPort }} protocol: TCP resources: {{- toYaml .Values.certManager.resources | nindent 12 }} @@ -53,13 +53,13 @@ spec: {{- toYaml .Values.certManager.volumeMounts | nindent 12 }} livenessProbe: tcpSocket: - port: 8080 + port: {{ .Values.certManager.containerPort }} initialDelaySeconds: 10 periodSeconds: 10 readinessProbe: httpGet: path: /metrics - port: 8080 + port: {{ .Values.certManager.containerPort }} failureThreshold: 1 periodSeconds: 10 {{- with .Values.certManager.nodeSelector }} diff --git a/helm/cert-exporter/templates/cert-manager/service.yaml b/helm/cert-exporter/templates/cert-manager/service.yaml index 5547bd9..3190f08 100644 --- a/helm/cert-exporter/templates/cert-manager/service.yaml +++ b/helm/cert-exporter/templates/cert-manager/service.yaml @@ -13,6 +13,6 @@ spec: ports: - port: {{ .Values.service.port }} name: {{ .Values.service.portName }} - targetPort: 8080 + targetPort: {{ .Values.certManager.containerPort }} selector: {{ include "cert-exporter.certManagerSelectorLabels" . | nindent 6 }} diff --git a/helm/cert-exporter/values.yaml b/helm/cert-exporter/values.yaml index 2f090ef..944ce63 100644 --- a/helm/cert-exporter/values.yaml +++ b/helm/cert-exporter/values.yaml @@ -63,6 +63,8 @@ certManager: # name: kubelet # readOnly: true + containerPort: 8080 + service: type: ClusterIP port: 8080