Helm Grafana/Loki 图表安装错误。渲染的清单包含已存在的资源

发布于 2025-01-12 07:12:49 字数 1661 浏览 4 评论 0原文

我需要在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陌上芳菲 2025-01-19 07:12:49

好吧,我能够解决我的问题。问题是“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.

撩人痒 2025-01-19 07:12:49

问题出在这里:

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"

删除 PodSecurityPolicy 可能是一个解决方案,但更好的是您可以从 loki-grafana 更改注释键 meta.helm.sh/release-name code> 到 loki

另外,我可以看到您正在使用已弃用的 API:

policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+

要解决此问题,请查看 本文档

在 v1.25 中将不再提供 PodDisruptionBudget 的 policy/v1beta1 API 版本。

  • 迁移清单和 API 客户端以使用自 v1.21 起提供的 policy/v1 API 版本。
  • 所有现有的持久对象都可以通过新 API 访问
  • 政策/v1的显着变化:
    - 写入 policy/v1 PodDisruptionBudget 的空 spec.selector ({}) 会选择命名空间中的所有 Pod(在 policy /v1beta1 一个空的 spec.selector 没有选择 pod)。未设置的 spec.selector 不会选择任一 API 版本中的 pod。

PodSecurityPolicy

v1.25 中将不再提供 policy/v1beta1 API 版本中的 PodSecurityPolicy,并且 PodSecurityPolicy 准入控制器将被删除。

PodSecurityPolicy 替换仍在讨论中,但当前使用可以迁移到 第 3 方准入网络钩子现在。

有关 Dynamic 的更多信息,另请参阅此文档准入控制。

Problem is here:

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"

Deleting PodSecurityPolicy could be a solution, but better you can change annotation key meta.helm.sh/release-name from loki-grafana to loki.

Additionally I can see you are using deprecated API:

policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+

To solve it look at this documentation:

The policy/v1beta1 API version of PodDisruptionBudget will no longer be served in v1.25.

  • Migrate manifests and API clients to use the policy/v1 API version, available since v1.21.
  • All existing persisted objects are accessible via the new API
  • Notable changes in policy/v1:
    - an empty spec.selector ({}) written to a policy/v1 PodDisruptionBudget selects all pods in the namespace (in policy/v1beta1 an empty spec.selector selected no pods). An unset spec.selector selects no pods in either API version.

PodSecurityPolicy

PodSecurityPolicy in the policy/v1beta1 API version will no longer be served in v1.25, and the PodSecurityPolicy admission controller will be removed.

PodSecurityPolicy replacements are still under discussion, but current use can be migrated to 3rd-party admission webhooks now.

See also this documentation for more information about Dynamic Admission Control.

别把无礼当个性 2025-01-19 07:12:49

尝试使用 --all-namespaces 标志和 helm ls 来获取所有命名空间中的所有版本。

try this to get all releases in all namespaces, use --all-namespaces flag with helm ls.

朮生 2025-01-19 07:12:49

使用2.10以上的版本。为我工作这个 2.16.0

Use a version superior tthe 2.10. WOrk for me this 2.16.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文