-
Notifications
You must be signed in to change notification settings - Fork 88
Consider pykube-ng? #15
Comments
After #71, almost all Kubernetes-related code is consolidated in one package: However, the whole codebase of Kopf assumes that the objects manipulated as dicts. Not even the Kubernetes client's "models". A lot of In addition, Kopf promises to hide implementation details from the user ⟹ which means that the user should not know which Kubernetes client is used under the hood ⟹ which means that the internal models/classes must not be exposed ⟹ which means they have to be converted to dicts on arrival. Another tricky part will be watch-streaming. The official Kubernetes client does that in the |
So far, a list of issues detected while trying to switch to pykube:
On a good side:
Basically, the whole trick is achieved by this snippet (undoable in the official K8s client library): version = kwargs.pop("version", "v1")
if version == "v1":
base = kwargs.pop("base", "/api")
elif "/" in version:
base = kwargs.pop("base", "/apis")
else: This alone justifies the effort to continue switching. Preview branch: https://github.com/nolar/kopf/tree/pykube (based on "resume-handlers" not yet merged branch). |
So far so good. The switch to pykube-ng is now fully implemented. The legacy kubernetes official client library is supported optionally (if installed) for auto-authentication, but is not used anywhere else — and I consider removing it completely. The missing pykube-ng's parts are simulated inside The codebase seems functional. And clean. Arbitrary k8s resources (custom and builtin) are supported transparently, as it was prototyped above. The k8s-events are sent, all is fine. What is left: all preceding PRs, on which it is based (all are pending for a review); and some cleanup in general plus the remaining TODOs marks (to be sure nothing is forgotten); and maybe a test-drive for few days in our testing infrastructure with real tasks. Diff (still the same): nolar/kopf@wip/master/20190606...pykube — The diff is huge mostly because of tests (massive changes). |
Originally by @hjacobs :
The text was updated successfully, but these errors were encountered: