Skip to content

Commit 9bdbf66

Browse files
authored
chore(readiness-probe): add webhook readiness check (#3375)
1 parent ff35f66 commit 9bdbf66

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

helm/aws-load-balancer-controller/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ spec:
202202
livenessProbe:
203203
{{- toYaml . | nindent 10 }}
204204
{{- end }}
205+
{{- with .Values.readinessProbe }}
206+
readinessProbe:
207+
{{- toYaml . | nindent 10 }}
208+
{{- end }}
205209
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
206210
{{- with .Values.nodeSelector }}
207211
nodeSelector:

helm/aws-load-balancer-controller/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@ livenessProbe:
252252
initialDelaySeconds: 30
253253
timeoutSeconds: 10
254254

255+
# readiness probe configuration for the controller
256+
readinessProbe:
257+
failureThreshold: 2
258+
httpGet:
259+
path: /readyz
260+
port: 61779
261+
scheme: HTTP
262+
successThreshold: 1
263+
initialDelaySeconds: 10
264+
timeoutSeconds: 10
265+
255266
# Environment variables to set for aws-load-balancer-controller pod.
256267
# We strongly discourage programming access credentials in the controller environment. You should setup IRSA or
257268
# comparable solutions like kube2iam, kiam etc instead.

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ func main() {
149149
os.Exit(1)
150150
}
151151

152+
// Add readiness probe
153+
err = mgr.AddReadyzCheck("ready-webhook", mgr.GetWebhookServer().StartedChecker())
154+
setupLog.Info("adding readiness check for webhook")
155+
if err != nil {
156+
setupLog.Error(err, "unable add a readiness check")
157+
os.Exit(1)
158+
}
159+
152160
podReadinessGateInjector := inject.NewPodReadinessGate(controllerCFG.PodWebhookConfig,
153161
mgr.GetClient(), ctrl.Log.WithName("pod-readiness-gate-injector"))
154162
corewebhook.NewPodMutator(podReadinessGateInjector).SetupWithManager(mgr)

0 commit comments

Comments
 (0)