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

c7n kubernetes provider #2760

Merged
merged 10 commits into from Sep 5, 2018
Merged

c7n kubernetes provider #2760

merged 10 commits into from Sep 5, 2018

Conversation

kapilt
Copy link
Collaborator

@kapilt kapilt commented Aug 16, 2018

work in progress from hackathon, still needs some testing infrastructure.

@ewbankkit
Copy link
Collaborator

The official Python client library for Kubernetes - https://github.com/kubernetes-client/python - which this work uses seems to have extensive unit tests. We should investigate what can be used.

class resource_type(TypeInfo):
group = 'Core'
version = 'V1'
enum_spec = ('list_namespace', 'items', {'watch': False})
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't watch: False a default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, watch shouldn't be necessary here

},
install_requires=[
"c7n",
"kubernetes==6.0.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably want to update to 7.0.0

@kapilt
Copy link
Collaborator Author

kapilt commented Aug 17, 2018

@ewbankkit i think the operative word wrt to the client tests was 'seems' to.. in practice it looks like smoke and mirrors as the test files are generated and the contents empty afaics for every test file
in https://github.com/kubernetes-client/python/blob/master/kubernetes/test/

@kapilt
Copy link
Collaborator Author

kapilt commented Aug 19, 2018

we can probably leverage some of the azure testing infrastructure here, both are to a common urllib3 adapter pattern, ie. reuse vcr here. not sure how it will play with the watch style method (websocket), but otherwise that should cover off on most api usage.


log = logging.getLogger('custodian.kube')

@clouds.register('kube')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on kube vs k8s for the provider name, if we're going to use an abbreviation, i figure let's use the one common in that community.

@kapilt
Copy link
Collaborator Author

kapilt commented Aug 21, 2018

hmm, looks like kubernetes client api is not compatible with python 3.7 due to use of async keyword.

[update] resolved with upgrade to client lib version 7.0

@kapilt kapilt changed the title [wip] c7n kubernetes provider c7n kubernetes provider Sep 5, 2018
@kapilt
Copy link
Collaborator Author

kapilt commented Sep 5, 2018

renamed provider to k8s, after some discussion with hackathon team that contributed this, going to go ahead and merge as is. intent will be going forward backfilling on test infrastructure (reusing azure vcr/requests integration).

@kapilt kapilt merged commit ff695b9 into master Sep 5, 2018
@kapilt kapilt deleted the c7n_kube branch September 5, 2018 19:53
sampritavh pushed a commit to sampritavh/cloud-custodian that referenced this pull request Nov 22, 2018
lamyanba pushed a commit to lamyanba/cloud-custodian that referenced this pull request Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants