gpt4 book ai didi

kubernetes - Kubernetes 集群上 Helm 安装或升级发布失败 : the server could not find the requested resource or UPGRADE FAILED: no deployed releases

转载 作者:行者123 更新时间:2023-12-03 23:48:07 29 4
gpt4 key购买 nike

使用 helm 在我的 Kubernetes 集群上部署图表,因为有一天,我无法部署新的图表或升级存在的图表。

事实上,每次我使用 helm 时,我都会收到一条错误消息,告诉我无法安装或升级资源。

如果我运行 helm install --name foo . -f values.yaml --namespace foo-namespace我有这个输出:

Error: release foo failed: the server could not find the requested resource



如果我运行 helm upgrade --install foo . -f values.yaml --namespace foo-namespacehelm upgrade foo . -f values.yaml --namespace foo-namespace我有这个错误:

Error: UPGRADE FAILED: "foo" has no deployed releases



我真的不明白为什么。

这是我的 Helm 版本:
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

有人遇到过同样的问题吗?

更新:

这是我名为 foo 的实际图表的文件夹结构:
图表的结构文件夹:
> templates/
> deployment.yaml
> ingress.yaml
> service.yaml
> .helmignore
> Chart.yaml
> values.yaml

我已经尝试使用删除命令 helm del --purge foo 删除失败的图表但发生了同样的错误。

更准确地说,图表 foo 实际上是使用我自己的私有(private)注册表的自定义图表。 ImagePullSecret 正常设置。

我已经运行了这两个命令 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-namespace 已经存在。所以错误不是来自命名空间名称或命名空间本身。确实,如果我运行 helm list ,我可以看到 图表位于 FAILED地位。

最佳答案

Tiller 将所有版本作为 ConfigMap 存储在 Tiller 的命名空间中(在您的情况下为 kube-system)。尝试找到损坏的版本并使用命令删除它的 ConfigMap:

$ kubectl get cm --all-namespaces -l OWNER=TILLER
NAMESPACE NAME DATA AGE
kube-system nginx-ingress.v1 1 22h

$ kubectl delete cm nginx-ingress.v1 -n kube-system

接下来,手动删除所有发布对象(部署、服务、入口等)并再次使用 helm 重新安装发布。

如果没有帮助,您可以尝试下载更新的 release Helm(目前为 v2.14.3)并更新/重新安装 Tiller。

关于kubernetes - Kubernetes 集群上 Helm 安装或升级发布失败 : the server could not find the requested resource or UPGRADE FAILED: no deployed releases,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54883258/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com