-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Readiness/Liveness probes do not accept integer port #778
Comments
Thanks @mmourafiq. I'm not 100% sure where to look to resolve this because I note that our CRD templates are referencing the Kubernetes 1.21.1 spec so perhaps bumping those to a more recent version would help?
|
I see, I think the issue is in the k8s-crd-resolver, the choice of |
We can patch things and do in a couple of places already. Maybe we should do that here? Do you know what type should it be instead of |
Sorry for late reply, I just checked again the generated CRD from kubebuilder, and indeed anyOf:
- type: integer
- type: string Not sure if this is supported, but here's the full generated spec: port:
anyOf:
- type: integer
- type: string
description: Name or number of the port to access
on the container. Number must be in the range
1 to 65535. Name must be an IANA_SVC_NAME.
x-kubernetes-int-or-string: true Hope this helps. P.S. I reworked the converter in our application to use the port name |
Describe the issue:
Although the specification of the cluster is suggesting
int_or_type
, using integer probes raises an error, here's an example based on the documentation where the porthttp_dashboard
is8786
, basically:is replaced with this:
If you check the type definition of the probes, e.g. python definition https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1HTTPGetAction.md, you will notice that it's of type object and accepts string or integer, here's also the kubernetes docs: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request
Full example:
Anything else we need to know?:
The error during the submission:
Environment:
The text was updated successfully, but these errors were encountered: