Centos 8 kubernetes 安装笔记

安装完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

// 安装指定版本的kubernetes 

yum install -y kubectl-1.18.2.-0 kubeadm-1.18.2-0 kubelet-1.18.2-0

// 启动kubelet服务

systemctl enable kubelet && systemctl start kubelet

// 关闭swap分区

swapoff -a

// 初始化kubeadm节点

kubeadm init --image-repository registry.aliyuncs.com/google_containers --apiserver-advertise-address=10.10.10.231 --kubernetes-version=v1.18.2 --pod-network-cidr=10.122.0.0/16 --service-cidr=10.10.0.0/16 --token-ttl 0 --ignore-preflight-errors=Swap

// 启动kubectl 代理

kubectl proxy --address='10.10.10.231' --port=8001 --accept-hosts='^*$'
原文地址:https://www.cnblogs.com/yy690486439/p/13596391.html