How to redeploy metrics-server

4/10/2019

I have a Kubernetes cluster running on my local machine(via docker-for-desktop) and a metrics-server has been deployed to monitor CPU Usage. I want to make some changes in the metrics-server-deployment.yaml file which resides in /metrics-server/deploy/1.8+

I am done with the changes but I can't figure how to redeploy the metrics-server so that it will reflect the new changes. I am new to K8S and would love to get some help/tips or useful resources.

Thanks in advance

-- Gauraang Khurana
docker-for-mac
kubernetes
metrics

2 Answers

4/10/2019

From the directory where you have metrics-server-deployment.yaml, just run:

kubectl apply -f metrics-server-deployment.yaml

If it complains, you can also manually delete it and run:

kubectl create -f metrics-server-deployment.yaml
-- Amrit Bera
Source: StackOverflow

7/25/2019

You can manually edit the file(s) and then use

kubectl delete -f /metrics-server/deploy/1.8+
kubectl apply -f /metrics-server/deploy/1.8+

or (in my opinion the nicer version) you can just edit the deployment itself with

kubectl edit deployment -n kube-system metrics-server
-- char
Source: StackOverflow