为存在的资源安装 Helm 3

Jho*_*n D 25 kubernetes kubernetes-helm

运行时helm install(helm 3.0.2)

我收到以下错误:错误: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: PodSecurityPolicy, namespace: , name: po-kube-state-metrics

但是我没有找到它,并且在错误中我没有得到 ns,我该如何删除它?

运行时,kubectl get all --all-namespaces我看到所有资源,但看不到po-kub-state-metrics... 它也发生在其他资源上,知道吗?

我得到了同样的错误:monitoring-grafanaentity,结果 kubectl get PodSecurityPolicy --all-namespaces是:

monitoring-grafana false RunAsAny RunAsAny RunAsAny RunAsAny false configMap,emptyDir,projected,secret,do

Kam*_*san 40

首先release,在重新安装之前,您需要确保已成功卸载 helm 。

要列出所有版本,请使用:

$ helm list --all --all-namespaces
Run Code Online (Sandbox Code Playgroud)

要卸载发行版,请使用:

$ helm uninstall <release-name> -n <namespace>
Run Code Online (Sandbox Code Playgroud)

您还可以使用--no-hooks跳过命令的运行钩子:

$ helm uninstall <release-name> -n <namespace> --no-hooks
Run Code Online (Sandbox Code Playgroud)

如果卸载不能解决您的问题,您可以尝试以下命令进行清理:

$ helm template <NAME> <CHART> --namespace <NAMESPACE> | kubectl delete -f - 
Run Code Online (Sandbox Code Playgroud)

样本:

$ helm template happy-panda stable/mariadb --namespace kube-system | kubectl delete -f -
Run Code Online (Sandbox Code Playgroud)

现在,再次尝试安装。

更新:

让我们考虑一下您的图表名称是 ,mon而您的版本名称是po。由于您位于图表目录 ( .) 中,如下所示:

.
??? mon
?   ??? Chart.yaml
?   ??? README.md
?   ??? templates
?   ?   ??? one.yaml
?   ?   ??? two.yaml
?   ?   ??? three.yaml
?   ?   ??? _helpers.tpl
?   ?   ??? NOTES.txt
?   ??? values.yaml
Run Code Online (Sandbox Code Playgroud)

然后你可以跳过命令中的 helm repo 名称(即稳定)helm templateHelm将使用mon目录中的图表。

$ helm template po mon --namespace mon | kubectl delete -f -
Run Code Online (Sandbox Code Playgroud)


小智 7

我在部署 Istio 时遇到了同样的问题。所以我做了

kubectl get clusterrole
kubectl get clusterrolebinging
kubectl delete mutatingwebhookconfiguration istio-sidecar-injector
kubectl delete validatingwebhookconfiguration istio-galley
kubectl delete namespace <istio-namespace>
Run Code Online (Sandbox Code Playgroud)

当删除所有并启动时,它起作用了。


Dan*_*ues 5

我对 CRD 对象也有同样的错误。我在 Github 上使用了这个图表,为了防止这个错误,我使用了这个--skip-crds标志。也许您正在使用的项目有这样的内容: https://github.com/helm/charts/tree/master/incubator/sparkoperator#configuration