我需要在我的 Kubernetes 集群中安裝帶有 Prometheus 的 Grafana Loki。所以我按照下面的方法安裝它們。它基本上使用 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 官方網站。 https://grafana.com/docs/loki/latest/installation/helm/
但是當我執行上面的 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
uj5u.com熱心網友回復:
好吧,我能夠解決我的問題。問題是“PodSecurityPolicy”。我洗掉了現有的 Grafana PodSecurityPolicy 并且它有效。
uj5u.com熱心網友回復:
試試這個來獲取所有命名空間中的所有版本,使用 --all-namespaces 標志和 helm ls。
uj5u.com熱心網友回復:
問題在這里:
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可能是一種解決方案,但更好的是您可以將注釋鍵meta.helm.sh/release-name從更改loki-grafana為loki。
此外,我可以看到您正在使用已棄用的 API:
policy/v1beta1 PodSecurityPolicy is deprecated in v1.21 , unavailable in v1.25
要解決它,請查看此檔案:
PodDisruptionBudget的 policy/v1beta1 API 版本將不再在 v1.25 中提供。
- 遷移清單和 API 客戶端以使用自 v1.21 起可用的 policy/v1 API 版本。
- 所有現有的持久化物件都可以通過新的 API 訪問
- policy/v1中的顯著變化 : -寫入 PodDisruptionBudget的空
spec.selector( ) 選擇命名空間中的所有 pod(在 空的 選擇的無 pod 中)。unset 在任一 API 版本中都不選擇任何 pod。{}policy/v1policy/v1beta1spec.selectorspec.selectorPodSecurityPolicy
在 v1.25中, policy/v1beta1 API 版本中的 PodSecurityPolicy 將不再提供,PodSecurityPolicy 準入控制器將被移除。
PodSecurityPolicy 替代品仍在討論中,但現在可以將當前使用遷移到 3rd-party admission webhook 。
另請參閱此檔案以獲取有關動態準入控制的更多資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/439787.html
