Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

kubeadmでインストール直後にNodeがNotReadyでもあわてない

More than 1 year has passed since last update.

概要

Kubernetesインストール直後はkubectl get nodes の結果はSTATUSNotReadyになる。
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でやらないこと。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away