#概要
Kubernetesインストール直後はkubectl get nodes
の結果はSTATUS
がNotReady
になる。
CNIインストール後にReady
になる
##インストール直後
[root@master01 .kube]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master01 NotReady master 64m v1.14.2
worker01 NotReady <none> 17m v1.14.2
worker02 NotReady <none> 16m v1.14.2
##CNI(Flannel)インストール
[root@master01 .kube]# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/62e44c867a2846fefb68bd5f178daf4da3095ccb/Documentation/kube-flannel.yml
podsecuritypolicy.extensions/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.extensions/kube-flannel-ds-amd64 created
daemonset.extensions/kube-flannel-ds-arm64 created
daemonset.extensions/kube-flannel-ds-arm created
daemonset.extensions/kube-flannel-ds-ppc64le created
daemonset.extensions/kube-flannel-ds-s390x created
###インストール後
徐々にReady化されていく。
[root@master01 .kube]# kubectl get node
NAME STATUS ROLES AGE VERSION
master01 NotReady master 65m v1.14.2
worker01 NotReady <none> 18m v1.14.2
worker02 NotReady <none> 17m v1.14.2
[root@master01 .kube]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-fb8b8dccf-g8lg5 0/1 Pending 0 65m
kube-system coredns-fb8b8dccf-rlnm5 0/1 Pending 0 65m
kube-system etcd-master01 1/1 Running 0 64m
kube-system kube-apiserver-master01 1/1 Running 0 63m
kube-system kube-controller-manager-master01 1/1 Running 0 64m
kube-system kube-flannel-ds-amd64-kbkrw 0/1 Init:0/1 0 21s
kube-system kube-flannel-ds-amd64-krtx2 0/1 Init:0/1 0 21s
kube-system kube-flannel-ds-amd64-r2pgg 0/1 Init:0/1 0 21s
kube-system kube-proxy-9j9gt 1/1 Running 0 65m
kube-system kube-proxy-d7ckf 1/1 Running 0 17m
kube-system kube-proxy-mnm7m 1/1 Running 0 18m
kube-system kube-scheduler-master01 1/1 Running 0 64m
[root@master01 .kube]# kubectl get pods --all-namespaces -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-system coredns-fb8b8dccf-g8lg5 0/1 ContainerCreating 0 65m <none> worker01 <none> <none>
kube-system coredns-fb8b8dccf-rlnm5 0/1 ContainerCreating 0 65m <none> worker01 <none> <none>
kube-system etcd-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-apiserver-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-controller-manager-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-flannel-ds-amd64-kbkrw 1/1 Running 0 47s 10.0.0.121 worker02 <none> <none>
kube-system kube-flannel-ds-amd64-krtx2 1/1 Running 0 47s 10.0.0.120 worker01 <none> <none>
kube-system kube-flannel-ds-amd64-r2pgg 1/1 Running 0 47s 10.0.0.110 master01 <none> <none>
kube-system kube-proxy-9j9gt 1/1 Running 0 65m 10.0.0.110 master01 <none> <none>
kube-system kube-proxy-d7ckf 1/1 Running 0 18m 10.0.0.121 worker02 <none> <none>
kube-system kube-proxy-mnm7m 1/1 Running 0 19m 10.0.0.120 worker01 <none> <none>
kube-system kube-scheduler-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
[root@master01 .kube]# kubectl get pods --all-namespaces -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-system coredns-fb8b8dccf-g8lg5 0/1 ContainerCreating 0 65m <none> worker01 <none> <none>
kube-system coredns-fb8b8dccf-rlnm5 0/1 Running 0 65m 10.244.1.2 worker01 <none> <none>
kube-system etcd-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-apiserver-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-controller-manager-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-flannel-ds-amd64-kbkrw 1/1 Running 0 57s 10.0.0.121 worker02 <none> <none>
kube-system kube-flannel-ds-amd64-krtx2 1/1 Running 0 57s 10.0.0.120 worker01 <none> <none>
kube-system kube-flannel-ds-amd64-r2pgg 1/1 Running 0 57s 10.0.0.110 master01 <none> <none>
kube-system kube-proxy-9j9gt 1/1 Running 0 65m 10.0.0.110 master01 <none> <none>
kube-system kube-proxy-d7ckf 1/1 Running 0 18m 10.0.0.121 worker02 <none> <none>
kube-system kube-proxy-mnm7m 1/1 Running 0 19m 10.0.0.120 worker01 <none> <none>
kube-system kube-scheduler-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
[root@master01 .kube]# kubectl get pods --all-namespaces -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-system coredns-fb8b8dccf-g8lg5 0/1 Running 0 65m 10.244.1.3 worker01 <none> <none>
kube-system coredns-fb8b8dccf-rlnm5 0/1 Running 0 65m 10.244.1.2 worker01 <none> <none>
kube-system etcd-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-apiserver-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-controller-manager-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
kube-system kube-flannel-ds-amd64-kbkrw 1/1 Running 0 60s 10.0.0.121 worker02 <none> <none>
kube-system kube-flannel-ds-amd64-krtx2 1/1 Running 0 60s 10.0.0.120 worker01 <none> <none>
kube-system kube-flannel-ds-amd64-r2pgg 1/1 Running 0 60s 10.0.0.110 master01 <none> <none>
kube-system kube-proxy-9j9gt 1/1 Running 0 65m 10.0.0.110 master01 <none> <none>
kube-system kube-proxy-d7ckf 1/1 Running 0 18m 10.0.0.121 worker02 <none> <none>
kube-system kube-proxy-mnm7m 1/1 Running 0 19m 10.0.0.120 worker01 <none> <none>
kube-system kube-scheduler-master01 1/1 Running 0 64m 10.0.0.110 master01 <none> <none>
[root@master01 .kube]#
[root@master01 .kube]#
[root@master01 .kube]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master01 Ready master 66m v1.14.2
worker01 Ready <none> 19m v1.14.2
worker02 Ready <none> 18m v1.14.2
##最後に
良い子はrootでやらないこと。