'Helm Installation Failed
When I run helm install in the root level I got this error message:
% 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"]
I then mannually kubeapply the application-crd.yaml file and the Application error went away:
% 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 mannually apply all the kind: 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:
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?
Solution 1:[1]
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.
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. You can put your CRD's in helm chart crds directory where helm treats them bit differently. You can check this out : https://helm.sh/docs/chart_best_practices/custom_resource_definitions/
Solution 2:[2]
I put all the crds into a separate chart and install it first. 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. Yet the errors for "Authorization" "DestinationRule" "VirtualService" still persist
I compare $helm template and $kustomize build and all the yaml files for the above kinds seem to be matching. Am I missing anything?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shankar |
| Solution 2 | Wenjin |
