Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] Switch to pykube-ng to handle arbitrary resources (pods, jobs, etc) #110

Closed
5 tasks
kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Closed
5 tasks
Labels
archive enhancement New feature or request

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

A pull request by nolar at 2019-06-14 09:29:11+00:00
Original URL: zalando-incubator/kopf#110
Merged by nolar at 2019-07-09 13:11:00+00:00

Issue : closes #15, closes #84, closes #137, related #97 (docs).

Description

Switch the internal K8s client library from the official library kubernetes to pykube-ng.

This simplifies handling of arbitrary resource types, such as pods, jobs, etc — for any handlers: both regular handlers (@kopf.on.create/update/delete/resume), and spy-handles (@kopf.on.event).

The previous Kubernetes client library is supported optionally: if present, it will be auto-logged in, to keep compatibility with the previous behaviour. Otherwise, it is ignored. And it is not used anywhere. It will be removed from 1.0 release.

Types of Changes

  • New feature (non-breaking change which adds functionality)
  • Refactor/improvements

PLEASE NOTE: The K8s client library used inside of Kopf is Kopf's internal implementation detail. Only the native data structures (dicts, lists, etc) are exposed from the framework to the operator and accepted back. The operators MUST NOT rely on how Kopf talks to the K8s APIs. It can be requests/requests-async in the future (just as an example). The only dependency is auto-login — to be removed with #59 (the operators must explicitly authenticate themselves; now they can do this on the module-level code only).

Todos

  • Add and examples, revert examples 01/02 to what they were initially.
  • Extend the docs to point that arbitrary resources are supported.
  • Ensure it works in all cases with all features and nothing is broken (a real test-drive for 1-2 weeks).

Review

List of tasks the reviewer must do to review the PR

  • Tests
  • Documentation

Commented by angelbarrera92 at 2019-06-15 08:46:46+00:00
 

I tried this PR locally on K3s and i was having connectivity problems.
For those who want to try it on k3s locally (fedora), please go to the following k3s issue: k3s-io/k3s#24

Thanks nolar for your support!


Commented by nolar at 2019-07-08 13:37:13+00:00
 

All pre-requisites are now in master. This branch is rebased on top of master, with few fixes here & there. The implementation is mainly the same.

Ready for review — to be released as a pre-release version (presumably 0.19rc1), and to be tested in our own apps before going to the public release.


Commented by hjacobs at 2019-07-08 15:02:16+00:00
 

nolar I created a PR to move reasonable changes upstream to pykube-ng: hjacobs/pykube#29


Commented by nolar at 2019-07-09 11:07:09+00:00
 

thilp hjacobs All issues are addressed (I think). Can be re-reviewed. Please, comment/highlight again if I missed something.


Commented by nolar at 2019-07-09 13:18:38+00:00
 

Released as kopf==0.19rc1.

Note: it is a pre-release, so it requires either pip install --pre kopf, or explicit version pinning: pip install kopf==0.19.rc1.

@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] [PR] Switch to pykube-ng to handle arbitrary resources (pods, jobs, etc) Aug 19, 2020
@kopf-archiver kopf-archiver bot added the enhancement New feature or request label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

0 participants