Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Kubernetes builtin grpc health checks #662

Closed
ahmetb opened this issue Dec 14, 2021 · 5 comments
Closed

Switch to Kubernetes builtin grpc health checks #662

ahmetb opened this issue Dec 14, 2021 · 5 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: cleanup An internal cleanup or hygiene concern.

Comments

@ahmetb
Copy link
Contributor

ahmetb commented Dec 14, 2021

I recommend doing this when (1) grpc builtin health checks are in a stable Kubernetes version (2) it's been 6 months since that version is released.

Kubernetes now supports builtin grpc health checks for probes, so we can stop using the grpc-health-probe tool I wrote for this project and further cut down external dependencies. It looks like this:

@@ -44,11 +44,15 @@ spec:
         # - name: JAEGER_SERVICE_ADDR
         #   value: "jaeger-collector:14268"
         readinessProbe:
-          exec:
-            command: ["/bin/grpc_health_probe", "-addr=:3550"]
+          grpc:
+            port: 3550
         livenessProbe:
-          exec:
-            command: ["/bin/grpc_health_probe", "-addr=:3550"]
+          grpc:
+            port: 3550
         resources:
           requests:
             cpu: 100m
@Shabirmean Shabirmean added priority: p2 Moderately-important priority. Fix may not be included in next release. type: cleanup An internal cleanup or hygiene concern. labels Dec 15, 2021
@xtineskim xtineskim added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 6, 2022
@mathieu-benoit mathieu-benoit added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 19, 2022
@mathieu-benoit
Copy link
Contributor

mathieu-benoit commented Apr 20, 2022

This new implementation by upstream Kubernetes will be ideal indeed.

This feature is at the alpha state with Kubernetes 1.23, so it won't be yet adopted on stable channel with GKE or other managed offer out there. 1.22 for default in rapid as we speak.

Note: the official doc for this feature is mentioning liveness probe but is it working for readiness probe too?

Other note: for the transition, could we have 2 Dockerfile files per app in order to have both container images, with or without the grpc_health_probe binary? It will allow options for the end users adopting this feature or not while it will become more stable/by default.

@mathieu-benoit
Copy link
Contributor

Sharing the good progress of this feature in Kubernetes upstream, with the 1.24 release:

With Kubernetes 1.24, the gRPC probes functionality has entered beta and is available by default. You can now configure startup, liveness, and readiness probes for your gRPC app natively within Kubernetes without exposing an HTTP endpoint or using an extra executable.

@mathieu-benoit
Copy link
Contributor

mathieu-benoit commented May 13, 2022

Easy to do even with GKE 1.23 (alpha + rapid) like documented here: https://kubernetes.io/blog/2022/05/13/grpc-probes-now-in-beta/ :)

@mathieu-benoit
Copy link
Contributor

Since 0.4.1 it's now an optional Online Boutique variation (i.e. a Kustomize overlay) you could leverage. See associated blog article illustrating this: https://medium.com/google-cloud/b5bd26253a4c.

@minherz
Copy link
Contributor

minherz commented Apr 24, 2023

Closing the issue because the mentioned functionality is implemented as the native-grpc-health-check kustomize component.

@minherz minherz closed this as completed Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

5 participants