From virtual machine template to create the steps of the single-node K8S1.14.1

1. According to a blog on your own to create a virtual machine cluster k8s which contains k8s1.14.1 here briefly about how the boot process after the virtual machine can use a simple process of k8s.

Description premise:

1 It has been a good guide images and other work.

2. Virtual machine boot, and then modify the ip address, modify / etc / hosts. Etc.

2.1 modify ip address 

2.2 modify the machine name 
hostnamectl   the SET - hostname k8smaster 

2.3 modify / etc / hosts file 
vim / etc / hosts 
to add 
ip k8smaster 
a row

kubeadm build a cluster of 3 kill before

kubeadm reset -f

4. Re-create the cluster

--pod the init-Network-kubeadm CIDR = 10.244 . 0.0 / 16 

replicated clustered configuration
cp /etc/kubernetes/admin.conf /root/.kube/config

5. taint master node so that it can perform normal schedule pod 

kubectl taint nodes --all node-role.kubernetes.io/master-

6. Create flannel # / root directory with corresponding files yaml

kubectl apply -f /root/kube-flannel.yaml

7. Check the operation of the pod

kubectl get pods --all-namespaces

8. Check node operation

kubectl get nodes

9. Create token from node wants to join method

# Create a new token 
kubeadm the Create token 
retrieve the hash value of the certificate # 
OpenSSL X509 -pubkey - in /etc/kubernetes/pki/ca.crt | OpenSSL rsa -pubin -outform der 2 > / dev / null | OpenSSL dgst - -hex sha256 | Sed ' S /^.* // ' 

# join the cluster command 
# Note replace the value inside the token secret key value sha256 also behind the front two command according to a result obtained kubeadm the Join
10.24 . 89.204 : 6443 --token = hcuw2d.thbcellov6h2rgc5 --discovery-token-ca -cert-hash sha256: 1a3272179f114a0f5f55d21ad065a983dab36139f23be4912458a67b9b1ce103

10. The method for restarting the pod

kubectl describe pod coredns-fb8b8dccf-4pqzs --namespace=kube-system

11. Simple effect

 

12. A method of solving notready

mkdir -p /etc/cni/net.d/

cat <<EOF> /etc/cni/net.d/10-flannel.conf
{"name":"cbr0","type":"flannel","delegate": {"isDefaultGateway": true}}
EOF

mkdir
/usr/share/oci-umount/oci-umount.d -p
mkdir
/run/flannel/
cat
<<EOF> /run/flannel/subnet.env FLANNEL_NETWORK=172.100.0.0/16 FLANNEL_SUBNET=172.100.1.0/24 FLANNEL_MTU=1450 FLANNEL_IPMASQ=true EOF

13. The solution has been out of the log

Centos7 terminal reported the Message from syslogd: kernel: unregister_netdevice 

like kernel and k8s the bug has not been resolved here, I have 4.20 is still the same mistake pit father 

solutions 

systemctl STOP rsyslog 
systemctl disable rsyslog

 

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/10801935.html