使用舵机在我的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有人也面临过同样的问题吗?
更新:
这是我的实际图表foo: structure文件夹的文件夹结构:
> templates/
> deployment.yaml
> ingress.yaml
> service.yaml
> .helmignore
> Chart.yaml
> values.yaml我已经尝试使用delete命令helm del --purge foo删除失败的图表,但也发生了相同的错误。
更准确地说,图表foo实际上是一个使用我自己的私有注册表的自定义图表。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-命名空间已经存在。因此,错误并不来自名称空间名称或名称空间本身。实际上,如果我运行helm list,我可以看到foo图表处于FAILED状态。
发布于 2019-03-26 17:28:30
Tiller将所有版本作为ConfigMaps存储在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重新安装版本。
如果没有帮助,您可以尝试下载更新的Helm 发布 (目前版本2.14.3)并更新/重新安装Tiller。
发布于 2019-08-23 12:36:39
我也有同样的问题,但是清理也没有帮助,在一个全新的k8s集群上尝试相同的舵图也没有帮助。
所以我发现是一个缺失的apiVersion引起了这个问题。我是通过做一个
helm install xyz --dry-run将输出复制到新的test.yaml文件并使用
kubectl apply test.yaml在这里,我看到了错误(apiVersion行被移动到注释行)
发布于 2019-05-23 10:56:49
我也有同样的问题,但不是因为坏的释放。在升级helm.helm之后,似乎较新版本的helm对--wait参数做了错误操作。因此,对于任何面临相同问题的人:只需删除--wait,并将--debug从helm upgrade参数中删除,就可以解决我的问题。
https://stackoverflow.com/questions/54883258
复制相似问题