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.