通过kind部署3个etcd实例构成的k8s集群。
cat <<EOF | kind create cluster --name test --config -
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
kubeProxyMode: ipvs
ipFamily: ipv4
apiServerAddress: 127.0.0.1
apiServerPort: 0
podSubnet: "10.16.0.0/16"
serviceSubnet: "10.96.0.0/12"
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
metadata:
name: config
etcd:
local:
dataDir: "/root/etcd"
nodes:
- role: control-plane
image: kindest/node:v1.27.0
- role: control-plane
image: kindest/node:v1.27.0
- role: control-plane
image: kindest/node:v1.27.0
EOF
etcd正常运行
停止另外2个etcd后当前etcd会报错无法访问其他etcd。
之所以单个etcd可以一直运行,是因为kubelet已经无法正常访问kube-apiserver,导致健康检查失败后也不会杀死容器。
说明非k8s Etcd集群单个实例无法连上其他2个后反复重启。
标签:Etcd,实例,集群,etcd,单个,k8s From: https://www.cnblogs.com/WJQ2017/p/18176500