kubernetes: Can't delete statefulsets

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

/kind bug

/kind feature

What happened: Can’t delete a statefulsets and I get an error error: error when stopping “workers.yml”: no kind “GetOptions” is registered for version “apps/v1”

$ kubectl auth can-i get  statefulsets
yes
$ kubectl auth can-i create  statefulsets
yes
$ kubectl auth can-i delete  statefulsets
yes

What you expected to happen: statefulsets will be delete

How to reproduce it (as minimally and precisely as possible): Create a statefulsets and try to delete it

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: worker
spec:
  serviceName: "experience1"
  replicas: 4
  selector:
    matchLabels:
      app: experience1
  template:
    metadata:
      labels:
        app: experience1
    spec:
      containers:
      - name: ssh
        image: ..... 

Anything else we need to know?: It works with a “cluster-admin” role

Environment:

  • Kubernetes version (use kubectl version): Client Version: version.Info{Major:“1”, Minor:“7”, GitVersion:“v1.7.6”, GitCommit:“4bc5e7f9a6c25dc4c03d4d656f2cefd21540e28c”, GitTreeState:“clean”, BuildDate:“2017-09-14T06:55:55Z”, GoVersion:“go1.8.3”, Compiler:“gc”, Platform:“darwin/amd64”} Server Version: version.Info{Major:“1”, Minor:“9”, GitVersion:“v1.9.2+coreos.0”, GitCommit:“b427929b2982726eeb64e985bc1ebb41aaa5e095”, GitTreeState:“clean”, BuildDate:“2018-01-18T22:56:14Z”, GoVersion:“go1.9.2”, Compiler:“gc”, Platform:“linux/amd64”}

  • Cloud provider or hardware configuration: Bare metal

  • OS (e.g. from /etc/os-release): NAME=“Ubuntu” VERSION=“16.04.3 LTS (Xenial Xerus)” ID=ubuntu ID_LIKE=debian PRETTY_NAME=“Ubuntu 16.04.3 LTS” VERSION_ID=“16.04” HOME_URL=“http://www.ubuntu.com/” SUPPORT_URL=“http://help.ubuntu.com/” BUG_REPORT_URL=“http://bugs.launchpad.net/ubuntu/” VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial

  • Kernel (e.g. uname -a): Linux 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

  • Install tools: GPUs Daemonsets

  • Others:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 17
  • Comments: 43 (12 by maintainers)

Most upvoted comments

I upgraded my kubernetes-cli to 1.9.3 and statefulset deletion worked fine with no issues. It seems to be the incompatibility issue in client 1.8.2

I solved by deleting it from the dashboard instead of using the CLI.

Reproduced:

IBMMasterMBP:~ bjxzi$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-27T00:13:02Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.11-2+fa6873d3e386d7", GitCommit:"fa6873d3e386d7ead42923b24aea3b76e74395a3", GitTreeState:"clean", BuildDate:"2018-04-17T08:10:40Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

IBMMasterMBP:~ bjxzi$ kubectl delete sts api -n default --force -v=9
I0508 16:27:50.701625    8176 loader.go:357] Config loaded from file /Users/bjxzi/.bluemix/plugins/container-service/clusters/bcf-develop/kube-config-dal10-bcf-develop.yml
I0508 16:27:50.714521    8176 round_trippers.go:386] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.10.0 (darwin/amd64) kubernetes/fc32d2f" https://169.46.7.238:28641/apis/apps/v1/namespaces/default/statefulsets/api
I0508 16:27:51.715543    8176 round_trippers.go:405] GET https://169.46.7.238:28641/apis/apps/v1/namespaces/default/statefulsets/api 404 Not Found in 1001 milliseconds
I0508 16:27:51.715580    8176 round_trippers.go:411] Response Headers:
I0508 16:27:51.715592    8176 round_trippers.go:414]     Content-Type: application/json
I0508 16:27:51.715602    8176 round_trippers.go:414]     Content-Length: 174
I0508 16:27:51.715611    8176 round_trippers.go:414]     Date: Tue, 08 May 2018 08:27:51 GMT
I0508 16:27:51.715660    8176 request.go:874] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}
I0508 16:27:51.716699    8176 helpers.go:201] server response object: [{
  "metadata": {},
  "status": "Failure",
  "message": "the server could not find the requested resource",
  "reason": "NotFound",
  "details": {},
  "code": 404
}]
F0508 16:27:51.716733    8176 helpers.go:119] Error from server (NotFound): the server could not find the requested resource

This might be gcloud issue. kubectl provided by gcloud latest (189) is still 1.8.6. But GKE allows creation of 1.9.2, hence probably we are facing this issue.

== Statefulset deletion issue when using 1.8.6 client and 1.9.2 master ==

I’m using gcloud provided kubectl version with GKE and sill facing the issue.

$ kubectl version Client Version: version.Info{Major:“1”, Minor:“8”, GitVersion:“v1.8.6”, GitCommit:“6260bb08c46c31eea6cb538b34a9ceb3e406689c”, GitTreeState:“clean”, BuildDate:“2017-12-21T06:34:11Z”, GoVersion:“go1.8.3”, Compiler:“gc”, Platform:“linux/amd64”} Server Version: version.Info{Major:“1”, Minor:“9+”, GitVersion:“v1.9.2-gke.1”, GitCommit:“4ce7af72d8d343ea2f7680348852db641ff573af”, GitTreeState:“clean”, BuildDate:“2018-01-31T22:30:55Z”, GoVersion:“go1.9.2b4”, Compiler:“gc”, Platform:“linux/amd64”}

$ which kubectl …google-cloud-sdk/bin/kubectl

$ gcloud version Google Cloud SDK 189.0.0 alpha 2017.09.15 beta 2017.09.15 bq 2.0.29 core 2018.02.12 gcloud gsutil 4.28 kubectl

$ kubectl delete statefulset foo -v=4 I0217 06:52:26.732817 13294 request.go:606] Error in request: no kind “GetOptions” is registered for version “apps/v1” F0217 06:52:26.733069 13294 helpers.go:120] error: no kind “GetOptions” is registered for version “apps/v1”

I have encountered this issue trying to delete a StatefulSet in 1.8 cluster (kops@AWS) using kubectl 1.10.2. Downgrading kubectl to 1.9.7 fixed the issue.

Google’s reply was “download 1.9x kubectl” if you want one. They didn’t commit to when gcloud will include it.

On Tue, Mar 20, 2018, 8:24 PM calina notifications@github.com wrote:

@vishwaspai https://github.com/vishwaspai Did google respond to you? I’m having the same issue. @wilk https://github.com/wilk are you aware of any other way to delete the statefulset? We’re not using the kubernetes dashboard.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/kubernetes/issues/59867#issuecomment-374627355, or mute the thread https://github.com/notifications/unsubscribe-auth/AHct72uyxp72BxFlLV7F6WJO3j_zDeAIks5tgRg2gaJpZM4SFRKe .

@dhurley14 - I’ve asked google the same question using our support account. Will update this thread if there is anything worth sharing.

Same issue using kubectl 1.10.0 and 1.10.1 trying to delete a StatefulSet in 1.8.8-gke.0. Running with kubectl 1.8.6 worked.

/sig bugs

Had this issue as well with 1.7.4. Upgrading to 1.9.3 eliminated the problem and the error message.

I can also confirm that upgrading kubectl to 1.9.3 can help to delete the statefulset. But the error message remains.