Skip to content

Commit 283e56a

Browse files
committed
fix(grpc): Add startupProbe to check for grpc health readiness (#2791)
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. Upstream-repository: operator-lifecycle-manager Upstream-commit: 8987522f97ea3726b42ce6fe23ce5aa75efa83ba Signed-off-by: Vu Dinh <[email protected]>
1 parent d795a1d commit 283e56a

File tree

2 files changed

+26
-8
lines changed
  • staging/operator-lifecycle-manager/pkg/controller/registry/reconciler
  • vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler

2 files changed

+26
-8
lines changed

staging/operator-lifecycle-manager/pkg/controller/registry/reconciler/reconciler.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,19 @@ func Pod(source *v1alpha1.CatalogSource, name string, image string, saName strin
149149
InitialDelaySeconds: livenessDelay,
150150
TimeoutSeconds: 5,
151151
},
152-
Resources: v1.ResourceRequirements{
153-
Requests: v1.ResourceList{
154-
v1.ResourceCPU: resource.MustParse("10m"),
155-
v1.ResourceMemory: resource.MustParse("50Mi"),
152+
StartupProbe: &corev1.Probe{
153+
ProbeHandler: corev1.ProbeHandler{
154+
Exec: &corev1.ExecAction{
155+
Command: []string{"grpc_health_probe", "-addr=:50051"},
156+
},
157+
},
158+
FailureThreshold: 15,
159+
PeriodSeconds: 10,
160+
},
161+
Resources: corev1.ResourceRequirements{
162+
Requests: corev1.ResourceList{
163+
corev1.ResourceCPU: resource.MustParse("10m"),
164+
corev1.ResourceMemory: resource.MustParse("50Mi"),
156165
},
157166
},
158167
SecurityContext: &v1.SecurityContext{

vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler/reconciler.go

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)