Use Kubeadm to quickly build k8s clusters (single-master,ha functionality is still in development)
Architecture:
Master 192.168.1.11
Slave 192.168.1.12
Pre-conditions
The system is Ubuntu16.04 or CENTOS7
The following operations are in the CENTOS7 environment and the Docker is installed
Installing the Yum source
Cat <<eof >/etc/yum.repos.d/k8s.repo[kubelet]name=kubeletbaseurl=http://files.rm-rf.ca/rpms/kubelet/ Enabled=1gpgcheck=0eof
In addition to Kubelet, the components are already Docker
Yum install-y kubelet kubeadm kubectl kubernetes-cnisystemctl enable Kubelet && systemctl start Kubelet
Attention:
1, the program will be hostname regular match, modify the hostname and hosts file, need to comply with example.com
2, the early download mirror, because the domestic shielding the
I have uploaded the relevant image
https://hub.docker.com/u/foxchan/
The image name is as follows:
Gcr.io/google_containers/pause-amd64:3.0gcr.io/google_containers/kube-apiserver-amd64:v1.4.0gcr.io/google_ containers/kube-controller-manager-amd64:v1.4.0gcr.io/google_containers/kube-scheduler-amd64:v1.4.0gcr.io/ google_containers/etcd-amd64:2.2.5gcr.io/google_containers/kube-discovery-amd64:1.0gcr.io/google_containers/ KUBE-DNSMASQ-AMD64:1.3GCR.IO/GOOGLE_CONTAINERS/KUBEDNS-AMD64:1.7GCR.IO/GOOGLE_CONTAINERS/KUBE-PROXY-AMD64: v1.4.0
In the machine you expect to run master, perform the following commands, wait patiently, download the network (download is the image provided above)
Kubeadm Init--use-kubernetes-version v1.4.0-beta.11
This shows that the installation was successful.
Kubernetes Master initialised successfully! You can now join all number of machines by running the following on each node:kubeadm join--token dxxxxxxxxx 192.168.1.11
Slave node
Download the image first
gcr.io/google_containers/pause-amd64:3.0gcr.io/google_containers/kube-proxy-amd64:v1.4.0
Execute the following command to join the cluster
Kubeadm Join--token dxxxxxxxx 192.168.1.11
Master to see if the add succeeds
Kubectl Get Nodes
It's not over yet, there's still work to do!
Now create a pod network (master operation, can also be used in other network mode, Calico or Canal supplement)
Weaver Network:
Image as follows
weaveworks/weave-kube:1.7.0weaveworks/weave-npc:1.7.0
Add Weaver Network Support
Kubectl apply-f Https://git.io/weave-kube
This article is from the "Silver Fox" blog, please be sure to keep this source http://foxhound.blog.51cto.com/1167932/1858129
CENTOS7 installation kubernetes1.4 (Kubeadm version)