Skip to content

Commit

Permalink
fix(grpc): Add startupProbe to check for grpc health readiness (#2791)
Browse files Browse the repository at this point in the history
Currently, liveness and readiness probes may fail due to grpc is not
ready. Adding a startupProbe will ensure grpc is ready before
liveness and readiness probes are triggered.

Signed-off-by: Vu Dinh <vudinh@outlook.com>
  • Loading branch information
dinhxuanvu authored Jun 2, 2022
1 parent 480e621 commit ba59fd0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controller/registry/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ func Pod(source *operatorsv1alpha1.CatalogSource, name string, image string, saN
InitialDelaySeconds: livenessDelay,
TimeoutSeconds: 5,
},
StartupProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
Exec: &corev1.ExecAction{
Command: []string{"grpc_health_probe", "-addr=:50051"},
},
},
FailureThreshold: 15,
PeriodSeconds: 10,
},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("10m"),
Expand Down

0 comments on commit ba59fd0

Please sign in to comment.