【问题标题】:Helm Installation FailedHelm 安装失败
【发布时间】:2022-06-17 15:52:18
【问题描述】:

当我在根级别运行 helm install 时,我收到以下错误消息:

% helm install helm-pipiline 

错误:安装失败:无法从发布清单构建 kubernetes 对象:[无法识别“”:版本“app.k8s.io/v1beta1”中类型“应用程序”没有匹配项,无法识别“”:否匹配版本“metacontroller.k8s.io/v1alpha1”中的种类“CompositeController”]

然后我在 application-crd.yaml 文件上手动运行 kubeapply,应用程序错误消失了:

% kubectl apply -f "application-crd.yaml"
customresourcedefinition.apiextensions.k8s.io/applications.app.k8s.io created
% helm install helm-pipiline .       
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "CompositeController" in version "metacontroller.k8s.io/v1alpha1"

然后我尝试手动应用所有类型:CompositeController

% kubectl apply -f composite-controller.yaml 
customresourcedefinition.apiextensions.k8s.io/compositecontrollers.metacontroller.k8s.io created

但是在我再次运行 helm install 后,我得到了这个错误:

Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "applications.app.k8s.io" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "helm-pipeline"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "default"

有什么问题?

【问题讨论】:

标签: kubernetes-helm helm3


【解决方案1】:

如果您在 kubernetes 中已经有一些由其他客户端(如 kubectl)创建的资源,那么尝试使用 helm 创建相同的资源将会失败。

当您将 CRD 与其他模板一起保留时,即使 CRD 是在自定义资源之前创建的,CRD 创建可能需要一些时间,这就是自定义资源安装可能失败的原因。您可以将 CRD 放在 helm chart crds 目录中,其中 helm 对​​它们的处理方式有所不同。你可以看看这个:https://helm.sh/docs/chart_best_practices/custom_resource_definitions/

【讨论】:

    【解决方案2】:

    我把所有的 crd 放到一个单独的图表中,然后先安装它。这似乎解决了一些问题。

    我来自:

    helm-pipeline % helm install helm-pipeline .
    Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "Application" in version "app.k8s.io/v1beta1", unable to recognize "": no matches for kind "AuthorizationPolicy" in version "security.istio.io/v1beta1", unable to recognize "": no matches for kind "CompositeController" in version "metacontroller.k8s.io/v1alpha1", unable to recognize "": no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3", unable to recognize "": no matches for kind "VirtualService" in version "networking.istio.io/v1alpha3"]
    

    到:

    Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "AuthorizationPolicy" in version "security.istio.io/v1beta1", unable to recognize "": no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3", unable to recognize "": no matches for kind "VirtualService" in version "networking.istio.io/v1alpha3"]
    

    “Application”和“CompositeController”错误都消失了。然而“Authorization”“DestinationRule”“VirtualService”的错误仍然存​​在

    我比较 $helm template 和 $kustomize build 并且上述类型的所有 yaml 文件似乎都匹配。我错过了什么吗?

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2020-12-08
    • 2021-02-02
    • 1970-01-01
    • 2019-01-16
    • 2019-03-23
    • 2021-11-24
    • 2019-12-16
    • 1970-01-01
    • 2019-03-14
    相关资源
    最近更新 更多