I accidentally deleted kube-proxy daemonset by using command: kubectl delete -n kube-system daemonset kube-proxy
which should run kube-proxy pods in my cluster, what the best way to restore it?
That's how it should look
Asked
Active
Viewed 985 times
2

Alexandr Lebedev
- 21
- 2
-
If you find my answer was helpful. please accept and upvote my answer for greater visibility of the community. – Srividya Jul 12 '22 at 10:10
2 Answers
2
Kubernetes allows you to reinstall kube-proxy by running the following command which install the kube-proxy addon components via the API server.
$ kubeadm init phase addon kube-proxy --kubeconfig ~/.kube/config --apiserver-advertise-address string
This will generate the output as
[addons] Applied essential addon: kube-proxy
The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.
Hence kube-proxy will be reinstalled in the cluster by creating a DaemonSet and launching the pods.

Srividya
- 1,678
- 3
- 10
0
kube-proxy daemon got created at the time of cluster creation, so you need to write your own manifest for daemon-set unless you have a backup to restore it from there.

Punit Porwal
- 1
- 1
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 08 '22 at 20:58