etcdctl工具获取方式
[root@k8s-master network]# yum -y install etcd
[root@k8s-master network]# etcdctl -version
etcdctl version: 3.3.11
API version: 2
# vi /etc/kubernetes/manifests/etcd.yaml etcd的yaml文件
apiVersion: v1
kind: Pod
metadata:
labels:
component: etcd
tier: control-plane
...
# 监听端口
- --listen-client-urls=https://127.0.0.1:2379,https://192.168.18.125:2379 # etcd监听端口
hostNetwork: true # 和宿主机共享网络 通过宿主机127.0.0.1:2379可以连接容器
volumes:
- hostPath: # 挂载宿主机目录
path: /etc/kubernetes/pki/etcd
type: DirectoryOrCreate
name: etcd-certs