部署过程
1、部署架构
2、部署前准备
系统环境准备
#关闭交换分区 swapoff -a echo "swapoff -a" >> /etc/rc.local #关闭防火墙 systemctl disable firewalld systemctl stop firewalld #关闭selinux setenforce 0 sed -i '/^SELINUX/s/enforcing/disabled/' /etc/selinux/config #配置kubernetes下载地址 cat << EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=0 EOF #安装kubernetes工具。node节点可以不需要安装kubectl yum install -y yum-utils device-mapper-persistent-data lvm2 kubelet kubeadm kubectl net-tools #配置iptables转发 cat > /etc/sysctl.d/k8s.conf << EOF net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF
View Code
host文件准备
[root@master ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.11 master 192.168.1.12 node01 192.168.1.13 node02
View Code
3、镜像准备
查看当前kubeamd默认支持的镜像版本号:kubeadm config images list
[root@master ~]# kubeadm config images list k8s.gcr.io/kube-apiserver:v1.23.5 k8s.gcr.io/kube-controller-manager:v1.23.5 k8s.gcr.io/kube-scheduler:v1.23.5 k8s.gcr.io/kube-proxy:v1.23.5 k8s.gcr.io/pause:3.6 k8s.gcr.io/etcd:3.5.1-0 k8s.gcr.io/coredns/coredns:v1.8.6
View Code
可从阿里面官网上下载(目前只存储了这一个版本)
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/kube-apiserver:v1.23.5
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/kube-proxy:v1.23.5
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/kube-controller-manager:v1.23.5
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/kube-scheduler:v1.23.5
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/coredns:v1.8.6
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/etcd:3.5.1-0
docker pull registry.cn-shenzhen.aliyuncs.com/lmgsanm_k8s/pause:3.6
4、部署
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/245307.html