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

Getting the below error for the command kubectl apply -n prod -f kustomize/kustomization.yaml

error: unable to recognize "kustomize/kustomization.yaml": no matches for kind "Kustomization" in version "kustomize.config.k8s.io/v1beta1"

Please advise.

Upvotes: 1

Views: 3527

Answers (1)

Malgorzata
Malgorzata

Reputation: 7023

Firstly I recommend to read official doc: kubernetes-kustomization.

To solve the problem use -k flag instead of -f flag in command:

$ kubectl apply -k <kustomization_directory>

If in your kustomize directory will be only one manifest file (kustomization.yaml) then use $ kubectl apply -k kustomize/ from this directory. Otherwise create new empty directory and put your kustomization.yaml there then execute following command from parent directory $ kubectl apply -k new-directory/

Take a look: kustomize-no-matches, kustomize-kubernetes-no-matches.

Upvotes: 4

Related Questions