1

I deployed kubernetes cluster in minikube which has one master node and one worker node. When I tried to see the kube-proxy with:

kubectl get pods -n kube-system

two kube-proxies apear

kube-proxy-6jxgq
kube-proxy-sq58d                 

According to the refrence architecture https://kubernetes.io/docs/concepts/overview/components/ kube-proxy is the component of worker node. I expect to see one kube-proxy not two. what is the reason?

Fstm
  • 23
  • 5

3 Answers3

1

kube-proxy runs on every node, when you use

kubectl get po -n kube-system -o wide

you will see the node the pods are running on

FredvN
  • 504
  • 1
  • 3
  • 14
  • If you have a cluster with one master node and one worker node, according to refrence architecture you should see only one kube-proxy because kube-proxy should not run in master node. My doubt is that why there is two kube-proxies? – Fstm Nov 18 '22 at 10:55
  • On the page you referenced: "Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment". There are two components, kubelet and kubeproxy. they run on the masternode but are not a part ot the controlplane – FredvN Nov 18 '22 at 11:02
0

I have three nodes k8s cluster, one master and two worker nodes, i see 3 kube-proxy pods running, i tried to bring down a woker node, through i see 3 pods.

[root@devkmas01 ~]# kubectl get pods -n kube-system | grep -i kube-proxy
kube-proxy-msr8x                                 1/1     Running                  22         125d
kube-proxy-mwmqp                                 1/1     Running                  20         125d
kube-proxy-s8gwx                                 1/1     Running                  25         126d
[root@devkmas01 ~]# k get nodes
NAME                     STATUS     ROLES           AGE    VERSION
devkmas01.nirulabs.com   Ready      control-plane   126d   v1.24.3
devkwor01.nirulabs.com   Ready      <none>          125d   v1.24.3
devkwor02.nirulabs.com   NotReady   <none>          125d   v1.24.3

  • 1
    You'd better provide a clear answer to the asker's question, not just displaying your own cmds and output... – YwH Nov 21 '22 at 09:17
0

The official docs says:

kube-proxy is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes Service concept.

All cluster nodes, discarding its role, not just the worker node.

YwH
  • 1,050
  • 5
  • 11
  • Thanks YwH. Why kube-proxy should running in master node? For instance, in service type loadbalancer, target node selected in NLB and traffic directly forwards to that node. I am not sure why master node needs kube-proxy. – Fstm Nov 21 '22 at 16:35
  • @Fstm Master nodes are also schedulable, which is important for some critical workloads, like: etcd, kube-apiserver, kube-controller-manager, kube-scheduler, coredns, etc. Therefore kube-proxy is required, same as for some CNI pod like flannel. – YwH Nov 22 '22 at 03:24