|NO.Z.00081|——————————|^^ 部署 ^^|——|KuberNetes&kubeadm.V10|5台Server|——|kubernetes-node|Node注册到集群|
一、kubernetes-Node注册到集群
### --- Node节点注册到集群说明
~~~ Node节点上主要部署公司的一些业务应用,
~~~ 生产环境中不建议Master节点部署系统组件之外的其他Pod,
~~~ 测试环境可以允许Master节点部署Pod以节省系统资源。
二、k8s-node01注册到kubernetes集群中
### --- 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
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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?