前提:记得翻墙

一、配置镜像源
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google...
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google...

    https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg

EOF

二、关闭setenforce
setenforce 0

三、安装
yum install -y docker kubelet kubeadm kubectl kubernetes-cni

四、启动服务
systemctl enable docker && systemctl start docker
systemctl enable kubelet && systemctl start kubelet

五、初始化
kubeadm init

可能遇到的问题:
1. [preflight] Some fatal errors occurred:
    /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
解决方案:
        echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
        echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables

五、常见问题

参考文档:https://kubernetes.io/docs/ge...


sunguide
95 声望5 粉丝

给我一个支点