kube-proxy是Kubernetes的核心组件,部署在每个Node节点上,它是实现Kubernetes Service的通信与负载均衡机制的重要组件; kube-proxy负责为Pod创建代理服务,从apiserver获取所有server信息,并根据server信息创建代理服务,实现server到Pod的请求路由和转发,从而实现K8S层级的虚拟转发网络。
一、Kube-Proxy配置
VIP内容
VIP登录后查看
Login
三、Kube-Proxy验证
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
[root@k8s-master02 ~]# netstat -tunlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:38187 0.0.0.0:* LISTEN 681/containerd tcp 0 0 127.0.0.1:2379 0.0.0.0:* LISTEN 669/etcd tcp 0 0 192.168.31.12:2379 0.0.0.0:* LISTEN 669/etcd tcp 0 0 192.168.31.12:2380 0.0.0.0:* LISTEN 669/etcd tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 2441/kube-proxy tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 645/kubelet tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 679/sshd: /usr/sbin tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 836/haproxy tcp 0 0 127.0.0.1:8443 0.0.0.0:* LISTEN 836/haproxy tcp6 0 0 :::6443 :::* LISTEN 670/kube-apiserver tcp6 0 0 :::10259 :::* LISTEN 672/kube-scheduler tcp6 0 0 :::10257 :::* LISTEN 671/kube-controller tcp6 0 0 :::10256 :::* LISTEN 2441/kube-proxy tcp6 0 0 :::22 :::* LISTEN 679/sshd: /usr/sbin tcp6 0 0 :::10250 :::* LISTEN 645/kubelet tcp6 0 0 :::10255 :::* LISTEN 645/kubelet udp 0 0 127.0.0.1:323 0.0.0.0:* 656/chronyd udp 0 0 0.0.0.0:46792 0.0.0.0:* 836/haproxy udp 0 0 0.0.0.0:40070 0.0.0.0:* 836/haproxy udp6 0 0 ::1:323 :::* 656/chronyd [root@k8s-master02 ~]# systemctl status kube-proxy ● kube-proxy.service - Kubernetes Kube Proxy Loaded: loaded (/usr/lib/systemd/system/kube-proxy.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2022-10-27 10:07:05 CST; 37s ago Docs: https://github.com/kubernetes/kubernetes Main PID: 2441 (kube-proxy) Tasks: 6 (limit: 10923) Memory: 46.0M CPU: 232ms CGroup: /system.slice/kube-proxy.service |
到此,kube-proxy服务搭建完成。SourceByrd's Weblog-https://note.t4x.org/kubernetes/k8s-kube-proxy/ SourceByrd's Weblog-https://note.t4x.org/kubernetes/k8s-kube-proxy/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!