简体   繁体   English

Helm 安装失败

[英]Helm Installation Failed

When I run helm install in the root level I got this error message:当我在根级别运行 helm install 时,我收到以下错误消息:

% helm install helm-pipiline 

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 "CompositeController" in version "metacontroller.k8s.io/v1alpha1"]错误:安装失败:无法从发布清单构建 kubernetes 对象:[无法识别“”:版本“app.k8s.io/v1beta1”中的种类“应用程序”没有匹配,无法识别“”:没有种类匹配版本“metacontroller.k8s.io/v1alpha1”中的“CompositeController”]

I then manually ran kubeapply on the application-crd.yaml file and the Application error went away:然后我在 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"

I then try to manually apply all the kind: CompositeController然后我尝试手动应用所有类型:CompositeController

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

But after I run helm install again I get this error:但是在我再次运行 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"

What is the issue?问题是什么?

If you already have some resource in kubernetes which was created by some other client like kubectl, then trying to create same resource with helm will fail.如果您在 kubernetes 中已经有一些由其他客户端(如 kubectl)创建的资源,那么尝试使用 helm 创建相同的资源将会失败。

When you keep your CRD's along with other templates even though CRD's are created before custom resources, CRD creation might take some time that's why custom resource installation might fail.当您将 CRD 与其他模板一起保留时,即使 CRD 是在自定义资源之前创建的,CRD 创建可能需要一些时间,这就是自定义资源安装可能失败的原因。 You can put your CRD's in helm chart crds directory where helm treats them bit differently.您可以将 CRD 放在 helm chart crds 目录中,其中 helm 对​​它们的处理方式有所不同。 You can check this out : https://helm.sh/docs/chart_best_practices/custom_resource_definitions/你可以看看这个: https ://helm.sh/docs/chart_best_practices/custom_resource_definitions/

I put all the crds into a separate chart and install it first.我把所有的 crd 放到一个单独的图表中,然后先安装它。 This seems to resolve some of the issues.这似乎解决了一些问题。

I go from:我来自:

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"]

to:至:

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"]

Both the "Application" and "CompositeController" errors are gone. “Application”和“CompositeController”错误都消失了。 Yet the errors for "Authorization" "DestinationRule" "VirtualService" still persist然而,“Authorization”“DestinationRule”“VirtualService”的错误仍然存​​在

I compare $ helm template and $ kustomize build and all the yaml files for the above kinds seem to be matching.我比较了 $ helm template和 $ kustomize build ,上述类型的所有 yaml 文件似乎都匹配。 Am I missing anything?我错过了什么吗?

If it happened after Kubernetes version update, it means that you didn't update the HELM release before upgrading the Kubernetes where API versions(v1beta1) were removed.如果它发生在 Kubernetes 版本更新之后,则意味着您在升级删除 API 版本(v1beta1)的 Kubernetes 之前没有更新 HELM 版本。 The process is described in the following document:该过程在以下文档中进行了描述:

https://helm.sh/docs/topics/kubernetes_apis/ https://helm.sh/docs/topics/kubernetes_apis/

Also, you can use mapkubeapis此外,您可以使用mapkubeapis

Example:例子:

helm mapkubeapis <RELEASE> -n <NAMESPACE>

mapkubeapis is a Helm v3 plugin which updates in-place Helm release metadata that contains deprecated or removed Kubernetes APIs to a new instance with supported Kubernetes APIs. mapkubeapis是一个 Helm v3 插件,它将包含已弃用或删除的 Kubernetes API 的 Helm 发布元数据更新到具有受支持的 Kubernetes API 的新实例。

https://github.com/helm/helm-mapkubeapis https://github.com/helm/helm-mapkubeapis

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM