How to rename deployments in Kubernetes

0 votes

I'm trying to change my deployments name:

$ kubectl get deployments
NAME                  DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
analytics-rethinkdb   1         1         1            1           18h
frontend              1         1         1            1           6h
queue                 1         1         1            1           6h

I tried editing the deployment file but it is not changing the name of it:

$ kubectl edit deployments/analytics-rethinkdb
error: metadata.name should not be changed

I know I can delete the deployment and then redeploy it with the changed name but still I think it should be possible to change its name.

Dec 4, 2018 in Kubernetes by Damon Salvatore
• 5,980 points
10,155 views

2 answers to this question.

0 votes

I'm sorry, but object names in kubernetes cannot be changed. They're immutable. You'd have to delete and deploy the Deployment with a different name to get what you want.

answered Dec 4, 2018 by DareDev
• 6,890 points
0 votes
Hey, You can edit or recreate it with a different name.
answered Dec 6, 2018 by Maverick
• 10,840 points

Related Questions In Kubernetes

0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,300 points
2,498 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How to configure load balancer in kubernetes ?

In the deployment file keep the type ...READ MORE

answered Dec 4, 2018 in Kubernetes by Haseeb
1,046 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
15,578 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,064 views
0 votes
1 answer

How do I sign-in to kubernetes dashboard?

Since version 1.7 Dashboard uses more secure ...READ MORE

answered Sep 7, 2018 in Kubernetes by DareDev
• 6,890 points
2,327 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP