https://training.play-with-kubernetes.com/kubernetes-workshop/
kubeadm join 192.168.1.110:6443 --token lj36a3.rom4laxfccjftfhj \
--discovery-token-ca-cert-hash sha256:d9cf5509778e9cb2876aa2e78d6096414f50dda373c5756b880197e567bb64bf
10.0.2.15
kubeadm join 10.0.2.15:6443 --token lj36a3.rom4laxfccjftfhj \
--discovery-token-ca-cert-hash sha256:d9cf5509778e9cb2876aa2e78d6096414f50dda373c5756b880197e567bb64bf
kubeadm join 192.168.1.110:6443 --token obxzak.4fzurenhbu5qrwfh --v=5 --discovery-token-unsafe-skip-ca-verification
kubeadm init phase certs apiserver --apiserver-advertise-address 192.168.1.110 --apiserver-cert-extra-sans 192.168.1.110
========
重置cert相关问题:
rm /etc/kubernetes/pki/apiserver.*
?? kubeadm init phase certs all --apiserver-advertise-address=192.168.1.110 --apiserver-cert-extra-sans=192.168.1.110
docker rm -f `docker ps -q -f 'name=k8s_kube-apiserver*'`
systemctl restart kubelet
初始化:
kubeadm init --apiserver-cert-extra-sans=192.168.1.110,10.0.2.15,0.0.0.0 --apiserver-advertise-address 192.168.1.110 --pod-network-cidr=10.244.0.0/16 --v=5
?? —pod-network-cidr=192.168.0.1/24
X509证书错误:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
查找token
kubeadm token create --print-join-command
kubeadm token list
加入
notready的问题:
- kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
查看日志排查问题:
journalctl -f -u kubelet
配置缺失的问题:is missing FLANNEL_NETWORK, FLANNEL_SUBNET, FLANNEL_MTU, FLANNEL_IPMASQ:
Just got the same problem - fixed it by manually adding the file:
/run/flannel/subnet.env
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
kubeless初始化报错需要手动清除组件:
https://stackoverflow.com/questions/52009124/not-able-to-completely-remove-kubernetes-customresource
需要手动清除的:
kc delete crd cronjobtriggers.kubeless.io
kc delete crd functions.kubeless.io
kc delete crd httptriggers.kubeless.io
kc delete clusterroles kubeless-controller-deployer