1

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.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37

1 Answers1

4

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.

Malgorzata
  • 6,409
  • 1
  • 10
  • 27
  • I have the same issue as the OP. Your answer is useful but not a solution. The problem seems to be that the kind Kustomization does not exist in v1 and it did in v1beta. It is not in the docs and there is no example of an alternative there as far as I can see. – Thijs Apr 22 '21 at 07:32
  • I ran the below command and then It is working now. `kubectl apply -k ` – Naveen Kumar Yallampalli May 03 '21 at 11:21