From 53991041abe2219aa08e7a8b1d767cd6e8927fb6 Mon Sep 17 00:00:00 2001 From: "Fitzpatrick, Steven (sf280x)" Date: Wed, 4 Mar 2020 11:07:19 -0600 Subject: [PATCH] Actually add Kibana Liveness Probe The patch submitted last week mistakenly added a liveness probe for the apache sidecar container instead of the failing Kibana container. Change-Id: I61a979099f5c387a8256788ceab2f91e45d17838 --- kibana/templates/deployment.yaml | 35 +++++++++++++++++--------------- kibana/values.yaml | 14 ++++++++++++- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index 385fa99b4..c51a3047a 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -14,6 +14,19 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "kibanaProbeTemplate" }} +{{- $kibanaPort := tuple "kibana" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} +{{- $esUser := .Values.endpoints.elasticsearch.auth.admin.username }} +{{- $esPass := .Values.endpoints.elasticsearch.auth.admin.password }} +{{- $authHeader := printf "%s:%s" $esUser $esPass | b64enc }} +httpGet: + path: /status + port: {{ $kibanaPort }} + httpHeaders: + - name: Authorization + value: Basic {{ $authHeader }} +{{- end }} + {{- if .Values.manifests.deployment }} {{- $envAll := . }} @@ -28,6 +41,8 @@ limitations under the License. {{- $serviceAccountName := "kibana" }} {{ tuple $envAll "kibana" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $kibanaPort := tuple "kibana" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} --- apiVersion: apps/v1 kind: Deployment @@ -70,15 +85,10 @@ spec: - start ports: - name: http - containerPort: {{ tuple "kibana" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - livenessProbe: - tcpSocket: - port: {{ tuple "kibana" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - initialDelaySeconds: 180 - periodSeconds: 60 + containerPort: {{ $kibanaPort }} readinessProbe: tcpSocket: - port: {{ tuple "kibana" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + port: {{ $kibanaPort }} initialDelaySeconds: 20 periodSeconds: 30 env: @@ -113,15 +123,8 @@ spec: ports: - name: kibana containerPort: {{ tuple "kibana" "internal" "kibana" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - readinessProbe: - httpGet: - path: /status - port: {{ tuple "kibana" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - httpHeaders: - - name: Authorization - value: Basic {{ $authHeader }} - initialDelaySeconds: 20 - periodSeconds: 10 +{{ dict "envAll" . "component" "kibana" "container" "kibana" "type" "liveness" "probeTemplate" (include "kibanaProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} +{{ dict "envAll" . "component" "kibana" "container" "kibana" "type" "readiness" "probeTemplate" (include "kibanaProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} env: - name: ELASTICSEARCH_HOSTS value: {{ $esHosts }} diff --git a/kibana/values.yaml b/kibana/values.yaml index 4378e320b..84b7016e6 100644 --- a/kibana/values.yaml +++ b/kibana/values.yaml @@ -104,7 +104,19 @@ pod: limits: memory: "1024Mi" cpu: "2000m" - + probes: + kibana: + kibana: + liveness: + enabled: true + params: + initialDelaySeconds: 180 + periodSeconds: 60 + readiness: + enabled: true + params: + initialDelaySeconds: 20 + periodSeconds: 30 network_policy: kibana: ingress: