安装部署k8s
systemctl stop firewalld && systemctl disable firewalld && firewall-cmd --state
setenforce 0
sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
swapoff -a
sudo yum install -y yum-utils
sudo yum-config-manager \ --add-repo \ http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce-24.0.4 docker-ce-cli-24.0.4 containerd.io
sudo systemctl start docker
systemctl status docker
vi /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
setenforce 0
sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
yum install -y kubelet-1.21.3 kubeadm-1.21.3 kubectl-1.21.3 --disableexcludes=kubernetes
kubeadm init --kubernetes-version=v1.21.3 --pod-network-cidr=10.244.0.0/16
kubeadm reset 新机器不需要执行
kubeadm init --image-repository=registry.aliyuncs.com/google_containers \
--kubernetes-version v1.21.3 \
--service-cidr=10.1.0.0/16 \
--service-cidr=10.10.0.0/16 \
--pod-network-cidr=10.122.0.0/16
vim /etc/profile
export KUBECONFIG=/etc/kubernetes/admin.conf
source /etc/profile
systemctl enable --now kubelet
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl apply -f calico.yaml
kubectl edit cm -n kube-system kube-proxy
kubectl delete pod kube-proxy-7fzn8 -n kube-system
systemctl status docker
sudo systemctl start docker
systemctl enable docker.service
systemctl status kubelet
sudo systemctl start kubelet