From d90eb125ed3222a98e088d336cc20113f1bb1cdb Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 2 Oct 2019 16:22:26 +0200 Subject: [PATCH] Allow configuration of armada-api/tiller probes Allows to configure the probes via values.yaml in both the armada charts, which includes armada and tiller containers, and in the standalone tiller chart Also bumps the osh sha in tools/helm_tk.sh to latest 22ef25ab295d6b7c6797cfffaa77cf181c673e9b Change-Id: I0bb0acf00ecc0b61f8d324fe9b6a8507c361e9fc --- charts/armada/templates/deployment-api.yaml | 57 ++++++++----------- charts/armada/values.yaml | 30 ++++++++++ .../tiller/templates/deployment-tiller.yaml | 36 ++++++------ charts/tiller/values.yaml | 19 +++++++ tools/helm_tk.sh | 2 +- 5 files changed, 90 insertions(+), 54 deletions(-) diff --git a/charts/armada/templates/deployment-api.yaml b/charts/armada/templates/deployment-api.yaml index 5887984e..872c024b 100644 --- a/charts/armada/templates/deployment-api.yaml +++ b/charts/armada/templates/deployment-api.yaml @@ -14,6 +14,26 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "armadaApiProbeTemplate" }} +httpGet: + path: /api/v1.0/health + port: {{ tuple "armada" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} +{{- end }} + +{{- define "tillerReadinessProbeTemplate" }} +httpGet: + path: /readiness + port: 44135 + scheme: HTTP +{{- end }} + +{{- define "tillerLivenessProbeTemplate" }} +httpGet: + path: /liveness + port: 44135 + scheme: HTTP +{{- end }} + {{- if .Values.manifests.deployment_api }} {{- $envAll := . }} {{- $mounts_armada_api := .Values.pod.mounts.armada_api.armada_api }} @@ -109,19 +129,8 @@ spec: ports: - name: armada-api containerPort: {{ tuple "armada" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - livenessProbe: - httpGet: - path: /api/v1.0/health - port: {{ tuple "armada" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - initialDelaySeconds: 15 - periodSeconds: 10 - readinessProbe: - httpGet: - scheme: HTTP - path: /api/v1.0/health - port: {{ tuple "armada" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - initialDelaySeconds: 15 - periodSeconds: 10 +{{ dict "envAll" $envAll "component" "armada" "container" "api" "type" "readiness" "probeTemplate" (include "armadaApiProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} +{{ dict "envAll" $envAll "component" "armada" "container" "api" "type" "liveness" "probeTemplate" (include "armadaApiProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} volumeMounts: - name: pod-tmp mountPath: /tmp @@ -175,26 +184,8 @@ spec: - name: tiller containerPort: {{ .Values.conf.tiller.port }} protocol: TCP - readinessProbe: - failureThreshold: 3 - httpGet: - path: /readiness - port: 44135 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - livenessProbe: - failureThreshold: 3 - httpGet: - path: /liveness - port: 44135 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 +{{ dict "envAll" $envAll "component" "armada" "container" "tiller" "type" "readiness" "probeTemplate" (include "tillerReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} +{{ dict "envAll" $envAll "component" "armada" "container" "tiller" "type" "liveness" "probeTemplate" (include "tillerLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} {{- end }} {{ if $mounts_armada_api.volumeMounts }}{{ toYaml $mounts_armada_api.volumeMounts | indent 12 }}{{ end }} volumes: diff --git a/charts/armada/values.yaml b/charts/armada/values.yaml index b78f9217..9016cbaa 100644 --- a/charts/armada/values.yaml +++ b/charts/armada/values.yaml @@ -225,6 +225,36 @@ monitoring: port: 8000 pod: + probes: + armada: + api: + readiness: + enabled: true + params: + initialDelaySeconds: 15 + periodSeconds: 10 + liveness: + enabled: true + params: + initialDelaySeconds: 15 + periodSeconds: 10 + tiller: + readiness: + enabled: true + params: + failureThreshold: 3 + initialDelaySeconds: 1 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + liveness: + enabled: true + params: + failureThreshold: 3 + initialDelaySeconds: 1 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 security_context: armada: pod: diff --git a/charts/tiller/templates/deployment-tiller.yaml b/charts/tiller/templates/deployment-tiller.yaml index 207c20ea..ac2285f3 100644 --- a/charts/tiller/templates/deployment-tiller.yaml +++ b/charts/tiller/templates/deployment-tiller.yaml @@ -14,6 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "tillerReadinessProbeTemplate" }} +httpGet: + scheme: HTTP + path: /readiness + port: 44135 +{{- end }} + +{{- define "tillerLivenessProbeTemplate" }} +httpGet: + scheme: HTTP + path: /liveness + port: 44135 +{{- end }} + {{- if .Values.manifests.deployment_tiller }} {{- $envAll := . }} {{- $serviceAccountName := "tiller-deploy" }} @@ -98,25 +112,7 @@ spec: - name: tiller containerPort: 44134 protocol: TCP - readinessProbe: - failureThreshold: 3 - httpGet: - path: /readiness - port: 44135 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - livenessProbe: - failureThreshold: 3 - httpGet: - path: /liveness - port: 44135 - scheme: HTTP - initialDelaySeconds: 1 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 +{{ dict "envAll" $envAll "component" "tiller" "container" "tiller" "type" "readiness" "probeTemplate" (include "tillerReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} +{{ dict "envAll" $envAll "component" "tiller" "container" "tiller" "type" "liveness" "probeTemplate" (include "tillerLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} status: {} {{- end }} diff --git a/charts/tiller/values.yaml b/charts/tiller/values.yaml index 38f2b41e..a6e16c6c 100644 --- a/charts/tiller/values.yaml +++ b/charts/tiller/values.yaml @@ -51,6 +51,25 @@ conf: prestop_sleep: 30 pod: + probes: + tiller: + tiller: + readiness: + enabled: true + params: + failureThreshold: 3 + initialDelaySeconds: 1 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + liveness: + enabled: true + params: + failureThreshold: 3 + initialDelaySeconds: 1 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 resources: enabled: false tiller: diff --git a/tools/helm_tk.sh b/tools/helm_tk.sh index 21ba4e4b..02b0e0cd 100755 --- a/tools/helm_tk.sh +++ b/tools/helm_tk.sh @@ -22,7 +22,7 @@ HELM=${1} HELM_PIDFILE=${2} SERVE_DIR=$(mktemp -d) -HTK_STABLE_COMMIT=${HTK_COMMIT:-"200b5e902b3a176fbfbe669b6a10a254c9b50f5d"} +HTK_STABLE_COMMIT=${HTK_COMMIT:-"22ef25ab295d6b7c6797cfffaa77cf181c673e9b"} ${HELM} init --client-only