Kubernetes Install deployment Cluster Build example

Source: Internet
Author: User
Tags etcd egrep

# # # System Environment Readiness (CentOS 7.2):

A) # Systemctl disable FIREWALLD

b) # sed-i s '/selinux=enforcing/selinux=disabled/g '/etc/sysconfig/selinux

c) # yum-y update && reboot

d) # yum-y install ntpdate && ntpdate cn.pool.ntp.org


master:192.168.11.10

node1:192.168.11.20

node2:192.168.11.30

Download the installation:

Etct:https://github.com/coreos/etcd/releases

Flannel:https://github.com/coreos/flannel/releases

Kubernetes:https://github.com/kubernetes/kubernetes/releases

docker:https://docs.docker.com/engine/installation/linux/centos/

) writes DNS to each node, respectively:

192.168.11.10 Master Hub.jevic.io

192.168.11.20 Node1

192.168.11.30 Node2

----------------------------------------------------


Master Configuration: 192.168.11.10

[Email protected] master]# LS/OPT/SOURCEETCD

Flannel Etcd Kubernetes

[[email protected] master] ln-s/opt/source/etcd/etcd/usr/local/bin

[[email protected] master] ln-s/opt/source/etcd/etcdctl/usr/local/bin

[[email protected] master] ln-s/opt/source/flannel/flanneld/usr/local/bin

[[email protected] master] ln-s/opt/source/kubernetes/server/bin/kube-apiserver/usr/local/bin

[[email protected] master] ln-s/opt/source/kubernetes/server/bin/kube-controller-manager/usr/local/bin

[[email protected] master] ln-s/opt/source/kubernetes/server/bin/kubectl/usr/local/bin

[[email protected] master] ln-s/opt/source/kubernetes/server/bin/kube-scheduler/usr/local/bin

[[email protected] master] mkdir/var/log/{flanneld,kubernetes}

[[email protected] master] nohup etcd--name etcd10--data-dir/var/lib/etcd \

--listen-client-urls http://0.0.0.0:2378,http://0.0.0.0:4001 \

--advertise-client-urls http://0.0.0.0:2378,http://0.0.0.0:4001 >>/var/log/etcd.log 2>&1 &

[[email protected] master] nohup Flanneld--listen=0.0.0.0:8888 >>/var/log/flanneld/flanneld.log 2>&1 &

[[email protected] master] etcdctl set/coreos.com/network/config ' {"Network": "10.1.0.0/16"} '

---then perform the (A-G) part of the NODE1,NODE2 separately---

Finally open the Kubernetes service:

[[email protected] master] nohup kube-apiserver--logtostderr=true \

--v=0--etcd_servers=http://0.0.0.0:2378 \

--insecure-bind-address=0.0.0.0 \

--insecure-port=8080 \

--SERVICE-CLUSTER-IP-RANGE=10.254.0.0/16 >>/var/log/kubernetes/kube-apiserver.log 2>&1 &

[[email protected] master] nohup kube-controller-manager--logtostderr=true--v=0--master=http://0.0.0.0:8080 > >/var/log/kubernetes/controller.log 2>&1 &

[[email protected] master] nohup kube-scheduler--logtostderr=true--v=0--master=http://0.0.0.0:8080 >>/var/log /kubernetes/scheduler.log 2>&1 &

To see if a node joins:

[[email protected] master] kubectl get nodes

NAME STATUS Age

Node1 Ready 1h

Node2 Ready 39m


----------------------------------------------------

Node nodes configuration:

"Node1:192.168.11.20"

[Email protected] node1]# Ls/opt/source

Flannel Kubernetes

[Email protected] node1]# ln-s/opt/source/etcd/etcd/usr/local/bin

[Email protected] node1]# ln-s/opt/source/etcd/etcdctl/usr/local/bin

[Email protected] node1]# ln-s/opt/source/flannel/flanneld/usr/local/bin

[Email protected] node1]# ln-s/opt/source/kubernetes/server/bin/kubelet/usr/local/bin

[Email protected] node1]# ln-s/opt/source/kubernetes/server/bin/kube-proxy/usr/local/bin

A.[[email protected] node1]# mkdir/var/log/{flanneld,kubernetes}

