下载二进制包:
文档地址:
https://kubernetes.io/docs/getting-started-guides/binary_release/
github 二进制包:
https://github.com/kubernetes/kubernetes/releases
解压:
tar xzvf kubernetes.tar.gz
cd kubernetes
./cluster/get-kube-binaries.sh
安装镜像:
docker pull gcr.io/google_containers/pause-amd64:3.0
docker pull gcr.io/google_containers/hyperkube-amd64:v1.8.3
docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.8.3
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.8.3
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.8.3
docker pull gcr.io/google_containers/kube-discovery-amd64:1.0
docker pull gcr.io/google_containers/etcd-amd64:3.0.4
启动 kubelet:
/usr/local/kubernetes/server/bin/kubelet --pod-infra-container-image=registry.cn-hangzhou.aliyuncs.com/google-containers/pause-amd64:3.0
初始化:
# kubeadm init --skip-preflight-checks --pod-network-cidr="10.24.0.0/16"
报错:
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
unable to get URL "https://dl.k8s.io/release/stable-1.8.txt": Get https://storage.googleapis.com/kubernetes-release/release/stable-1.8.txt: read tcp 10.0.177.242:37920->172.217.27.144:443: read: connection reset by peer
解决:
kubeadm init --skip-preflight-checks --pod-network-cidr="10.24.0.0/16" --kubernetes-version=v1.8.3
参考资料:
http://oscogozpr.bkt.clouddn.com/赵梓旗-如何优雅的部署kubernetes集群.pdf