### kubernetes集群环境依赖
- harbor仓库地址修改
- docker yum 修改
- 创建集群
执行脚本editimage.sh,完成私有化定制修改。
bash -x editimage.sh
创建集群模板
cp -av inventory/sample/ inventory/noah-cloud/
初始化集群参数hosst.ini、all.yml、k8s-cluster.yml
ansible-playbook -i inventory/sinux/hosts.ini --become --become-user=root cluster.yml -vvv
污染策略删除
kubectl taint node --all node.cloudprovider.kubernetes.io/uninitialized:NoSchedule-
检查集群是否部署成功,登录master01
[root@master01 ~]# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-57455d4888-ddgld 1/1 Running 0 49m
coredns-57455d4888-tv6pz 1/1 Running 0 49m
ingress-nginx-controller-6jd6d 1/1 Running 0 50m
ingress-nginx-controller-ks7fm 1/1 Running 0 50m
ingress-nginx-controller-xznph 1/1 Running 0 50m
ingress-nginx-default-backend-v1.4-vpqhp 1/1 Running 0 50m
kube-apiserver-master01.sinux.com.cn 1/1 Running 0 50m
kube-apiserver-master02.sinux.com.cn 1/1 Running 0 50m
kube-apiserver-master03.sinux.com.cn 1/1 Running 0 50m
kube-controller-manager-master01.sinux.com.cn 1/1 Running 0 51m
kube-controller-manager-master02.sinux.com.cn 1/1 Running 0 51m
kube-controller-manager-master03.sinux.com.cn 1/1 Running 0 51m
kube-flannel-5vd7k 2/2 Running 0 50m
kube-flannel-dg5fw 2/2 Running 0 50m
kube-flannel-fs9rd 2/2 Running 0 4m
kube-flannel-fzzhq 2/2 Running 0 50m
kube-proxy-master01.sinux.com.cn 1/1 Running 0 51m
kube-proxy-master02.sinux.com.cn 1/1 Running 0 51m
kube-proxy-master03.sinux.com.cn 1/1 Running 0 50m
kube-proxy-node01.sinux.com.cn 1/1 Running 0 4m
kube-scheduler-master01.sinux.com.cn 1/1 Running 0 51m
kube-scheduler-master02.sinux.com.cn 1/1 Running 0 51m
kube-scheduler-master03.sinux.com.cn 1/1 Running 0 51m
nginx-proxy-node01.sinux.com.cn 1/1 Running 0 3m
**检查每台机器 /etc/fstab swap 分区是否删除**
### 启动 Nginx 支持TCP
kubectl run nginx --image=nginx --port=80
## 扩展 node
添加新的node到hosts.ini分组,运行scale.yml
ansible-playbook -i inventory/sinux/hosts.ini scale.yml -b -v