diff --git a/helm-charts/FATE/templates/mysql-module.yaml b/helm-charts/FATE/templates/mysql-module.yaml index 838966925..950a2afbd 100644 --- a/helm-charts/FATE/templates/mysql-module.yaml +++ b/helm-charts/FATE/templates/mysql-module.yaml @@ -197,6 +197,26 @@ spec: value: root ports: - containerPort: 3306 + # livenessProbe: + # exec: + # command: + # - mysqladmin + # - ping + # initialDelaySeconds: 60 + # periodSeconds: 10 + # timeoutSeconds: 5 + # successThreshold: 1 + # failureThreshold: 3 + # readinessProbe: + # exec: + # command: + # - mysqladmin + # - ping + # initialDelaySeconds: 60 + # periodSeconds: 10 + # timeoutSeconds: 5 + # successThreshold: 1 + # failureThreshold: 3 volumeMounts: - name: mysql-confs mountPath: /docker-entrypoint-initdb.d/ diff --git a/helm-charts/FATE/templates/python-spark.yaml b/helm-charts/FATE/templates/python-spark.yaml index 3546760ef..7a2c7b0eb 100644 --- a/helm-charts/FATE/templates/python-spark.yaml +++ b/helm-charts/FATE/templates/python-spark.yaml @@ -277,6 +277,42 @@ spec: ports: - containerPort: 9360 - containerPort: 9380 + livenessProbe: + exec: + command: + - bash + - -c + - | + curl -X POST -H "Content-Type: application/json" \ + -d {} "http://${POD_IP}:9380/v1/version/get" + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + exec: + command: + - bash + - -c + - | + curl -X POST -H "Content-Type: application/json" \ + -d {} "http://${POD_IP}:9380/v1/version/get" + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + startupProbe: + exec: + command: + - bash + - -c + - | + curl -X POST -H "Content-Type: application/json" \ + -d {} "http://${POD_IP}:9380/v1/version/get" + failureThreshold: 30 + periodSeconds: 10 command: - /bin/bash - -c @@ -351,9 +387,9 @@ spec: {{- end }} {{- if .Values.modules.python.serviceAccountName }} serviceAccountName: {{ .Values.modules.python.serviceAccountName }} -{{- else -}} +{{- else }} serviceAccountName: {{ template "serviceAccountName" . }} -{{- end -}} +{{- end }} restartPolicy: Always volumes: - name: eggroll-confs diff --git a/k8s-deploy/kubefate.yaml b/k8s-deploy/kubefate.yaml index 147a5f0ee..2ba199b85 100644 --- a/k8s-deploy/kubefate.yaml +++ b/k8s-deploy/kubefate.yaml @@ -65,6 +65,39 @@ spec: value: "true" ports: - containerPort: 8080 + livenessProbe: + httpGet: + path: / + port: 8080 + httpHeaders: + - name: X-Custom-Header + value: livenessProbe + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + httpGet: + path: / + port: 8080 + httpHeaders: + - name: X-Custom-Header + value: readinessProbe + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + startupProbe: + httpGet: + path: / + port: 8080 + httpHeaders: + - name: X-Custom-Header + value: startupProbe + failureThreshold: 30 + periodSeconds: 10 restartPolicy: Always --- apiVersion: apps/v1 @@ -111,6 +144,26 @@ spec: volumeMounts: - name: mariadb-data mountPath: /var/lib/mysql + livenessProbe: + exec: + command: + - mysqladmin + - ping + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + exec: + command: + - mysqladmin + - ping + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 restartPolicy: Always volumes: - name: mariadb-data