From d73d73eb2e2e155b3a1bd6bfba4c64596f89f0d0 Mon Sep 17 00:00:00 2001 From: dnskr Date: Thu, 11 May 2023 11:01:17 +0800 Subject: [PATCH] [KYUUBI #4819] [K8S][HELM] Refactor liveness and readiness probes ### _Why are the changes needed?_ The changes are needed to follow common flat structure pattern for liveness and readiness probes, for example: - [Airflow](https://github.com/apache/airflow/blob/584a9f5dae5b29a1968fbdbc9b1edd01ae2be4d2/chart/values.yaml#L961-L973) - [Superset](https://github.com/apache/superset/blob/e3719a1b076228dcfae3cdd82844bdfe48b552ec/helm/superset/values.yaml#L300-L317) - [Bitnami PostgreSQL](https://github.com/bitnami/charts/blob/8f2277440b976d52785ba9149762ad8620a73d1f/bitnami/postgresql/values.yaml#L390-L410) - [ArgoCD](https://github.com/argoproj/argo-helm/blob/b37a9e72a68d8fafe3cddd14cf2b3ed6722eff4a/charts/argo-cd/values.yaml#L1631-L1653) ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request Closes #4819 from dnskr/helm_refactor_probes. Closes #4819 eb692379f [dnskr] [K8S][HELM] Refactor liveness and readiness probes Authored-by: dnskr Signed-off-by: Cheng Pan --- .../kyuubi/templates/kyuubi-deployment.yaml | 24 ++++++------- charts/kyuubi/values.yaml | 34 ++++++++++--------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/charts/kyuubi/templates/kyuubi-deployment.yaml b/charts/kyuubi/templates/kyuubi-deployment.yaml index beca0998a..79d49a653 100644 --- a/charts/kyuubi/templates/kyuubi-deployment.yaml +++ b/charts/kyuubi/templates/kyuubi-deployment.yaml @@ -65,25 +65,25 @@ spec: containerPort: {{ $frontend.port }} {{- end }} {{- end }} - {{- if .Values.probe.liveness.enabled }} + {{- if .Values.livenessProbe.enabled }} livenessProbe: exec: command: ["/bin/bash", "-c", "bin/kyuubi status"] - initialDelaySeconds: {{ .Values.probe.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probe.liveness.periodSeconds }} - timeoutSeconds: {{ .Values.probe.liveness.timeoutSeconds }} - failureThreshold: {{ .Values.probe.liveness.failureThreshold }} - successThreshold: {{ .Values.probe.liveness.successThreshold }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} {{- end }} - {{- if .Values.probe.readiness.enabled }} + {{- if .Values.readinessProbe.enabled }} readinessProbe: exec: command: ["/bin/bash", "-c", "$KYUUBI_HOME/bin/kyuubi status"] - initialDelaySeconds: {{ .Values.probe.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probe.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probe.readiness.timeoutSeconds }} - failureThreshold: {{ .Values.probe.readiness.failureThreshold }} - successThreshold: {{ .Values.probe.readiness.successThreshold }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} {{- end }} {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml index 7eca72113..d97fc982b 100644 --- a/charts/kyuubi/values.yaml +++ b/charts/kyuubi/values.yaml @@ -41,22 +41,6 @@ rbac: resources: ["pods"] verbs: ["create", "list", "delete"] -probe: - liveness: - enabled: true - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 2 - failureThreshold: 10 - successThreshold: 1 - readiness: - enabled: true - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 2 - failureThreshold: 10 - successThreshold: 1 - server: # Thrift Binary protocol (HiveServer2 compatible) thriftBinary: @@ -162,6 +146,24 @@ resources: {} # cpu: 2 # memory: 4Gi +# Liveness probe +livenessProbe: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 10 + successThreshold: 1 + +# Readiness probe +readinessProbe: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 10 + successThreshold: 1 + # Constrain Kyuubi server pods to specific nodes nodeSelector: {} tolerations: []