How to install CNI for kubernetes
Today, the editor will share with you the relevant knowledge points about how to install kubernetes CNI. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Environment introduction
When we install kubernetes, we do not install CNI. If the sealyun offline package is used, modify the kube/conf/master.sh
Only the following can be left:
[root@helix105 shell] # cat master.sh kubeadm init-- config.. / conf/kubeadm.yamlmkdir ~ / .kubecp / etc/kubernetes/admin.conf ~ / .kube/configkubectl taint nodes-- all node-role.kubernetes.io/master-
Clear the CNI related directories:
Rm-rf / opt/cni/bin/*rm-rf / etc/cni/net.d/*
Start kubernetes, and if you have already installed it, then kubeadm reset:
Cd kube/shell & & sh init.sh & & sh master.sh
At this point, your node is notready, and your coredns cannot be assigned an address:
[root@helix105 shell] # kubectl get pod-n kube-system-o wideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATEScoredns-5c98db65d4-5fh7c 0 Pending 0 54s coredns-5c98db65d4 -dbwmq 0 kube-controller-manager-helix105.hfa.chenqian 1 Pending 0 54s kube-controller-manager-helix105.hfa.chenqian 1 Running 0 19s 172.16.60.105 helix105.hfa.chenqian kube-proxy-k74ld 1 Running 0 54s 172.16.60.105 helix105.hfa.chenqian kube-scheduler-helix105.hfa.chenqian 1 Running 0 14s 172.16.60.105 helix105.hfa.chenqian [root@helix105 shell] # kubectl get nodeNAME STATUS ROLES AGE VERSIONhelix105.hfa.chenqian NotReady master 86s v1.15.0 install CNI
Create a CNI profile
$mkdir-p / etc/cni/net.d$ cat > / etc/cni/net.d/10-mynet.conf