k8s paperback deployment

yum source configuration:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum update

 

etcd deployment:

yum -y install etcd
Review ETCD configuration:

ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"

ETCD_NAME="etcd-master"

ETCD_ADVERTISE_CLIENT_URLS="http://etcd-master:2379"
systemctl start etcd.service
systemctl enable etcd.service

 

kubernetes-master department:

yum -y install kubernetes-master

Modified master node kubernetes-master configuration:

apiserver:

KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"

KUBE_API_PORT="--port=8080"

KUBELET_PORT="--kubelet-port=10250"

KUBE_ETCD_SERVERS="--etcd-servers=http://etcd-master:2379"

config configuration:

KUBE_MASTER="--master=http://kube-master:8080"

启动apiserver、controller-manager、scheduler

systemctl start kube-apiserver.service

systemctl start kube-controller-manager.service

systemctl start kube-scheduler.service 

systemctl enable kube-apiserver.service

systemctl enable kube-controller-manager.service

systemctl enable kube-scheduler.service    

Look cluster poor state:

kubectl get componentstatus

 

kube-node node deployment:

yum -y install kubernetes-node

Each node kubelet modify the configuration file:

KUBELET_ADDRESS="--address=192.168.56.201"

KUBELET_HOSTNAME="--hostname-override=kube-node01"

KUBELET_API_SERVER="--api-servers=http://kube-master:8080"

Start node node:

systemctl start acting

systemctl enable omelet

 

Check the status of each node on the master node:

kubectl get nodes

 

Plug flannel network deployment:

yum -y install flannel

 

Configuration flannel:

vim /etc/sysconfig/flanneld

FLANNEL_ETCD_ENDPOINTS="http://kube-master:2379"

Set the network information:

etcdctl set /atomic.io/network/config '{ "Network": "172.16.0.0/16" }'

Start flanneld:

systemctl start flanneld 

systemctl enable flanneld 

Then you need to restart the docker service nodes are consistent virtual card information docker out card information and flanneld created:

systemctl restart docker

 

Two other similarly configured node and start node flanneld

 

At this time to create a container can not communicate with each other so that the container between the different network, but also need to be modified for the FORWARD ACCEPT iptables

iptables -P FORWARD ACCEPT

 

And this added to the docker service startup file:

ExecStartPost=/usr/bin/iptables -P FORWARD ACCEPT

And entry into force:

systectl daemon-reload

 

Guess you like

Origin www.cnblogs.com/pitmaner/p/11443582.html