k8s集群部署-(一)
1、安装docker
2、安装 kubelet kubeadm kubectl
3、关闭 swap,修改 cgroup 驱动
4、初始化 master
虚拟机要求:2核2G
用阿里镜像源:
kubeadm init —apiserver-advertise-address={master ip} —image-repository registry.aliyuncs.com/google_containers —kubernetes-version {k8s-version} —service-cidr=10.1.0.0/16 —pod-network-cidr=10.244.0.0/16
5、flannel 网络
曲线救国:sudo docker pull quay.mirror.qiniu.com/coreos/flannel:v0.11.0-amd64
sudo docker tag quay.mirror.qiniu.com/coreos/flannel:v0.11.0-amd64 quay.io/coreos/flannel:0.11.0-amd64
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
6、node 加入集群
重复1、2、3,也需要 pull flannel的镜像
kubeadm join
kubeadm join --token {token} {master ip}:6443 --discovery-token-ca-cert-hashsha256:{hashcode}
7、kubernetes 需要的外国镜像可以从 阿里云镜像站拉取
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/{image}:{tag}
sudo docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/{image}:{tag} {需要的image的名字}:{tag}
参考url:
https://blog.csdn.net/WALK_MAN_wubiao/article/details/82931226 (得到dashboard的token)
https://www.jianshu.com/p/feeea0bbd73e (k8s ingress)
--------今天先记录这些,待补充