diff --git a/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl b/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl index 501e12f4..72b534cc 100644 --- a/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl +++ b/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl @@ -15,6 +15,26 @@ */}} {{- $envAll := . }} +{{- define "etcdreadinessProbeTemplate" }} +exec: + command: + - /bin/sh + - -c + - |- + export ETCDCTL_ENDPOINTS=https://$POD_IP:{{ .Values.network.service_client.target_port }} + etcdctl endpoint health + exit $? +{{- end }} +{{- define "etcdlivenessProbeTemplate" }} +exec: + command: + - /bin/sh + - -c + - |- + export ETCDCTL_ENDPOINTS=https://$POD_IP:{{ .Values.network.service_client.target_port }} + etcdctl endpoint status + exit $? +{{- end }} # Strip off "etcd" from service name to get the application name # Note that application can either be kubernetes or calico for now # and may expand in scope in the future @@ -101,6 +121,8 @@ spec: value: https://$(POD_IP):{{ .Values.network.service_peer.target_port }} - name: MANIFEST_PATH value: /manifests/{{ .Values.service.name }}.yaml +{{ dict "envAll" $envAll "component" "etcd" "container" "etcd" "type" "readiness" "probeTemplate" (include "etcdreadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 6 }} +{{ dict "envAll" $envAll "component" "etcd" "container" "etcd" "type" "liveness" "probeTemplate" (include "etcdlivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 6 }} volumeMounts: - name: data mountPath: /var/lib/etcd diff --git a/charts/etcd/values.yaml b/charts/etcd/values.yaml index 946bc4b6..12e94b91 100644 --- a/charts/etcd/values.yaml +++ b/charts/etcd/values.yaml @@ -114,6 +114,22 @@ pod: etcd: runAsUser: 0 readOnlyRootFilesystem: false + probes: + etcd: + etcd: + liveness: + enabled: true + params: + failureThreshold: 10 + initialDelaySeconds: 15 + periodSeconds: 30 + timeoutSeconds: 3 + readiness: + enabled: true + params: + failureThreshold: 10 + initialDelaySeconds: 5 + periodSeconds: 30 mounts: daemonset_anchor: daemonset_anchor: diff --git a/examples/gate/armada-resources.yaml b/examples/gate/armada-resources.yaml index 29e3db68..76382614 100644 --- a/examples/gate/armada-resources.yaml +++ b/examples/gate/armada-resources.yaml @@ -112,7 +112,7 @@ data: type: git location: https://opendev.org/openstack/openstack-helm-infra.git subpath: helm-toolkit - reference: d6996b8004db35acad7d51412b0b3216189e745f + reference: b7e2d6839ce600a7c1e2103f55d208ad3f5029ca dependencies: [] --- schema: armada/Chart/v1 diff --git a/tools/helm_tk.sh b/tools/helm_tk.sh index 225f7757..0f413a35 100755 --- a/tools/helm_tk.sh +++ b/tools/helm_tk.sh @@ -20,7 +20,7 @@ HELM=${1} HELM_PIDFILE=${2} SERVE_DIR=$(mktemp -d) -HTK_STABLE_COMMIT=${HTK_COMMIT:-"200b5e902b3a176fbfbe669b6a10a254c9b50f5d"} +HTK_STABLE_COMMIT=${HTK_COMMIT:-"b7e2d6839ce600a7c1e2103f55d208ad3f5029ca"} ${HELM} init --client-only