kubeadm 线上集群部署 k8s node 节点初始化安装

Posted heweiblog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kubeadm 线上集群部署 k8s node 节点初始化安装相关的知识,希望对你有一定的参考价值。

curl -s https://gitee.com/hewei8520/File/raw/master/1.13.5/lvm.sh |bash
mkdir -p /data/kubelet
ln -s /data/kubelet /var/lib/kubelet
systemctl stop docker
mv /var/lib/docker /data/
ln -s /data/docker /var/lib/docker
systemctl restart docker
# 除了将masterIP解析到hosts还包括本机地址何VIP地址
curl -s https://gitee.com/hewei8520/File/raw/master/1.13.5/base-env-config-multi-node.sh |bash
# 可选参数  --experimental-control-plane 新增master节点
kubeadm join 172.16.100.254:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:6db027f8c7f8aaa23e1dac2c0f4a274d9364a3e253c3e762aed563ca3ae90dfb
systemctl stop kubelet
systemctl stop docker
sed -i s/var\/lib/data/g /lib/systemd/system/kubelet.service.d/10-kubeadm.conf
sed -i  s/Environment="KUBELET_KUBECONFIG_ARGS=/Environment="KUBELET_KUBECONFIG_ARGS=--root-dir=\/data\/kubelet  /g /lib/systemd/system/kubelet.service.d/10-kubeadm.conf
systemctl enable --now docker
systemctl enable --now kubelet
kubeadm join 172.16.100.254:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:6db027f8c7f8aaa23e1dac2c0f4a274d9364a3e253c3e762aed563ca3ae90dfb 或
kubeadm join apiserver01.1ziton.com:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:6db027f8c7f8aaa23e1dac2c0f4a274d9364a3e253c3e762aed563ca3ae90dfb
如果新机器是裸机,需要提前执行该命令
curl -s https://gitee.com/hewei8520/File/raw/master/1.13.5/systemd.sh |bash

 

以上是关于kubeadm 线上集群部署 k8s node 节点初始化安装的主要内容,如果未能解决你的问题,请参考以下文章

使用kubeadm的方式部署v1.21.2版本k8s

k8s kubeadm节点退出集群

K8S------Kubeadm部署Kubernetes集群+Dashboard+Harbor仓库

K8S------Kubeadm部署Kubernetes集群+Dashboard+Harbor仓库

K8S------Kubeadm部署Kubernetes集群+Dashboard+Harbor仓库

K8S 集群架构的 kubeadm 部署dashboard 和 Harbor 仓库部署