Deployment structure
- 3 virtual machines, 1 of which are master,2 as Minion, are installed with the latest version of Docker engine (currently 1.11.2)
- K8s version is 1.3.0
Problems
The deployment steps are basically in accordance with official documentation: http://kubernetes.io/docs/getting-started-guides/ubuntu/, but there are two major issues
- Domestic download installation package too slow
The installation script uses curl to download K8s's release tar package (1.3.0 's release package has 1.4G), often timeout interrupts installation
- GFW restricted access to Gcr.io
K8s When creating pods, you need to download a helper image from Gcr.io (currently gcr.io/google_containers/pause-amd64:3.0). This issue causes the image to not be downloaded, and the pod is always in the containercreating state.
Here are the main ways to solve these two problems.
Deploy Step 1. Download the k8s on the deployment machine and compile.
The deployment machine requires the installation of Docker engine (1.11.2) and Go (1.6.2)
$git clone https://github.com/kubernetes/kubernetes.git$cd kubernetes$ make release-skip-tests$mv _output/release-stage/full/kubernetes/server/ Kubernetes-server-linux-amd64. tar. GZ cluster/ubuntu/
Note
In addition to LINUX/AMD64, cross-compiling is also done by default for other platforms. In order to reduce compilation time, you can modify hack/lib/golang.sh, kube_server_platforms, Kube_client_platforms and kube_test_platforms in addition to linux/ Comment out the platform other than AMD64.
2. Download the Etcd,flannel installation package
$ETCD _version=${etcd_version:-"2.3.1"} $ETCD="Etcd-v${etcd_version}-linux-amd64"$curl-L https://Github.com/coreos/etcd/releases/download/v${etcd_version}/${etcd}.tar.gz-o cluster/ubuntu/etcd.tar.gz$FLANNEL _version=${flannel_version:-"0.5.5"} $curl-L https://github.com/coreos/flannel/releases/download/v${flannel_version}/flannel-${flannel_version}- Linux-amd64.tar.gz-o cluster/ubuntu/flannel.tar.gz
3. Unzip the installation package
$CD cluster/ubuntu$mkdir-P binaries/master$mkdir-P binaries/Minion $TarXzf Etcd.Tar. gz$CP${ETCD}/ETCD ${etcd}/etcdctl binaries/master$Echo${etcd_version} > binaries/. ETCD $TarXzf Flannel.Tar. gz$CPFlannel-${flannel_version}/flanneld binaries/master$CPFlannel-${flannel_version}/flanneld binaries/minion$Echo${flannel_version} > binaries/. Flannel $KUBE _version=1.3.0$TarXzf Kubernetes-server-linux-amd64.Tar. gz$CPKubernetes/server/bin/kube-apiserver Kubernetes/server/bin/kube-controller-manager kubernetes/server/bin/ Kube-scheduler binaries/master$CPKubernetes/server/bin/kubelet Kubernetes/server/bin/kube-proxy binaries/minion$CPKubernetes/server/bin/kubectl binaries/$Echo${kube_version} > Binaries/.kubernetes
4. Installation
$ CD. /$export Nodes="[email protected] [email protected] [email protected]"$export Role="ai I i"$export num_nodes=${num_nodes:-3} $export Service_cluster_ip_range=192.168.3.0/ -$export flannel_net=172.16.0.0/ -$KUBERNETES _provider=ubuntu./kube-up.SH
5. Resolve cannot download from Gcr.iopause-amd64:3.0Problems with mirroring
1) where you can access the Gcr.io
Docker Pull gcr.io/google_containers/pause-amd64:3.0
Upload to private Docker registry
Docker tag gcr.io/google_containers/pause-amd64:3.0 k8s-docker.mydomain.com/google_containers/pause-amd64:3.0
Docker Push k8s-docker.mydomain.com/google_containers/pause-amd64:3.0
2) at all k8s nodes
Docker Pull k8s-docker.mydomain.com/google_containers/pause-amd64:3.0
Docker tag k8s-docker.mydomain.com/google_containers/pause-amd64:3.0 gcr.io/google_containers/pause-amd64:3.0
Note
Instead of passing through private registry, the use of Docker save/load should also be (not tested), but rather cumbersome.
Domestic Ubuntu 14.04 Host deployment k8s cluster