标签:
部署步骤基本按照官方文档:http://kubernetes.io/docs/getting-started-guides/ubuntu/,但是有两个主要问题
这里主要介绍一下如何解决这两个问题。
部署机需要安装docker engine(1.11.2)和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
除了linux/amd64,默认还会为其他平台做交叉编译。为了减少编译时间,可以修改hack/lib/golang.sh,把KUBE_SERVER_PLATFORMS, KUBE_CLIENT_PLATFORMS和KUBE_TEST_PLATFORMS中除linux/amd64以外的其他平台注释掉。
$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
$cd cluster/ubuntu $mkdir -p binaries/master $mkdir -p binaries/minion $ tar xzf etcd.tar.gz $ cp ${ETCD}/etcd ${ETCD}/etcdctl binaries/master $ echo ${ETCD_VERSION} > binaries/.etcd $tar xzf flannel.tar.gz $cp flannel-${FLANNEL_VERSION}/flanneld binaries/master $cp flannel-${FLANNEL_VERSION}/flanneld binaries/minion $echo ${FLANNEL_VERSION} > binaries/.flannel $KUBE_VERSION=1.3.0 $tar xzf kubernetes-server-linux-amd64.tar.gz $cp kubernetes/server/bin/kube-apiserver kubernetes/server/bin/kube-controller-manager kubernetes/server/bin/kube-scheduler binaries/master $cp kubernetes/server/bin/kubelet kubernetes/server/bin/kube-proxy binaries/minion $cp kubernetes/server/bin/kubectl binaries/ $echo ${KUBE_VERSION} > binaries/.kubernetes
$ cd ../ $export nodes="ubuntu@10.1.9.2 ubuntu@10.1.9.3 ubuntu@10.1.9.4" $export role="ai i i" $export NUM_NODES=${NUM_NODES:-3} $export SERVICE_CLUSTER_IP_RANGE=192.168.3.0/24 $export FLANNEL_NET=172.16.0.0/16 $KUBERNETES_PROVIDER=ubuntu ./kube-up.sh
1) 在可以访问gcr.io的地方
docker pull gcr.io/google_containers/pause-amd64:3.0
传到私有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) 在所有的k8s节点
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
不通过私有registry中转,而是使用docker save/load应该也可以(未测试),只是比较麻烦。
标签:
原文地址:http://www.cnblogs.com/LinuxGo/p/5724807.html