B.[[email protected] node1]# nohup flanneld-etcd-endpoints=http://192.168.11.10:4001-remote=192.168.11.10:8888 > >/var/log/flanneld/flanneld.log 2>&1 &

C.[[email protected] node1]# source/run/flannel/subnet.env

D.[[email protected] node1]# cat/run/flannel/subnet.env

Flannel_network=10.1.0.0/16

Flannel_subnet=10.1.62.1/24

flannel_mtu=1472

Flannel_ipmasq=false

E.[[email protected] node1]# grep "Bip"/lib/systemd/system/docker.service

Execstart=/usr/bin/dockerd--bip=10.1.62.1/24--mtu=1472

F.[[email protected] node1]# systemctl daemon-reload && systemctl start Docker

G.[[email protected] node1]# IP a|egrep "Docker|flan"

3:flannel0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> MTU 1472 Qdisc pfifo_fast State UNKNOWN Qlen 500

inet 10.1.62.0/16 Scope Global Flannel0

4:DOCKER0: <NO-CARRIER,BROADCAST,MULTICAST,UP> MTU Qdisc Noqueue State down

inet 10.1.62.1/24 Scope Global DOCKER0

Finally, start the Kubernetes node service:

[Email protected] node1]# nohup kubelet--address=0.0.0.0 \

--port=10250--logtostderr=true--v=0 \

--api-servers=http://192.168.11.10:8080 >>/var/log/kubernetes/kubelet.log 2>&1 &

[Email protected] node1]# nohup kube-proxy--logtostderr=true--v=0--master=http://192.168.11.10:8080 >>/var/ Log/kubernetes/proxy.log 2>&1 &


----------------------------------------------------

"Node2:192.168.11.30"

[Email protected] node2]# Ls/opt/source

Flannel Kubernetes

[Email protected] node2]# ln-s/opt/source/etcd/etcd/usr/local/bin

[Email protected] node2]# ln-s/opt/source/etcd/etcdctl/usr/local/bin

[Email protected] node2]# ln-s/opt/source/flannel/flanneld/usr/local/bin

[Email protected] node2]# ln-s/opt/source/kubernetes/server/bin/kubelet/usr/local/bin

[Email protected] node2]# ln-s/opt/source/kubernetes/server/bin/kube-proxy/usr/local/bin

A.[[email protected] node2]# mkdir/var/log/{flanneld,kubernetes}

B.[[email protected] node2]# nohup flanneld-etcd-endpoints=http://192.168.11.10:4001-remote=192.168.11.10:8888 > >/var/log/flanneld/flanneld.log 2>&1 &

C.[[email protected] node2]# source/run/flannel/subnet.env

D.[[email protected] node2]# cat/run/flannel/subnet.env

Flannel_network=10.1.0.0/16

Flannel_subnet=10.1.77.1/24

flannel_mtu=1472

Flannel_ipmasq=false

E.[[email protected] node2]# grep "Bip"/lib/systemd/system/docker.service

Execstart=/usr/bin/dockerd--bip=10.1.77.1/24--mtu=1472

F.[[email protected] node2]# systemctl daemon-reload && systemctl start Docker

G.[[email protected] node2]# IP a|egrep "Docker|flan"

3:flannel0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> MTU 1472 Qdisc pfifo_fast State UNKNOWN Qlen 500

inet 10.1.77.0/16 Scope Global Flannel0

4:DOCKER0: <NO-CARRIER,BROADCAST,MULTICAST,UP> MTU Qdisc Noqueue State down

inet 10.1.77.1/24 Scope Global DOCKER0

Finally, start the Kubernetes node service:

[Email protected] node2]# nohup kubelet--address=0.0.0.0 \

--port=10250--logtostderr=true--v=0 \

--api-servers=http://192.168.11.10:8080 >>/var/log/kubernetes/kubelet.log 2>&1 &

[Email protected] node2]# nohup kube-proxy--logtostderr=true--v=0--master=http://192.168.11.10:8080 >>/var/ Log/kubernetes/proxy.log 2>&1 &

This article is from the "Jevic" blog, make sure to keep this source http://jevic.blog.51cto.com/2183736/1881455

Kubernetes Install deployment Cluster Build example

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.