国内版

一、部署Kubernetes1.12.2(无dashboard)

1、所有节点部署docker-ce kubernetesyum源

阿里云docker-ce地址 :https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo直接下载到 /etc/yum.repo.d/

Kubernetes yum源配置:

vim /etc/yum.repos.d/kubernetes.repo

[kubernetes]

name=Kubernetes Repo

baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/

gpgcheck=0

enabled=1

2、master节点安装kubelet kubeadm docker-ce kubectl node节点安装kubelet kubeadm docker-ce

master #yum install -y docker-ce kubelet kubeadm kubectl

node #yum install -y docker-ce kubelet kubeadm

all node#systemctl enable docker && systemctl start docker

all node#systemctl enable kubelet

all node# docker load -i k8s.gcr.io.basic.tar.gz

google镜像包地址:

链接:https://pan.baidu.com/s/1tXJYL7-KdPJRRlPBg83OyQ

提取码:bxwn

3、安装master节点

master#kubeadm init --kubernetes-version=v1.12.2 --pod-network-cidr=10.244.0.0/16 --service-cidr=10.96.0.0/12

待kubeadm 自动安装完成

master#mkdir -p $HOME/.kube

master#cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

master#chown $(id -u):$(id -g) $HOME/.kube/config

master#kubectl apply -fhttps://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

4、安装node节点

node# kubeadm join ..................................

单节点masterK8s1.12.2部署完成(无dashboard)

5、查看node是否正常

master#kubectl get node