|NO.Z.00081|——————————|^^ 部署 ^^|——|KuberNetes&kubeadm.V10|5臺Server|---------------------------------------|kubernetes-node|Node註冊到叢集|
阿新 • • 發佈:2022-03-29
[CloudNative:KuberNetes&kubeadm.V10] [Applications.KuberNetes] [|DevOps|k8s|**5節點**|kubeadm.v1.21.2|node節點註冊到kubernetes叢集|——|k8s-node01|k8s-node02|]
一、kubernetes-Node註冊到叢集
二、k8s-node01註冊到kubernetes叢集中### --- Node節點註冊到叢集說明 ~~~ Node節點上主要部署公司的一些業務應用, ~~~ 生產環境中不建議Master節點部署系統元件之外的其他Pod, ~~~ 測試環境可以允許Master節點部署Pod以節省系統資源。
### --- k8s-node01註冊到k8s叢集中 ~~~ 將k8s-node01註冊到k8s叢集中 [root@k8s-node01 ~]# kubeadm join 192.168.1.20:16443 --token oesiit.mt5fzqi8i9ascx9f \ > --discovery-token-ca-cert-hash sha256:c09f2051501a53aaa1e158959d69d4be655d4f475c28c81b5895baddfbd59bf9 ~~~ 注:輸出引數 This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. Run 'kubectl get nodes' on the control-plane to see this node join the cluster.
### --- 檢視叢集狀態 ~~~ 檢視k8s-node01是否註冊到叢集 [root@k8s-master01 ~]# kubectl get node -owide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME k8s-master01 NotReady control-plane,master 45m v1.21.2 192.168.1.11 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15 k8s-master02 NotReady control-plane,master 24m v1.21.2 192.168.1.12 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15 k8s-master03 NotReady control-plane,master 8m54s v1.21.2 192.168.1.13 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15 k8s-node01 NotReady <none> 43s v1.21.2 192.168.1.14 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15
三、k8s-node02註冊到kubernetes叢集中
### --- k8s-node02註冊到k8s叢集中
~~~ 將k8s-node02註冊到k8s叢集中
[root@k8s-node02 ~]# kubeadm join 192.168.1.20:16443 --token oesiit.mt5fzqi8i9ascx9f \
> --discovery-token-ca-cert-hash sha256:c09f2051501a53aaa1e158959d69d4be655d4f475c28c81b5895baddfbd59bf9
~~~ 輸出引數
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the control-plane to see this node join the cluster.
### --- 檢視叢集狀態
~~~ 檢視k8s-node02是否註冊到k8s叢集中
~~~ 注:所有節點的狀態為NotReady;安裝完calico元件後會變為ready
[root@k8s-master01 ~]# kubectl get node -owide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8s-master01 NotReady control-plane,master 47m v1.21.2 192.168.1.11 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15
k8s-master02 NotReady control-plane,master 27m v1.21.2 192.168.1.12 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15
k8s-master03 NotReady control-plane,master 11m v1.21.2 192.168.1.13 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15
k8s-node01 NotReady <none> 3m15s v1.21.2 192.168.1.14 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15
k8s-node02 NotReady <none> 69s v1.21.2 192.168.1.15 <none> CentOS Linux 7 (Core) 4.19.12-1.el7.elrepo.x86_64 docker://19.3.15
===============================END===============================
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor
來自為知筆記(Wiz)