Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart kube-proxy in Kubernetes 1.2 (GKE)

Tags:

kubernetes

As of Kubernetes 1.2, kube-proxy is now a pod running in the kube-system namespace.

The old init script /etc/init.d/kube-proxy has been removed.

Aside from simply resetting the GCE instance, is there a good way to restart kube-proxy?

I just added an annotation to change the proxy mode, and I need to restart kube-proxy for my change to take effect.

like image 620
kgx Avatar asked Jun 04 '16 20:06

kgx


People also ask

How do I turn off kube proxy?

To disable kube-proxy, use kubectl to delete the kube-proxy daemonset from kube-system namespace.

How do I run kube proxy?

kube-proxy is a process that runs on each kubernetes node to manage network connections coming into and out of kubernetes. You don't run the command as such, but your deployment method (usually kubeadm) configures the options for it to run. Then delete the Pod.


1 Answers

The kube-proxy is run as an addon pod, meaning the Kubelet will automatically restart it if it goes away. This means you can restart the kube-proxy pod by simply deleting it:

$ kubectl delete pod --namespace=kube-system kube-proxy-${NODE_NAME}

Where $NODE_NAME is the node you want to restart the proxy on (this is assuming a default configuration, otherwise kubectl get pods --kube-system should include the list of kube-proxy pods).

If the restarted kube-proxy is missing your annotation change, you may need to update the manifest file, usually found in /etc/kubernetes/manifests on the node.

like image 91
Tim Allclair Avatar answered Sep 28 '22 03:09

Tim Allclair