Helm Grafana/Loki 图表安装错误。渲染的清单包含已存在的资源
我需要在 Kubernetes 集群中安装 Grafana Loki 和 Prometheus。所以我按照下面的步骤安装它们。它基本上使用 Helm 来安装它。以下是我执行安装它的命令。
helm upgrade --install loki grafana/loki-stack --set grafana.enabled=true,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false,loki.persistence.enabled=true,loki.persistence.storageClassName=standard,loki.persistence.size=5Gi -n monitoring --create-namespace
在这种情况下,我关注了 Grafana 官方网站。
但是当我执行上面的 helm 命令时,出现以下错误。事实上,我是 Helm 的新手。
Release "loki" does not exist. Installing it now.
W0307 16:54:55.764184 1474330 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
Error: rendered manifests contain a resource that already exists. Unable to continue with install: PodSecurityPolicy "loki-grafana" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "loki": current value is "loki-grafana"
我没有看到安装任何 Grafana 图表。
helm list -A
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
cert-manager cert-manager 1 2021-11-26 13:07:26.103036078 +0000 UTC deployed cert-manager-v0.16.1 v0.16.1
ingress-nginx ingress-basic 1 2021-11-18 12:23:28.476712359 +0000 UTC deployed ingress-nginx-4.0.8 1.0.5
I need to install Grafana Loki with Prometheus in my Kubernetes cluster. So I followed the below to install them. It basically uses Helm to install it. Below is the command which I executed to install it.
helm upgrade --install loki grafana/loki-stack --set grafana.enabled=true,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false,loki.persistence.enabled=true,loki.persistence.storageClassName=standard,loki.persistence.size=5Gi -n monitoring --create-namespace
I followed the official Grafana website in this case.
But when I execute the above helm command, I get the below error. In fact, I'm new to Helm.
Release "loki" does not exist. Installing it now.
W0307 16:54:55.764184 1474330 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
Error: rendered manifests contain a resource that already exists. Unable to continue with install: PodSecurityPolicy "loki-grafana" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "loki": current value is "loki-grafana"
I don't see any Grafana chart installed.
helm list -A
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
cert-manager cert-manager 1 2021-11-26 13:07:26.103036078 +0000 UTC deployed cert-manager-v0.16.1 v0.16.1
ingress-nginx ingress-basic 1 2021-11-18 12:23:28.476712359 +0000 UTC deployed ingress-nginx-4.0.8 1.0.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好吧,我能够解决我的问题。问题是“PodSecurityPolicy”。我删除了现有的 Grafana PodSecurityPolicy 并且它起作用了。
Well, I was able to get through my issue. The issue was "PodSecurityPolicy". I deleted the existing Grafana PodSecurityPolicy and it worked.
问题出在这里:
删除
PodSecurityPolicy
可能是一个解决方案,但更好的是您可以从loki-grafana
更改注释键meta.helm.sh/release-name
code> 到loki
。另外,我可以看到您正在使用已弃用的 API:
要解决此问题,请查看 本文档:
有关 Dynamic 的更多信息,另请参阅此文档准入控制。
Problem is here:
Deleting
PodSecurityPolicy
could be a solution, but better you can change annotation keymeta.helm.sh/release-name
fromloki-grafana
toloki
.Additionally I can see you are using deprecated API:
To solve it look at this documentation:
See also this documentation for more information about Dynamic Admission Control.
尝试使用 --all-namespaces 标志和 helm ls 来获取所有命名空间中的所有版本。
try this to get all releases in all namespaces, use --all-namespaces flag with helm ls.
使用2.10以上的版本。为我工作这个 2.16.0
Use a version superior tthe 2.10. WOrk for me this 2.16.0