Open mmourafiq opened 1 year ago
Thanks @mmourafiq. I'm not 100% sure where to look to resolve this because DaskJob.spec.cluster.spec.scheduler.spec
is just an io.k8s.api.core.v1.PodSpec
and should be validated exactly the same as any other Pod spec. We use k8s-crd-resolver to generate the CRDs from our templates.
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 intOrString
from the machinery is probably not the correct one. I already tried port: "8786"
but the issue with that is that kubernetes would automatically try to resolve a port name if the value is string, i.e. it would complain about the value not starting with a charter value when there are quotes.
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 ofintOrString
?
Sorry for late reply, I just checked again the generated CRD from kubebuilder, and indeed intOrString
is the correct one. But the type needs to change from string
to:
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 string
instead of the port value int
, but the issue could happen to other users and it will easily take ~ an hour of debugging :)
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: