Skip to content

Commit 8cb2146

Browse files
committed
Statefulset Liveness Probe failing on standby nodes due to SSL, initial delay and 429 response hashicorp#137
livenessProbe * Set the scheme to the vault.scheme to ensure that the check is works tls enabled or not. * Allow a configurable value initialDelaySeconds rather than the set 5 seconds. * Set the default initialDelaySeconds to 60 seconds before the probe starts to allow for vault unsealing. * Set the path to /v1/sys/health?standbyok=true to ensure a 200 response on standbys. readinessProbe * Set the path comment to /v1/sys/health?standbyok=true to ensure a 200 response on standbys. Unit Tests * Statefulset liveness probe path check set to /v1/sys/health?standbyok=true
1 parent 4a743f6 commit 8cb2146

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

templates/server-statefulset.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ spec:
110110
httpGet:
111111
path: {{ .Values.server.livenessProbe.path | quote }}
112112
port: 8200
113-
initialDelaySeconds: 5
113+
scheme: {{ include "vault.scheme" . | upper }}
114+
initialDelaySeconds: {{ .Values.server.livenessProbe.initialDelaySeconds }}
114115
periodSeconds: 3
115116
successThreshold: 1
116117
timeoutSeconds: 5

test/unit/server-statefulset.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -781,5 +781,5 @@ load _helpers
781781
--set 'server.livenessProbe.enabled=true' \
782782
. | tee /dev/stderr |
783783
yq -r '.spec.template.spec.containers[0].livenessProbe.httpGet.path' | tee /dev/stderr)
784-
[ "${actual}" = "/v1/sys/health?standbyok" ]
785-
}
784+
[ "${actual}" = "/v1/sys/health?standbyok=true" ]
785+
}

values.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ server:
6464
readinessProbe:
6565
enabled: true
6666
# If you need to use a http path instead of the default exec
67-
# path: /v1/sys/health?standbyok
67+
# path: /v1/sys/health?standbyok=true
6868
# Used to enable a livenessProbe for the pods
6969
livenessProbe:
7070
enabled: false
71-
path: /v1/sys/health?standbyok
71+
path: "/v1/sys/health?standbyok=true"
72+
initialDelaySeconds: 60
7273

7374
# extraEnvironmentVars is a list of extra enviroment variables to set with the stateful set. These could be
7475
# used to include variables required for auto-unseal.

0 commit comments

Comments
 (0)