docker pull mirrorgooglecontainers/kube-scheduler:v1.13.3
安装docker
- 使用阿里的源https://mirrors.aliyun.com/docker-ce/linux/centos/
- Cd /etc/yum.repos.d/
- Wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装kubernetes程序包
- 装备源https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
- Cd /etc/yum.repos.d/
- Vim k8s.repo
[kubernetes]
Name=k8s repo
Baseurl= https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
Gpgcheck=1
Gpgkey= https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
- Yum repolist
- Yum list all | grep “^kube”
- Yum install kubeadm kubelet kubectl
- Rpm –ql kubelet
初始化集群
- Vi /etc/sysconfig/kubelet (kubelet_extra_args=“—fail-swap-on=false”)
- 查看默认配置:kubeadm config print-default
- yum.repos.d]# kubeadm init --kubernetes-version=v1.12.2 --pod-network-cidr=10.244.0.0/16 (--dry-run 测试)
- kubeadm config images pull (提前下载镜像)
- kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
- kubectl get pods -n kube-system
- kubectl get nodes