Commit 601e54a0 authored by Afzal Ansari's avatar Afzal Ansari Committed by Shinya Maeda
Browse files

feat: add support for http headers on liveness/readiness probes

parent dfc53d76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
apiVersion: v1
description: GitLab's Auto-deploy Helm Chart
name: auto-deploy-app
version: 2.34.0
version: 2.35.0
icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
+9 −0
Original line number Diff line number Diff line
@@ -77,12 +77,18 @@
| ingress.annotations           | Ingress annotations | See [`_ingress-annotations.yaml`](./templates/_ingress-annotations.yaml) |
| livenessProbe.path            | Path to access on the HTTP server on periodic probe of container liveness. | `/`                                |
| livenessProbe.scheme          | Scheme to access the HTTP server (HTTP or HTTPS). | `HTTP`                                |
| livenessProbe.httpHeaders       | List of additional custom headers to send on the server | `[]`                                |
| livenessProbe.httpHeaders.name  | Name of the custom header | `nil`                                |
| livenessProbe.httpHeaders.value | Value of the header | `nil`                                |
| livenessProbe.initialDelaySeconds | # of seconds after the container has started before liveness probes are initiated. | `15`                               |
| livenessProbe.timeoutSeconds  | # of seconds after which the liveness probe times out. | `15`                               |
| livenessProbe.probeType       | Type of [liveness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes) to use. | `httpGet`
| livenessProbe.command         | Commands for use with probe type 'exec'. | `{}`
| readinessProbe.path           | Path to access on the HTTP server on periodic probe of container readiness. | `/`                                |
| readinessProbe.scheme         | Scheme to access the HTTP server (HTTP or HTTPS). | `HTTP`                                |
| readinessProbe.httpHeaders      | List of additional custom headers to send on the server | `[]`                                |
| readinessProbe.httpHeaders.name | Name of the custom header | `nil`                                |
| readinessProbe.httpHeaders.value | Value of the header | `nil`                                |
| readinessProbe.initialDelaySeconds | # of seconds after the container has started before readiness probes are initiated. | `5`                                |
| readinessProbe.timeoutSeconds | # of seconds after which the readiness probe times out. | `3`                                |
| readinessProbe.probeType     | Type of [readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes) to use. | `httpGet`
@@ -90,6 +96,9 @@
| startupProbe.enabled         | If true, enables startup probe. | `/`                                |
| startupProbe.path            | Path to access on the HTTP server on periodic probe of container startup. | `/`                                |
| startupProbe.scheme          | Scheme to access the HTTP server (HTTP or HTTPS). | `HTTP`                                |
| startUpProbe.httpHeaders      | List of additional custom headers to send on the server | `[]`                                |
| startUpProbe.httpHeaders.name | Name of the custom header | `nil`                                |
| startUpProbe.httpHeaders.value | Value of the header | `nil`                                |
| startupProbe.initialDelaySeconds | # of seconds after the container has started before startup probes are initiated. | `5`                                |
| startupProbe.timeoutSeconds  | # of seconds after which the startup probe times out. | `3`                                |
| startupProbe.failureThreshold | # of times, Kubernetes will retry failed probes before giving up. | `30`                                |
+22 −1
Original line number Diff line number Diff line
@@ -148,6 +148,13 @@ spec:
            path: {{ .Values.livenessProbe.path }}
            scheme: {{ .Values.livenessProbe.scheme }}
            port: {{ .Values.livenessProbe.port | default .Values.service.internalPort }}
{{- if .Values.livenessProbe.httpHeaders }}
            httpHeaders:
{{- range $httpHeader := .Values.livenessProbe.httpHeaders }}
            - name: {{ $httpHeader.name }}
              value: {{ $httpHeader.value }}
{{- end }}
{{- end }}
{{- else if eq .Values.livenessProbe.probeType "tcpSocket" }}
          tcpSocket:
            port: {{ .Values.livenessProbe.port | default .Values.service.internalPort }}
@@ -164,6 +171,13 @@ spec:
            path: {{ .Values.readinessProbe.path }}
            scheme: {{ .Values.readinessProbe.scheme }}
            port: {{ .Values.readinessProbe.port | default .Values.service.internalPort }}
{{- if .Values.readinessProbe.httpHeaders }}
            httpHeaders:
{{- range $httpHeader := .Values.readinessProbe.httpHeaders }}            
            - name: {{ $httpHeader.name }}
              value: {{ $httpHeader.value }}
{{- end }}
{{- end }}
{{- else if eq .Values.readinessProbe.probeType "tcpSocket" }}
          tcpSocket:
            port: {{ .Values.readinessProbe.port | default .Values.service.internalPort }}
