1. Disable Iptables
Each machine disables iptables to avoid iptables conflicts with Docker:
Systemctl Stop Firewalld
Systemctl Disable FIREWALLD
Disable SELinux:
Vim/etc/selinux/config
#SELINUX =enforcing
Selinux=disabled
2. Install Docker (master node) from overseas sources
Cat >/etc/yum.repos.d/docker.repo <<-eof
[Dockerrepo]
Name=docker Repository
baseurl=https://yum.dockerproject.org/repo/experimental/centos/7/
Enabled=1
Gpgcheck=1
Gpgkey=https://yum.dockerproject.org/gpg
Eof
Yum-y Install Docker-engine
Systemctl Enable Docker && Systemctl start Docker
3. Install k8s (master node) foreign source
Cat <<eof >/etc/yum.repos.d/kubernetes.repo
[Kubernetes]
Name=kubernetes
Baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
Enabled=1
Gpgcheck=1
Repo_gpgcheck=1
Gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
Https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Eof
Yum install-y kubelet kubeadm kubectl kubernetes-cni && systemctl enable Kubelet && systemctl start K Ubelet
4. Initialize Master
Kubeadm Init--token=b1f4c5.94d2933fea71f20b
Modify the configuration file/etc/kubernetes/manifests/
Etcd.json
--listen-client-urls=http://0.0.0.0:2379
--advertise-client-urls=http://172.22.0.4:2379 (native IP)
Kube-apiserver.json
--insecure-bind-address=0.0.0.0
5. Add node
Kubeadm Join--token b1f4c5.94d2933fea71f20b 172.22.0.4 (master IP)
Modifying a configuration file
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
At the back of Execstart=/usr/bin/kubelet this adds
--hostname-override=172.22.0.6 (node's own IP)
Systemctl daemon-reload && systemctl Restart Kubelet
6. Install calico (at master)
Download Http://docs.projectcalico.org/v1.5/getting-started/kubernetes/installation/hosted/kubeadm/calico.yaml
Modify Etcd_endpoints: "http://172.22.0.4:2379" (Master IP)
Delete about ETCD Daemonset Service Content
Kubectl create-f Calico.yaml
Testing is used by Ali to go abroad to the server, if the use of domestic has a mirror is pull down.
This article is from the "liangjingpingblog.com" blog, make sure to keep this source http://liangjp.blog.51cto.com/265644/1865864
Kubernetes ADM Installation Tutorial (network using calico)