使用舵机在我的Kubernetes集群上部署图表,因为有一天,我不能部署一个新的或者升级一个已经存在的。
实际上,每次我使用helm时,我都会收到一条错误消息,告诉我不可能安装或升级资源。
如果我运行helm install --name foo . -f values.yaml --namespace foo-namespace,就会得到以下输出:
错误:释放foo失败:服务器找不到所请求的资源
如果运行helm upgrade --install foo . -f values.yaml --namespace foo-namespace或helm upgrade foo . -f values.yaml --namespace foo-namespace,则会出现以下错误:
错误:升级失败:"foo“没有已部署的版本
我不太明白为什么。
这是我的掌舵版本:
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}在我的kubernetes集群上,当我运行kubectl describe pods tiller-deploy-84b... -n kube-system时,我已经用相同版本部署了舵柄:
Name: tiller-deploy-84b8...
Namespace: kube-system
Priority: 0
PriorityClassName: <none>
Node: k8s-worker-1/167.114.249.216
Start Time: Tue, 26 Feb 2019 10:50:21 +0100
Labels: app=helm
name=tiller
pod-template-hash=84b...
Annotations: <none>
Status: Running
IP: <IP_NUMBER>
Controlled By: ReplicaSet/tiller-deploy-84b8...
Containers:
tiller:
Container ID: docker://0302f9957d5d83db22...
Image: gcr.io/kubernetes-helm/tiller:v2.12.3
Image ID: docker-pullable://gcr.io/kubernetes-helm/tiller@sha256:cab750b402d24d...
Ports: 44134/TCP, 44135/TCP
Host Ports: 0/TCP, 0/TCP
State: Running
Started: Tue, 26 Feb 2019 10:50:28 +0100
Ready: True
Restart Count: 0
Liveness: http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
Readiness: http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
Environment:
TILLER_NAMESPACE: kube-system
TILLER_HISTORY_MAX: 0
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from helm-token-... (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
helm-token-...:
Type: Secret (a volume populated by a Secret)
SecretName: helm-token-...
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 26m default-scheduler Successfully assigned kube-system/tiller-deploy-84b86cbc59-kxjqv to worker-1
Normal Pulling 26m kubelet, k8s-worker-1 pulling image "gcr.io/kubernetes-helm/tiller:v2.12.3"
Normal Pulled 26m kubelet, k8s-worker-1 Successfully pulled image "gcr.io/kubernetes-helm/tiller:v2.12.3"
Normal Created 26m kubelet, k8s-worker-1 Created container
Normal Started 26m kubelet, k8s-worker-1 Started container更新
按照应答建议,我运行了这两个命令helm upgrade foo . -f values.yaml --namespace foo-namespace --force \ helm upgrade --install foo . -f values.yaml --namespace foo-namespace --force,但仍然得到了一个错误:
UPGRADE FAILED
ROLLING BACK
Error: failed to create resource: the server could not find the requested resource
Error: UPGRADE FAILED: failed to create resource: the server could not find the requested resource注意,foo-命名空间已经存在。因此,错误不来自命名空间名称。实际上,如果我运行helm list,我可以看到foo图处于FAILED状态。
有人也面临过同样的问题吗?
发布于 2019-03-02 23:46:16
是的,在调试helm发行版时,这种情况经常发生。当以前失败的发行版阻止您更新它时,就会发生问题。
如果您运行helm ls,您应该会看到状态FAILED中的一个版本。您可能已经删除了它,在这种情况下,它可能会在helm ls -a中出现。这样的版本不能使用让helm将新的yaml与旧的yaml进行比较的正常方法来升级,以检测哪些对象要更改,因为它是一个失败的版本。
由于这通常发生在尝试获得新的运行时,我通常会helm delete —purge失败的发行版。不过,这有点过激,所以您可能想尝试进行升级,添加—force
https://devops.stackexchange.com/questions/6482
复制相似问题