Kubernetes 官网: Kubernetes 是什么? | Kubernetes
Kubernetes 是一个可移植的、可扩展的开源平台,用于管理容器化的工作负载和服务,可促进声明式配置和自动化。 Kubernetes 拥有一个庞大且快速增长的生态系统。Kubernetes 的服务、支持和工具广泛可用。
准备:
安装Centos
root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
hostnamectl --static set-hostname k8s-master
修改配置文件:/etc/sysconfig/network-scripts/ifcfg-ens33 no改成yes
service network restart
使用阿里云的源替换
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache
关闭防火墙,防止开机自启动
systemctl stop firewalld & systemctl disable firewalld
systemctl stop iptables & systemctl disable iptables
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
关闭防火墙后,外部请求方可到达虚拟机
此外还需要关闭Swap内存交互机制,注释掉最后一行
vim /etc/fstab
yum install docker-ce -y
启动docker并设置开机自启动
systemctl start docker & systemctl enable docker
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=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
参考: