系统:centos 7.9
关闭防火墙并查看防火墙状态:
systemctl stop firewalld
firewall-cmd --state
关闭selinux:
setenforce 0
关闭swap并查看:
swapoff -a
free -h
1、安装etcd
yum -y install etcd
2、修改etcd.conf文件
vi /etc/etcd/etcd.conf
3、启动etcd服务并设置开机自启:
systemctl start etcd && systemctl enable etcd
4、安装master节点
yum -y install kubernet-master
5、配置kubernetes文件
vi /etc/kubernetes/apiserver
vi /etc/kubernetes/config
6、启动kubernets服务并配置开机自启
systemctl start kube-apiserver.service && systemctl enable kube-apiserver.service
systemctl start kube-controller-manager.service && systemctl enable kube-controller-manager.service
systemctl start kube-scheduler.service && systemctl enable kube-scheduler.service
7、执行kuberctl命令
kubectl get componentstatus