#You will need 4 centos 7 servers for hosting a kubernetes cluster of 3 nodes and 1 master.
#Kubernetes main server is called a master server
#The worker nodes on which docker containers are deployed, are called Minions
#Kubernetes orchestrates docker containers on those minion servers. The docker+application combo that gets deployed on the minion servers are called the Pods.
#kubectl is the command line tool to do things in Kubernetes
#Out of the 4 servers mark one as the master server.
#Now on the master server do the following as root user:
yum -y install nano wget tree
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
yum -y install etcd kubernetes
#Then on the master server, open up /etc/etcd/etcd.conf
nano /etc/etcd/etcd.conf
#inside the master server etcd.conf file make sure the following is maintained:
ETCD_NAME=defaultETCD_DATA_DIR="/var/lib/etcd/default.etcd"ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379"nano /etc/kubernetes/apiserver
#Make sure the following content is there inside the /etc/kubernetes/apiserver file
KUBE_API_ADDRESS="--address=0.0.0.0"KUBE_API_PORT="--port=8080"KUBELET_PORT="--kubelet_port=10250"KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:2379"KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota"KUBE_API_ARGS=""etcdctl mk /atomic.io/network/config '{"Network":"172.17.0.0/16"}'yum -y install nano wget tree
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
FLANNEL_ETCD="http://masterserverip:2379"KUBE_MASTER="--master=http://masterserverip:8080"KUBELET_ADDRESS="--address=0.0.0.0"KUBELET_PORT="--port=10250"# change the hostname to this host’s IP addressKUBELET_HOSTNAME="--hostname_override=minion1ip"KUBELET_API_SERVER="--api_servers=http://masterserverip:8080"KUBELET_ARGS=""yum -y install nano wget tree
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
FLANNEL_ETCD="http://masterserverip:2379"KUBE_MASTER="--master=http://masterserverip:8080"KUBELET_ADDRESS="--address=0.0.0.0"KUBELET_PORT="--port=10250"# change the hostname to this host’s IP addressKUBELET_HOSTNAME="--hostname_override=minion2ip"KUBELET_API_SERVER="--api_servers=http://masterserverip:8080"KUBELET_ARGS=""yum -y install nano wget tree
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
FLANNEL_ETCD="http://masterserverip:2379"KUBE_MASTER="--master=http://masterserverip:8080"KUBELET_ADDRESS="--address=0.0.0.0"KUBELET_PORT="--port=10250"# change the hostname to this host’s IP addressKUBELET_HOSTNAME="--hostname_override=minion3ip"KUBELET_API_SERVER="--api_servers=http://masterserverip:8080"KUBELET_ARGS=""yum install cockpit cockpit-kubernetes systemctl enable cockpit.socket systemctl start cockpit.socket