无法在kubernetes中删除部署中的复制控制器管理器

时间:2017-01-13 01:56:53

标签: kubernetes

我遇到了一些问题。我删除了一个复制控制器的窗格,现在我想重新创建它。我试过了:

kubectl create -f kube-controller-manager.yaml
Error from server: error when creating "kube-controller-manager.yaml": deployments.extensions "kube-controller-manager" already exists

所以想到:

kubectl delete deployment kube-controller-manager --namespace=kube-system -v=8

有哪些圈子给出了这样的回应:

GET https://k8s-k8s.westfield.io:443/apis/extensions/v1beta1/namespaces/kube-system/deployments/kube-controller-manager
I0112 17:33:53.334288   44607 round_trippers.go:303] Request Headers:
I0112 17:33:53.334301   44607 round_trippers.go:306]     Accept: application/json, */*
I0112 17:33:53.334310   44607 round_trippers.go:306]     User-Agent: kubectl/v1.4.7 (darwin/amd64) kubernetes/92b4f97
I0112 17:33:53.369422   44607 round_trippers.go:321] Response Status: 200 OK in 35 milliseconds
I0112 17:33:53.369445   44607 round_trippers.go:324] Response Headers:
I0112 17:33:53.369450   44607 round_trippers.go:327]     Content-Type: application/json
I0112 17:33:53.369454   44607 round_trippers.go:327]     Date: Fri, 13 Jan 2017 01:33:53 GMT
I0112 17:33:53.369457   44607 round_trippers.go:327]     Content-Length: 1688
I0112 17:33:53.369518   44607 request.go:908] Response Body: {"kind":"Deployment","apiVersion":"extensions/v1beta1","metadata":{"name":"kube-controller-manager","namespace":"kube-system","selfLink":"/apis/extensions/v1beta1/namespaces/kube-system/deployments/kube-controller-manager","uid":"830c83d0-d860-11e6-80d5-066fd61aec22","resourceVersion":"197967","generation":5,"creationTimestamp":"2017-01-12T00:46:10Z","labels":{"k8s-app":"kube-controller-manager"},"annotations":{"deployment.kubernetes.io/revision":"1"}},"spec":{"replicas":0,"selector":{"matchLabels":{"k8s-app":"kube-controller-manager"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"k8s-app":"kube-controller-manager"}},"spec":{"volumes":[{"name":"secrets","secret":{"secretName":"kube-controller-manager","defaultMode":420}},{"name":"ssl-host","hostPath":{"path":"/usr/share/ca-certificates"}}],"containers":[{"name":"kube-controller-manager","image":"quay.io/coreos/hyperkube:v1.4.7_coreos.0","command":["./hyperkube","controller-manager","--root-ca-file=/etc/kubernetes/secrets/ca.crt","--service-account-private-key-file=/etc/kubernetes/secrets/service-account.key","--leader-elect=true","--cloud-provider=aws","--configure-cloud-routes=false"],"resources":{},"volumeMounts":[{"name":"secrets","readOnly":true,"mountPath":"/etc/kubernetes/secrets"},{"name":"ssl-host","readOnly":true,"mountPath":"/etc/ssl/certs"}],"terminationMessagePath":"/dev/termination-log","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"Default","securityContext":{}}},"strategy":{"type":"RollingUpdate","rollingUpdate":{"maxUnavailable":1,"maxSurge":1}},"revisionHistoryLimit":0,"paused":true},"status":{"observedGeneration":3}}
I0112 17:33:54.335302   44607 round_trippers.go:296] GET https://k8s-k8s.westfield.io:443/apis/extensions/v1beta1/namespaces/kube-system/deployments/kube-controller-manager

然后超时 说它等待api响应超时。

Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.7", GitCommit:"92b4f971662de9d8770f8dcd2ee01ec226a6f6c0", GitTreeState:"clean", BuildDate:"2016-12-10T04:49:33Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.7+coreos.0", GitCommit:"0581d1a5c618b404bd4766544bec479aedef763e", GitTreeState:"clean", BuildDate:"2016-12-12T19:04:11Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}

我最初将客户端版本1.5.2降级,看看是否有帮助。它没有。

2 个答案:

答案 0 :(得分:2)

复制控制器定义了pod的外观以及群集中应存在的副本数量。控制器管理器的工作是确保足够的副本是健康的并且正在运行,如果没有,那么它将要求调度程序将pod放置到主机上。

如果您删除了一个pod,那么新的一个应该会自动启动。您只需运行:kubectl delete po <podname>

您尝试删除控制器管理器很有意思。通常在创建之后,您不必触摸它。

答案 1 :(得分:0)

您可以使用以下命令删除复制控制器:

kubectl delete rc kube-controller-manager