Kustomize - “failed to find unique target for patch …”

I just start using kustomize. I have the following yaml files for customize:

ls -l ./kustomize/base/
816 Apr 18 21:25 deployment.yaml
110 Apr 18 21:31 kustomization.yaml
310 Apr 18 21:25 service.yaml

where deployment.yaml and service.yaml are generated files with jib and they are fine in running. And the content of the kustomization.yaml is the following:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

- service.yaml
- deployment.yaml  

And in another directory

ls -l ./kustomize/qa
133 Apr 18 21:33 kustomization.yaml
95 Apr 18 21:37 update-replicas.yaml


apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

- ../base

- update-replicas.yaml


apiVersion: apps/v1
kind: Deployment
  name: my-app
  replicas: 2

After running “kustomize build ./kustomize/base”, I run

~/kustomize build ./kustomize/qa
Error: no matches for OriginalId ~G_~V_Deployment|~X|my-app; no matches for CurrentId ~G_~V_Deployment|~X|my-app; failed to find unique target for patch ~G_~V_Deployment|my-app

I have a look related files and don’t see any typo on the application name.

How to resolve this problem?

Cluster information:

Kubernetes version: 1.17.3
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS: Linuxmint 18.2
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

Can you please try changing the below,



  • …/base



  • …/base

Thanks for your input.

The change doesn’t change the outcome, unfortunately.

Same problem here. Did you find a solution?

No, to my knowledge.

In my case I found using patches instead of patchesJson6902 solved the problem. I don’t know why the more specific directives exist if they don’t work the same way.

1 Like

Just ran into this same issue. Your answer just saved me many more hours of googling. Thank you!

I’ve also created a stackoverflow question to ask about this. You might want to follow it if you’re interested.

Thanks Alex for the kind words – also, I posted an answer to your SO question with my findings.