Kaynağa Gözat

build(helm): add preStop command for container

update probe for container
zhanghongtong 4 yıl önce
ebeveyn
işleme
54b0454444
1 değiştirilmiş dosya ile 16 ekleme ve 1 silme
  1. 16 1
      deploy/charts/emqx/templates/StatefulSet.yaml

+ 16 - 1
deploy/charts/emqx/templates/StatefulSet.yaml

@@ -141,8 +141,23 @@ spec:
             httpGet:
             httpGet:
               path: /api/v5/status
               path: /api/v5/status
               port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTP | default 18083 }}
               port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTP | default 18083 }}
-            initialDelaySeconds: 5
+            initialDelaySeconds: 10
             periodSeconds: 5
             periodSeconds: 5
+            failureThreshold: 30
+          livenessProbe:
+            httpGet:
+              path: /api/v5/status
+              port: {{ .Values.emqxConfig.EMQX_DASHBOARD__LISTENER__HTTP | default 18083 }}
+            initialDelaySeconds: 60
+            periodSeconds: 30
+            failureThreshold: 10
+          lifecycle:
+            preStop:
+              exec:
+                command:
+                  - "/opt/emqx/bin/emqx_ctl"
+                  - "cluster"
+                  - "leave"
     {{- with .Values.nodeSelector }}
     {{- with .Values.nodeSelector }}
       nodeSelector:
       nodeSelector:
         {{- toYaml . | nindent 8 }}
         {{- toYaml . | nindent 8 }}