Kubernetes应用生产(三)slave部署(node篇)

1、安装Slave

1.1 yum指定版本安装(这里我们安装1.23.5)

yum -y install kubeadm-1.23.5 kubelet-1.23.5
# 设置开机启动
systemctl enable kubelet && systemctl start kubelet

1.2  加入Master节点(所有slave节点操作)

# 以下提示是node(slave)节点执行加入集群的命令(每个部署不一样,根据自己的来)
[root@k8s-node-2 ~]# kubeadm join 192.168.2.21:6443 --token xaaczs.c602kj1bmqwwc59y \
        --discovery-token-ca-cert-hash sha256:8469e30868f31db51471d74b0cc7d880fc9f323a15f7b19c1df3004e2e7bf255
# 如下提示信息
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"  
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
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.  

1.3 Master查看

(3) 等待5分钟左右,master执行如下命令查看slave状态
kubectl get nodes

[root@k8s-master ~]# kubectl get node
NAME         STATUS   ROLES                  AGE     VERSION
k8s-master   Ready    control-plane,master   140m    v1.23.0
k8s-node-1   Ready    <none>                 128m    v1.23.0
k8s-node-2   Ready    <none>                 5m31s   v1.23.0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值