K8S部署
k8S部署
柯穴上网
安装openvpn来获取docker镜像(不是本文重点不做详述)
软件包安装
1 关闭iptables,禁用firewalld,关闭selinux
2 配置yum仓库(使用阿里云的镜像仓库 )
要4个yum源
CentOS-Base.repo epel.repo docker-ce.repo kubernetes.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
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
3 安装kubelet kubeadm kubectl docker-ce 并且注册系统服务
yum install -y kubelet kubeadm kubectl docker-ce
systemctl enable kubelet && systemctl start kubelet
MASTER
docker服务
1 注册docker系统服务,启动docker
systemctl enable docker
systemctl start docker
2 查看参数确保是1
cat /proc/sys/net/bridge/bridge-nf-call-iptables
cat /proc/sys/net/bridge/bridge-nf-call-ip6tables
kubelet服务
1 注册kubelet系统服务
systemctl enable kubelet
kubeadm服务
1 初始化kubeadm
参数 | 数据类型 | 中文解释 | 解释 |
---|---|---|---|
--apiserver-advertise-address | string | apiserver对外服务的端口 | The IP address the API Server will advertise it's listening on. If not set the default network interface will be used. |
--apiserver-bind-port int32
Port for the API Server to bind to. (default 6443)
ls
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |