Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kustomize: no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1"

Tags:

kustomize

I am new to Kustomize and am getting the following error:

Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1"

but I am using the boilerplate kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml

Question: What does the group name (kustomize.config.k8s.io) mean and why does Kustomize not recognize the kind?

like image 531
user3877654 Avatar asked Jul 24 '20 20:07

user3877654


People also ask

What is Kustomization in Kubernetes?

Kustomize is a tool for customizing Kubernetes configurations. It has the following features to manage application configuration files: generating resources from other sources. setting cross-cutting fields for resources. composing and customizing collections of resources.

What is Kustomization?

Kustomize is a configuration management solution that leverages layering to preserve the base settings of your applications and components by overlaying declarative yaml artifacts (called patches) that selectively override default settings without actually changing the original files.

Is Kustomize built into kubectl?

Kustomize is a command-line configuration manager for Kubernetes objects. Integrated with kubectl since 1.14, it allows you to make declarative changes to your configurations without touching a template.


3 Answers

So this api version is correct, although I am still not certain why. In order to get past this error message, I needed to run:

kubectl apply -k dir/.

I hope this helps someone in the future!

like image 101
user3877654 Avatar answered Oct 01 '22 06:10

user3877654


If you used apply -f you would see this error. Using -k would definitely work.

like image 27
wxh Avatar answered Oct 04 '22 06:10

wxh


You are using kustomize tool (Kustomize is a standalone tool to customize the creation of Kubernetes objects through a file called kustomization.yaml). For applying customization you have to use:

kubectl apply -k foldername(where you store the deploy,service yaml file)
like image 44
Mithlaj Avatar answered Oct 03 '22 06:10

Mithlaj