kubernetes - 在自定义命名空间下安装 helm chart
问题描述
我正在尝试将一些 helm 图表安装到 Microk8s 集群上的自定义命名空间中,但出现以下错误。我究竟做错了什么?集群是新鲜的,这些命名空间或资源都不存在。
> helm install loki grafana/loki-stack -f values/loki-stack.yaml --namespace loki --create-namespace
W0902 08:08:35.878632 1610435 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-namespace" must equal "loki": current value is "default"
> helm install traefik traefik/traefik -f values/traefik.yml --namespace traefik --create-namespace
Error: rendered manifests contain a resource that already exists. Unable to continue with install:
ClusterRole "traefik" in namespace "" exists and cannot be imported into the current release:
invalid ownership metadata; annotation validation error:
key "meta.helm.sh/release-namespace" must equal "traefik": current value is "default"
解决方案
要部署的资源 ( loki ) 已存在于指定的命名空间中。
请检查helm list -n loki
。
因此,在安装之前,您需要先将其卸载。
helm uninstall loki -n loki
helm install loki grafana/loki-stack -f values/loki-stack.yaml --namespace loki
或者您可以尝试直接更新它:
helm upgrade loki grafana/loki-stack -f values/loki-stack.yaml --namespace loki
推荐阅读
- python - 如何使用诱变剂打印 ID3 标签
- go - path.Join 的可移植性用于 URL 路径
- android - AccountsManager.get(this).getAccounts 始终为 0
- android - 如何使用 RestTemplate 在响应正文(身份验证 Web 服务)中返回令牌?
- c# - 将 byte[] 转换为显式结构的最简单方法
- mysql - MySQL 到 H2 DDL 的问题
- .net - 无法解析 ASP.NET Core DI 类型的服务
- javascript - 有时数据不会从数据库中填充
- angular - 在 Array 中分配新的或更新的实例
- javascript - 获取文本中的点击位置(非输入)