【问题标题】:Ambassador helm chart upgrade fails with resource already exists in the cluster and wasn't defined in the previous release errorAmbassador helm chart 升级失败,资源已存在于集群中且未在先前版本中定义错误
【发布时间】:2020-04-23 17:27:27
【问题描述】:

使用

更新大使舵图

helm upgrade --install --wait ambassador -f ambassador-helm-values.yaml stable/ambassador

失败:

UPGRADE FAILED
Error: kind ClusterRoleBinding with the name "ambassador-crds" already exists in the cluster and wasn't defined in the previous release. Before upgrading, please either delete the resource from the cluster or remove it from the chart
Error: UPGRADE FAILED: kind ClusterRoleBinding with the name "ambassador-crds" already exists in the cluster and wasn't defined in the previous release. Before upgrading, please either delete the resource from the cluster or remove it from the chart

已删除 ClusterRoleBinding ambassador-crds 并尝试运行 helm upgrade 命令。再次生成ambassador-crds 并失败并显示相同的错误消息。

【问题讨论】:

    标签: kubernetes-helm cert-manager ambassador


    【解决方案1】:

    您是否尝试先通过 kubectl 安装特定资源?要生成 yaml,您可以在调试模式下使用干运行。例如:

    helm install . --dry-run --debug --generate-name
    

    这应该会在您的屏幕上输出生成的资源。然后将之前版本中未定义的 crd 复制到单独的 yaml 文件(即 customResourceDefinition.yaml)中,并使用 kubectl 手动安装:

    kubectl apply -f ./customResourceDefinition.yaml
    

    之后,您可以再次尝试helm upgrade 命令。 也许升级命令真的很严格,每个资源都必须存在才能采取任何行动。

    这只是一种解决方法和猜测。我以前没有遇到过这个问题,根本没有使用helm upgrade。希望对你有帮助:)

    【讨论】:

      【解决方案2】:

      我正在使用 helm 版本 2.15.*。这似乎是 helm(或 Tiller)上的错误。 --cleanun-on-fail 选项似乎也不起作用。我曾经删除抱怨的资源并再次运行掌舵升级,但我发现重复执行此操作很烦人。对我有用的是添加选项--atomic。如果提供,升级过程会在升级失败的情况下回滚所做的更改。

      Tiller(服务器端数据库)损坏似乎是一个问题。请参阅 github 中的讨论:https://github.com/helm/helm/issues/6031

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-02-04
        • 2023-03-28
        • 2021-05-25
        • 2022-10-13
        • 2022-11-11
        • 2018-11-14
        • 2021-01-29
        相关资源
        最近更新 更多