文章目录
- Kubernetes简介
- 1、k8s集群环境
- 2、linux实验环境初始化
- 3、安装docker容器引擎
- 待补充
Kubernetes简介
Kubernetes,简称k8s,容器编排引擎,以API编程的方式管理安排各个容器的引擎。
- k8s会在多台node服务器上调度pod进行部署和扩缩容
- 每个pod内部可以含有多个container
- 每个container本质上就是一个服务进程
1、k8s集群环境
- 工具:kubeadm
- 软件环境:
软件 版本
操作系统 CentOS7.2_x64
Docker 24.0.0(CE)
Kubernetes 1.30 - 服务器规划:
节点 | IP |
---|
k8s-master | 10.12.16.11 |
k8s-node1 | 10.12.16.12 |
k8s-node2 | 10.12.16.13 |
- 架构如下:
2、linux实验环境初始化
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
hostnamectl set-hostname <hostname>
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
yum install ntpdate -y
ntpdate time.windows.com
3、安装docker容器引擎
wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo
yum makecache
yum -y update
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum -y install docker-ce
systemctl enable docker && systemctl start docker
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://docker.m.daocloud.io","https://b9pmyelo.mirror.aliyuncs.com","http://dockerhub.aliangedu.cn"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
systemctl restart docker
docker info
待补充