The Deployment myweb-rs is invalid spec template metadata labels Invalid value map string string name mysql selector does not match template labels

0 votes

Hi Guys,

I am trying to create deployment resource in minikube cluster. But it is showing me the below error.

$ kubectl create -f dep_mysql.yml
The Deployment "myweb-rs" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"name":"mysql"}: `selector` does not match template `labels`

How can I solve this?

May 22, 2020 in Kubernetes by akhtar
• 38,210 points

1 answer to this question.

0 votes


I think, there may be a mismatch in labels. Make sure you have written the same labels for your deployment as well as Pod. When you create one deployment, internally these labels connects to pod labels and launch the containers.

answered May 22, 2020 by MD
• 95,300 points

Related Questions In Kubernetes

+1 vote
1 answer
0 votes
1 answer

Error saying "The specified bucket does not exist" in kubernetes

Bucket is created in another region. Looks like ...READ MORE

answered Aug 31, 2018 in Kubernetes by Kalgi
• 52,370 points
0 votes
1 answer

Error saying "the program 'curl' is currently not installed"

Install curl using this command: apt-get update && ...READ MORE

answered Nov 23, 2018 in Kubernetes by Hannah
• 18,570 points
0 votes
1 answer

How to determine what is the status of a deployment ?

You could use kubectl get deployment <deployment>.  If ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 59,070 points
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,370 points

reshown Apr 12, 2019 by Kalgi 3,544 views