_# jeffery # focus on Odoo and other open source IT solutions # IT基础架构资深专家,开源解决方案专家,odoo资深专家__Q:913547235 讨论群397750860

run kubernetes

use kubeadm in lab only,,, do not use it in production


install docker 1.12.6 …..


please noted not install the lasted version.


  • download kubernetes suits.


install from deb packages.


wget https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/linux/amd64/kubectl

 wget https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/linux/amd64/kubeadm

 wget https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/linux/amd64/kubelet

 wget https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/linux/amd64/kubernetes-cni


sudo dpkg -i kubelet kubeadm kubectl kubernetes-cni

sudo apt-get install -f #install missed dependency


install from apt repository


switch to root


apt-get update && apt-get install -y apt-transport-https

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF >/etc/apt/sources.list.d/kubernetes.list

deb http://apt.kubernetes.io/ kubernetes-xenial main


apt-get update

# Install docker if you don't have it already.

apt-get install -y docker-engine

apt-get install -y kubelet kubeadm kubectl kubernetes-cni


  • init cluster


sudo kubeadmin init


记住:在 加入节点前,先安装 网络插件


  • install weave_net


kubectl apply -f https://git.io/weave-kube-1.6


  • or install calico


kubectl apply -f http://docs.projectcalico.org/v2.2/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml


  • if you have forgotten the token, can use following command to get token


sudo kubeadm token list


join node into cluster


sudo kubeadm join --token=604eff.a6a6b84b09e7682f




  • install dashboard


kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml


  • install heapter


clone heapster project into local dir, such as /opt/go/src/k8s.io/heapster/


go into heapster dirctory deploy


and run


bash kube.sh start # install heapster pod and service, and others.


  • testing


kubectl cluster-info




转载注明原作者 /by Jeffery

posted on 2017-05-19 12:23  odoouse  阅读(476)  评论(0编辑  收藏  举报


_# jeffery # focus on Odoo and other open source IT solutions # IT基础架构资深专家,开源解决方案专家,odoo资深专家