简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM