From ce5f11b117142e3803222389a2e6369684044059 Mon Sep 17 00:00:00 2001 From: Abhijeet Jejurkar <69970764+abhijeetjejurkar@users.noreply.github.com> Date: Fri, 18 Mar 2022 12:29:22 +0530 Subject: [PATCH] chore: added Liveliness and Readiness Probes to K8S deployment (#71) --- deployments/k8s/templates/deployment.yaml | 13 +++++++++++++ deployments/k8s/values.yaml | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/deployments/k8s/templates/deployment.yaml b/deployments/k8s/templates/deployment.yaml index 1e99669d..aab5d9ea 100644 --- a/deployments/k8s/templates/deployment.yaml +++ b/deployments/k8s/templates/deployment.yaml @@ -40,6 +40,19 @@ spec: - name: http containerPort: {{ .Values.ports.http }} protocol: TCP + livenessProbe: + httpGet: + path: / + port: {{ .Values.ports.http }} + initialDelaySeconds: {{ .Values.initialDelaySeconds.liveness }} + periodSeconds: {{ .Values.periodSeconds.liveness }} + readinessProbe: + httpGet: + path: / + port: {{ .Values.ports.http }} + initialDelaySeconds: {{ .Values.initialDelaySeconds.readiness }} + periodSeconds: {{ .Values.periodSeconds.readiness }} + resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/deployments/k8s/values.yaml b/deployments/k8s/values.yaml index 0b17c778..32ad646f 100644 --- a/deployments/k8s/values.yaml +++ b/deployments/k8s/values.yaml @@ -17,6 +17,14 @@ ports: # Port where the Server API will be available. http: 80 +#periodSeconds for livenees and Readiness Ports +periodSeconds: + liveness: 10 + readiness: 6 +#initialDelaySeconds for liveness and Readiness Ports +initialDelaySeconds: + liveness: 30 + readiness: 30 # Env vars. Needed for configuring the app. env: {}