Etcd被形容为Kubernetes集群的大脑,是 Kubernetes的关键组件,因为它存储了集群的整个状态:其配置,规格以及运行中的工作负载的状态。
在Kubernetes世界中,etcd用作服务发现的后端,并存储集群的状态及其配置。SourceByrd's Weblog-https://note.t4x.org/kubernetes/K8S-etcd-configure/
Etcd被部署为一个集群,几个节点的通信由Raft算法处理。在生产环境中,集群包含奇数个节点,并且至少需要三个。SourceByrd's Weblog-https://note.t4x.org/kubernetes/k8s-etcd-configure/
一、Etcd配置
VIP内容
VIP登录后查看
Login
三、Etcd验证
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@k8s-master01 ~]# netstat -tunpl 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:37399 0.0.0.0:* LISTEN 669/containerd tcp 0 0 127.0.0.1:2379 0.0.0.0:* LISTEN 1121/etcd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 667/sshd: /usr/sbin tcp 0 0 192.168.31.11:2379 0.0.0.0:* LISTEN 1121/etcd tcp 0 0 192.168.31.11:2380 0.0.0.0:* LISTEN 1121/etcd tcp6 0 0 :::22 :::* LISTEN 667/sshd: /usr/sbin udp 0 0 127.0.0.1:323 0.0.0.0:* 655/chronyd udp6 0 0 ::1:323 :::* 655/chronyd [root@k8s-master01 ~]# export ETCDCTL_API=3 [root@k8s-master01 ~]# etcdctl --endpoints="192.168.31.13:2379,192.168.31.12:2379,192.168.31.11:2379" --cacert=/etc/kubernetes/pki/etcd/etcd-ca.pem --cert=/etc/kubernetes/pki/etcd/etcd.pem --key=/etc/kubernetes/pki/etcd/etcd-key.pem endpoint status --write-out=table +--------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+ | ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS | +--------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+ | 192.168.31.13:2379 | a1702a0d502e7ae0 | 3.5.4 | 20 kB | false | false | 2 | 9 | 9 | | | 192.168.31.12:2379 | 4045c65397e979 | 3.5.4 | 20 kB | false | false | 2 | 9 | 9 | | | 192.168.31.11:2379 | 405aa7c958f7832a | 3.5.4 | 20 kB | true | false | 2 | 9 | 9 | | +--------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+ |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!