3 ms·
In the past I used PyKube (https://pykube.readthedocs.io/en/latest/readme.html https://pykube.readthedocs.io/en/latest/readme.html), which did the job. One issu
by theptip 3y ago
In the past I used PyKube (https://pykube.readthedocs.io/en/latest/readme.html 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.
- jacobtomlinson 3y agoI’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?
- theptip 3y agoAnother way of putting it would be - are your object manifests typed according to the OpenAPI schema? If we have: pod = Pod({ "apiVersion": "v1", "kind": "Pod", "metadata": { "name": "my-pod", }, "spec": { "containers": [{"name": "pause", "image": "gcr.io/google_containers/pause",}] }, }) 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`?
- jacobtomlinson 3y agoNot currently. You might want to check out Lightkube for this. You can use Lightkube models with kr8s too.