Skip to content

Comment on Show HN: Kr8s – a Python client library for Kubernetesparent

Comments

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:

    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`?

Not currently. You might want to check out Lightkube for this. You can use Lightkube models with kr8s too.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.