0

I'm migrating helm2 releases to helm3. One of my resources is redis and it's protected from migration. I have to remove it using

kubectl delete statefulsets.apps --cascade=false -nkube-system testme-redis-master

I wanna use the Kubernetes python lib, only that I cannot find the matching function. I'm using CoreV1API.

Jonas
  • 121,568
  • 97
  • 310
  • 388
OLS
  • 155
  • 15

3 Answers3

3

I wanna use the Kubernetes python lib, only that I cannot find the matching function.

You must look in the right API Group.

I'm using CoreV1API.

StatefulSets is in AppsV1 and not in CoreV1, so check that API Group instead.

See the Python Kubernetes client example for Deployment in AppsV1 API Group, it is very similar to StatefulSet

Jonas
  • 121,568
  • 97
  • 310
  • 388
  • this was the right-pointing tip for me. with [@krishna](https://stackoverflow.com/users/5147259/krishna-chaurasia) response, I was able to get the desired documentation. – OLS Jan 16 '21 at 21:12
0

You can go through the following reference doc link which has reference for all the AppsV1 APIs including API usage for deleting the statefulset.

Krishna Chaurasia
  • 8,924
  • 6
  • 22
  • 35
0

You need to use AppsV1Api, where you have delete_namespaced_stateful_set method.

https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/AppsV1Api.md#delete_namespaced_stateful_set

suren
  • 7,817
  • 1
  • 30
  • 51