Browse Source

Merge pull request #194 from emqx/add_readinessProbe_on_helm_chart

Add readiness probe on helm chart
jinfahua 5 years ago
parent
commit
083740918d

+ 1 - 1
.github/workflows/fvt_tests.yaml

@@ -221,7 +221,7 @@ jobs:
             sleep 10
             sleep 10
           done
           done
           kuiper_address=$(kubectl get svc --namespace default kuiper -o jsonpath="{.spec.clusterIP}")
           kuiper_address=$(kubectl get svc --namespace default kuiper -o jsonpath="{.spec.clusterIP}")
-          if [ $(curl -w %{http_code} -fsSL -o /dev/null $kuiper_address:9081/rules) != 200 ];then exit 1; fi
+          if [ $(curl -w %{http_code} -fsSL -o /dev/null $kuiper_address:9081) != 200 ];then exit 1; fi
       - name: check kuiper
       - name: check kuiper
         env:
         env:
           KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"
           KUBECONFIG: "/etc/rancher/k3s/k3s.yaml"

+ 6 - 0
deploy/chart/kuiper/templates/StatefulSet.yaml

@@ -105,6 +105,12 @@ spec:
           - name: kuiper-config
           - name: kuiper-config
             mountPath: "/kuiper/etc/sources/zmq.yaml"
             mountPath: "/kuiper/etc/sources/zmq.yaml"
             subPath: "zmq.yaml"
             subPath: "zmq.yaml"
+          readinessProbe:
+            httpGet:
+              {{ $restPort := index .Values "kuiperConfig" "kuiper.yaml" "basic" "restPort" }}
+              port: {{ $restPort | default 9081 }}
+            initialDelaySeconds: 5
+            periodSeconds: 5
           {{ $certificationSecretName := index .Values "kuiperConfig" "mqtt_source.yaml" "default" "certificationSecretName" }}
           {{ $certificationSecretName := index .Values "kuiperConfig" "mqtt_source.yaml" "default" "certificationSecretName" }}
           {{- if $certificationSecretName }}
           {{- if $certificationSecretName }}
           - name: kuiper-certification
           - name: kuiper-certification