In the past I used PyKube (https://pykube.readthedocs.io/en/latest/readme.html), which did the job. One issue that pykube has is that there is no autocomplete on API object fields. Does kr8s wire this up? Seems you could use a TypedDict on newer versions of Python.
Back in the old days you wouldn't get autocomplete on k8s YAML files either, but now the schema is well-known and so your IDE will complete all the fields (even CRDs). These days you get this with Pulumi, if I'm not mistaken.
I’m not exactly sure what you mean but we can definitely improve auto completion if that’s valuable. Maybe you could try it out and give us some feedback in an issue?
Is there a mypy type for the dict to tell you that only specific keys are valid, and `apiVersion` etc. must be present? And will I get a squiggly in my IDE if I type `apiversion`?
Comments
In the past I used PyKube (https://pykube.readthedocs.io/en/latest/readme.html), which did the job. One issue that pykube has is that there is no autocomplete on API object fields. Does kr8s wire this up? Seems you could use a TypedDict on newer versions of Python.
Back in the old days you wouldn't get autocomplete on k8s YAML files either, but now the schema is well-known and so your IDE will complete all the fields (even CRDs). These days you get this with Pulumi, if I'm not mistaken.
I’m not exactly sure what you mean but we can definitely improve auto completion if that’s valuable. Maybe you could try it out and give us some feedback in an issue?
Another way of putting it would be - are your object manifests typed according to the OpenAPI schema?
If we have:
Is there a mypy type for the dict to tell you that only specific keys are valid, and `apiVersion` etc. must be present? And will I get a squiggly in my IDE if I type `apiversion`?Not currently. You might want to check out Lightkube for this. You can use Lightkube models with kr8s too.