kubeadm离线部署K8S1.19

系统环境:centos7.6
内核默认:Linux m2 3.10.0-1160.el7.x86_64

关闭防火墙 SELINUX

systemctl stop firewalld && systemctl disable firewalld
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=disable/' /etc/selinux/config

关闭swap

swapoff -a && sysctl -w vm.swappiness=0
sed -i 's/.*swap.*/#&/g' /etc/fstab

初始化配置

vim /etc/hosts
192.168.50.133 k8s-master
192.168.50.134 k8s-node01
hostnamectl set-hostname k8s-master
hostnamectl set-hostname k8s-node01

docker19.03包(所有离线包提前在有网络的服务器上下载即可)

[root@k8s-master ~]# ls docker
audit-2.8.5-4.el7.x86_64.rpm
audit-libs-2.8.5-4.el7.x86_64.rpm
audit-libs-python-2.8.5-4.el7.x86_64.rpm
checkpolicy-2.5-8.el7.x86_64.rpm
containerd.io-1.6.6-3.1.el7.x86_64.rpm
container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
docker-ce-19.03.9-3.el7.x86_64.rpm
docker-ce-cli-20.10.17-3.el7.x86_64.rpm
docker-scan-plugin-0.17.0-3.el7.x86_64.rpm
libcgroup-0.41-21.el7.x86_64.rpm
libsemanage-python-2.5-14.el7.x86_64.rpm
policycoreutils-2.5-34.el7.x86_64.rpm
policycoreutils-python-2.5-34.el7.x86_64.rpm
python-IPy-0.75-6.el7.noarch.rpm
setools-libs-3.3.8-4.el7.x86_64.rpm

[root@k8s-master ~]# cd docker && rpm -ivh *.rpm --force --nodeps

K8S镜像包

[root@k8s-master ~]# ls k8s-1.19.3
coredns-1.7.0.tar
etcd-3.4.13-0.tar
kube-apiserver-v1.19.3.tar
kube-controller-manager-v1.19.3.tar
kube-proxy-v1.19.3.tar
kube-scheduler-v1.19.3.tar
pause-3.2.tar

[root@k8s-master ~]# cd k8s-1.19.3 && for i in `ls .`;do docker load -i $i;done

K8S工具包

[root@k8s-master ~]# ls k8s-1.19.3-kube/
07433570e95a2782cc127e659fe6df434db7f88805e2aed6067768d2f32cb809-cri-tools-1.24.2-0.x86_64.rpm
1de80331b548f69c71f62d733ad957e4153e9c9af5528d3dea74a3088c0b8421-kubelet-1.19.3-0.x86_64.rpm
24a0b394551c612fdc827c5f46a10bd1472fd79d070c2d0310c06369ce97f23a-kubeadm-1.19.3-0.x86_64.rpm
conntrack-tools-1.4.4-7.el7.x86_64.rpm
d088f1c423aca204ae08d0da14b244da33897ec16198d7aae117da2caf0b3141-kubectl-1.19.3-0.x86_64.rpm
db7cb5cb0b3f6875f54d10f02e625573988e3e91fd4fc5eef0b1876bb18604ad-kubernetes-cni-0.8.7-0.x86_64.rpm
libnetfilter_cthelper-1.0.0-11.el7.x86_64.rpm
libnetfilter_cttimeout-1.0.0-7.el7.x86_64.rpm
libnetfilter_queue-1.0.2-2.el7_2.x86_64.rpm
socat-1.7.3.2-2.el7.x86_64.rpm

[root@k8s-master ~]# cd k8s-1.19.3-kube && rpm -ivh *.rpm

K8S网络插件包

[root@k8s-master ~]# ls calico-3.8.2/
calico-cni-3.8.2.tar
calico-kube-controllers-3.8.2.tar
calico-node-3.8.2.tar
calico-pod2daemon-flexvol-3.8.2.tar

安装k8s-master

kubeadm init --apiserver-advertise-address 192.168.50.133 --apiserver-bind-port 6443 --kubernetes-version 1.19.3 --pod-network-cidr 10.244.0.0/16

工作节点只需要安装(K8S工具包,K8S网络插件包),以及
coredns-1.7.0.tar、kube-proxy-v1.19.3.tar、pause-3.2.tar 即可

你可能感兴趣的:(kubeadm离线部署K8S1.19)