@@ -181,7 +195,14 @@ spec:
            path: {{ .Values.startupProbe.path }}
            scheme: {{ .Values.startupProbe.scheme }}
            port: {{ .Values.startupProbe.port | default .Values.service.internalPort }}
{{- else if eq .Values.startupProbe.probeType "tcpSocket" }}
{{- if .Values.startupProbe.httpHeaders }}
            httpHeaders:
{{- range $httpHeader := .Values.startupProbe.httpHeaders }}
            - name: {{ $httpHeader.name }}
              value: {{ $httpHeader.value }}
{{- end }}
{{- end }}
{{- else if eq .Values.readinessProbe.probeType "tcpSocket" }}
          tcpSocket:
            port: {{ .Values.startupProbe.port | default .Values.service.internalPort }}
{{- else if eq .Values.startupProbe.probeType "exec" }}
+14 −0
Original line number Diff line number Diff line
@@ -117,6 +117,13 @@ items:
              path: {{ $livenessProbeConfig.path }}
              scheme: {{ $livenessProbeConfig.scheme }}
              port: {{ $livenessProbeConfig.port | default $.Values.service.internalPort }}
{{- if $livenessProbeConfig.httpHeaders }}
              httpHeaders:
{{- range $httpHeader := $livenessProbeConfig.httpHeaders }}
              - name: {{ $httpHeader.name }}
                value: {{ $httpHeader.value }}
{{- end }}
{{- end }}
{{- else if eq $livenessProbeConfig.probeType "tcpSocket" }}
            tcpSocket:
              port: {{ $livenessProbeConfig.port | default $.Values.service.internalPort }}
@@ -137,6 +144,13 @@ items:
              path: {{ $readinessProbeConfig.path }}
              scheme: {{ $readinessProbeConfig.scheme }}
              port: {{ $readinessProbeConfig.port | default $.Values.service.internalPort }}
{{- if $readinessProbeConfig.httpHeaders }}
              httpHeaders:
{{- range $httpHeader := $readinessProbeConfig.httpHeaders }}
              - name: {{ $httpHeader.name }}
                value: {{ $httpHeader.value }}
{{- end }}
{{- end }}
{{- else if eq $readinessProbeConfig.probeType "tcpSocket" }}
            tcpSocket:
              port: {{ $readinessProbeConfig.port | default $.Values.service.internalPort }}
+32 −8
Original line number Diff line number Diff line
@@ -418,6 +418,8 @@ func TestDeploymentTemplate(t *testing.T) {
			Release:  "production",
			Values: map[string]string{
				"livenessProbe.port":                 "1234",
				"livenessProbe.httpHeaders[0].name":  "custom-header",
				"livenessProbe.httpHeaders[0].value": "awesome",
			},
			ExpectedLivenessProbe: &coreV1.Probe{
				Handler: coreV1.Handler{
@@ -425,6 +427,12 @@ func TestDeploymentTemplate(t *testing.T) {
						Path:   "/",
						Port:   intstr.FromInt(1234),
						Scheme: coreV1.URISchemeHTTP,
						HTTPHeaders: []coreV1.HTTPHeader{
							coreV1.HTTPHeader{
								Name:  "custom-header",
								Value: "awesome",
							},
						},
					},
				},
				InitialDelaySeconds: 15,
@@ -438,6 +446,8 @@ func TestDeploymentTemplate(t *testing.T) {
			Release:  "production",
			Values: map[string]string{
				"readinessProbe.port":                 "2345",
				"readinessProbe.httpHeaders[0].name":  "custom-header",
				"readinessProbe.httpHeaders[0].value": "awesome",
			},
			ExpectedLivenessProbe: defaultLivenessProbe(),
			ExpectedReadinessProbe: &coreV1.Probe{
@@ -446,6 +456,12 @@ func TestDeploymentTemplate(t *testing.T) {
						Path:   "/",
						Port:   intstr.FromInt(2345),
						Scheme: coreV1.URISchemeHTTP,
						HTTPHeaders: []coreV1.HTTPHeader{
							coreV1.HTTPHeader{
								Name:  "custom-header",
								Value: "awesome",
							},
						},
					},
				},
				InitialDelaySeconds: 5,
@@ -459,6 +475,8 @@ func TestDeploymentTemplate(t *testing.T) {
			Values: map[string]string{
				"startupProbe.enabled":              "true",
				"startupProbe.port":                 "2345",
				"startupProbe.httpHeaders[0].name":  "custom-header",
				"startupProbe.httpHeaders[0].value": "awesome",
			},
			ExpectedLivenessProbe:  defaultLivenessProbe(),
			ExpectedReadinessProbe: defaultReadinessProbe(),
@@ -468,6 +486,12 @@ func TestDeploymentTemplate(t *testing.T) {
						Path:   "/",
						Port:   intstr.FromInt(2345),
						Scheme: coreV1.URISchemeHTTP,
						HTTPHeaders: []coreV1.HTTPHeader{
							coreV1.HTTPHeader{
								Name:  "custom-header",
								Value: "awesome",
							},
						},
					},
				},
				InitialDelaySeconds: 5,
Loading