我正在按照https://kubernetes.io/docs/setup/independent/high-availability/#stacked-control-plane-and-etcd-nodes上的说明进行操作,但是我无法让次要主节点加入主要主节点。
$> kubeadm join LB_IP:6443 --token TOKEN --discovery-token-ca-cert-hash sha256:HASH --experimental-control-plane
[preflight] running pre-flight checks
[discovery] Trying to connect to API Server "LB_IP:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://LB_IP:6443"
[discovery] Requesting info from "https://LB_IP:6443" again to validate TLS against the pinned public key
[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "LB_IP:6443"
[discovery] Successfully established connection with API Server "LB_IP:6443"
[join] Reading configuration from the cluster...
[join] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
One or more conditions for hosting a new control plane instance is not satisfied.
unable to add a new control plane instance on a cluster that doesn't use an external etcd
Please ensure that:
* The cluster has a stable controlPlaneEndpoint address.
* The cluster uses an external etcd.
* The certificates that must be shared among control plane instances are provided.
这是我的管理员初始化配置:
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
kubernetesVersion: "1.12.3"
apiServer:
certSANs:
- "LB_IP"
controlPlaneEndpoint: "LB_IP:6443"
networking:
podSubnet: "192.168.128.0/17"
serviceSubnet: "192.168.0.0/17"
然后像这样初始化主节点:
kubeadm init --config=./kube-adm-config.yaml
我还已将所有证书复制到辅助节点,并且kubectl在辅助节点上起作用:
[root@secondary ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
primary.fqdn Ready master 8h v1.12.3
我真的希望不设置外部etcd节点。这些说明似乎很简单,我不明白自己所缺少的内容。
任何建议,以使此堆叠控制平面多主设备设置与本地etcd一起工作,将不胜感激。或任何调试思路。或至少“堆叠的控制平面不起作用,必须使用外部etcd”。
答案 0 :(得分:1)
升级到k8s版本1.13.0解决了我的问题。我认为这些说明是专门针对此较新版本的。