加入k8s节点
获取token(在master执行)
kubeadm token create
kubeadm token list
这里获取 token 4j07en.6ag0ee8xwhltmia0
获取hash(在master执行)
openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
这里获取hash 09f482e9b6f64b549c7c7f530cd62fd6f8b31669eda0543db59aae631bb4d1b0
加入集群(在新node上执行)
kubeadm reset
kubeadm <apiserver客户端地址> --token <token> --discovery-token-ca-cert-hash sha256:<hash>
- examples
kubeadm join 192.168.31.10:16443 --token 4j07en.6ag0ee8xwhltmia0 --discovery-token-ca-cert-hash sha256:09f482e9b6f64b549c7c7f530cd62fd6f8b31669eda0543db59aae631bb4d1b0