kubernetes 源码安装1.18.3 (7)部署cni网络

部署cni网络

#下载地址
https://github.com/containernetworking/plugins/releases/download/v0.8.6/cni-plugins-linux-amd64-v0.8.6.tgz


#解包
cd ~
mkdir /opt/cni/bin -p
tar zxvf cni-plugins-linux-amd64-v0.8.6.tgz -C /opt/cni/bin


#获取yaml文件
https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

部署yaml

kubectl create -f kube-flannel.yml 

返回

podsecuritypolicy.policy/psp.flannel.unprivileged created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds created

查看网络

[root@k8s-master01 k8s]# kubectl get pod -n kube-system
NAME                    READY   STATUS    RESTARTS   AGE
kube-flannel-ds-pb9wm   1/1     Running   0          65s


[root@k8s-master01 k8s]# kubectl get node
NAME           STATUS   ROLES    AGE   VERSION
192.168.1.20   Ready       24m   v1.18.3

 

这个yaml文件国内不好访问,这里放下面了

cat > kube-flannel.yml <

 

你可能感兴趣的:(kubernetes,linux,k8s)