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
.
3
Answers
You must look in the right API Group.
StatefulSets
is inAppsV1
and not inCoreV1
, so check that API Group instead.See the Python Kubernetes client example for Deployment in AppsV1 API Group, it is very similar to
StatefulSet
You can go through the following reference doc link which has reference for all the AppsV1 APIs including API usage for deleting the statefulset.
You need to use
AppsV1Api
, where you havedelete_namespaced_stateful_set
method.https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/AppsV1Api.md#delete_namespaced_stateful_set