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

Support for k8s client/server version > 1.16 #160

Open
inianv opened this issue Oct 12, 2020 · 0 comments
Open

Support for k8s client/server version > 1.16 #160

inianv opened this issue Oct 12, 2020 · 0 comments

Comments

@inianv
Copy link

inianv commented Oct 12, 2020

This module really seemed promising for one of the uses cases I was trying to solve. But hit a speedbump of having no support for APIs in k8s Client Version: v1.17.0 and Server Version: v1.17.6.

Because per the official https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/ few of the APIs this module is based on will be deprecated.

For e.g. I set up a simple daemonset lister e.g. as

#!/usr/bin/env python3

from kubernetes_py import K8sConfig
from kubernetes_py import K8sDaemonSet

# Defaults found in ~/.kube/config
cfg_default = K8sConfig()

daemonset =  K8sDaemonSet(config=cfg_default, name="daemonset-name")
daemonset.list()

but never got it to work, always hitting requested resource not found error

Traceback (most recent call last):
  File "list-daemonsets.py", line 12, in <module>
    daemonset.list()
  File "/usr/local/lib/python3.6/site-packages/kubernetes_py/K8sDaemonSet.py", line 40, in list
    ls = super(K8sDaemonSet, self).list(labels=labels)
  File "/usr/local/lib/python3.6/site-packages/kubernetes_py/K8sObject.py", line 291, in list
    raise BadRequestException(message)
kubernetes_py.K8sExceptions.BadRequestException: K8sObject: LIST failed : HTTP 404 : the server could not find the requested resource

Realized from models that the queries were using v1beta1 instead of apps/v1. How do I make this work on versions >1.16 or is there something I've missed

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

No branches or pull requests

1 participant