Jim Situ
Jim Situ

Reputation: 331

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 manually ran kubeapply on 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 manually 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?

Upvotes: 2

Views: 10264

Answers (3)

Karen Danielyan
Karen Danielyan

Reputation: 1960

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. The process is described in the following document:

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

Also, you can use 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.

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

Upvotes: 1

Wenjin
Wenjin

Reputation: 1

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?

Upvotes: 0

Shankar
Shankar

Reputation: 360

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/

Upvotes: 0

Related Questions