微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

kubernetes安装部署--基于kubeadmin部署单机版本

 

部署过程

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、部署

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