部署网络插件

kubectl 检查这个节点上各个系统 Pod 的状态,其中,kube-system 是 Kubernetes 项目预留的系统 Pod 的工作空间(Namepsace,注意它并不是 Linux Namespace,它只是 Kubernetes 划分不同工作空间的单位)
    
    
[root@dock01 ~]# kubectl get pods -n kube-system
NAME                             READY   STATUS    RESTARTS   AGE
coredns-7f89b7bc75-djthn         0/1     Pending   0          22m
coredns-7f89b7bc75-nnh49         0/1     Pending   0          22m
etcd-dock01                      1/1     Running   0          22m
kube-apiserver-dock01            1/1     Running   0          22m
kube-controller-manager-dock01   1/1     Running   0          22m
kube-proxy-2584p                 1/1     Running   0          22m
kube-scheduler-dock01            1/1     Running   0          22m

部署网络插件在 Kubernetes 项目“一切皆容器”的设计理念指导下,部署网络插件非常简单,只需要执行一句 kubectl apply 指令,以 Weave 为例:


kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

[root@dock01 ~]# kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
serviceaccount/weave-net configured
clusterrole.rbac.authorization.k8s.io/weave-net configured
clusterrolebinding.rbac.authorization.k8s.io/weave-net configured
role.rbac.authorization.k8s.io/weave-net configured
rolebinding.rbac.authorization.k8s.io/weave-net configured
daemonset.apps/weave-net created
[root@dock01 ~]# kubectl get pods -n kube-system
[root@dock01 ~]#  kubectl get pods -n kube-system
NAME                             READY   STATUS    RESTARTS   AGE
coredns-7f89b7bc75-djthn         1/1     Running   0          33m
coredns-7f89b7bc75-nnh49         1/1     Running   0          33m
etcd-dock01                      1/1     Running   0          33m
kube-apiserver-dock01            1/1     Running   0          33m
kube-controller-manager-dock01   1/1     Running   0          33m
kube-proxy-2584p                 1/1     Running   0          33m
kube-scheduler-dock01            1/1     Running   0          33m
weave-net-tp487                  2/2     Running   0          4m44s

上一篇:一文说懂join和setDaemon


下一篇:BatchNormalization