【问题标题】:Annotation Validation Error when trying to install Vault on OpenShift尝试在 OpenShift 上安装 Vault 时出现注释验证错误
【发布时间】:2022-02-01 18:47:55
【问题描述】:

按照tutorial在OpenShift上使用Helm安装Vault,执行命令后遇到以下错误:

bash
helm install vault hashicorp/vault -n $VAULT_NAMESPACE -f my_values.yaml

对于配置:

values.yaml
bash
echo '# Custom values for the Vault chart
global:
  # If deploying to OpenShift
  openshift: true
server:
  dev:
    enabled: true
  serviceAccount:
    create: true
    name: vault-sa
injector:
  enabled: true
authDelegator:
  enabled: true' > my_values.yaml

错误:

$ helm install vault hashicorp/vault -n $VAULT_NAMESPACE -f values.yaml
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "vault-agent-injector-clusterrole" 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 "my-vault-1": current value is "my-vault-0"

到底发生了什么,或者我如何重置这个特定的命名空间以指向正确的发布命名空​​间?

【问题讨论】:

    标签: openshift hashicorp-vault


    【解决方案1】:

    您之前是否偶然尝试过完全相同的事情,因为这就是错误所暗示的。 如果我们剖析错误,我们就能找到问题的根源:

    Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists.
    

    因此,集群上已经存在您尝试通过 helm chart 部署的某些内容。

    Unable to continue with install:
    

    Helm 由于此故障而中止

    ClusterRole "vault-agent-injector-clusterrole" in namespace "" exists
    

    因此,舵图应该放在集群上的集群角色vault-agent-injector-clusterrole 已经存在。 ClusterRoles 不是特定于命名空间的,因此“命名空间”是空白的。

    and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "my-vault-1": current value is "my-vault-0"
    

    默认行为是尝试导入此图表所需的现有资源,但这是不可能的,因为该ClusterRole 的所有者与部署不同。

    要解决此问题,您可以删除图表的现有部署,然后再试一次,它应该可以按预期工作。

    确保所有资源都已消失。对于这个特定的,您可以通过kubectl get clusterroles 进行检查

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-16
      • 1970-01-01
      • 2018-08-26
      • 1970-01-01
      • 1970-01-01
      • 2023-01-03
      • 1970-01-01
      相关资源
      最近更新 更多