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 in Kubernetes by akhtar
• 24,830 points
262 views

1 answer to this question.

0 votes

Hi@akhtar,

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 by MD
• 55,740 points

Related Questions In Kubernetes

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
• 51,950 points
1,819 views
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,410 points
205 views
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
• 57,880 points
95 views
+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
8,312 views
+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 11, 2019 in Kubernetes by Kalgi
• 51,950 points

reshown Apr 12, 2019 by Kalgi 2,497 views