| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
File used for kubernetes
kubectl expose deployment/oms --type="NodePort" --port 8080
Deployment on CentOS 7
We will need 4 servers, running on CentOS 7 64 bit with minimal install. All components are available directly from the CentOS extras repository which is enabled by default.
Prerequisites
$ systemctl stop firewalld
$ systemctl disable firewalld
$ yum -y install ntp
$ systemctl start ntpd
$ systemctl enable ntpd
The following steps should be performed on the master.
$ yum -y install etcd kubernetes
ETCD_NAME=default
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379"
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,SecurityContextDeny,ResourceQuota" KUBE_API_ARGS=""
$ systemctl restart etcd kube-apiserver kube-controller-manager kube-scheduler
$ systemctl enableetcd kube-apiserver kube-controller-manager kube-scheduler
$ etcdctl mk /atomic.io/network/config '{"Network":"172.17.0.0/16"}'
$ kubectl get nodes NAME LABELS STATUS
The following steps should be performed on minion1, minion2 and minion3 unless specified otherwise.
$ yum -y install flannel kubernetes
FLANNEL_ETCD="http://192.168.50.130:2379"
KUBE_MASTER="--master=http://192.168.50.130:8080"
minion1:
KUBELET_ADDRESS="--address=0.0.0.0"
KUBELET_PORT="--port=10250"
KUBELET_HOSTNAME="--hostname_override=192.168.50.131"
KUBELET_API_SERVER="--api_servers=http://192.168.50.130:8080"
KUBELET_ARGS=""
minion2:
KUBELET_ADDRESS="--address=0.0.0.0"
KUBELET_PORT="--port=10250"
KUBELET_HOSTNAME="--hostname_override=192.168.50.132"
KUBELET_API_SERVER="--api_servers=http://192.168.50.130:8080"
KUBELET_ARGS=""
minion3:
KUBELET_ADDRESS="--address=0.0.0.0"
KUBELET_PORT="--port=10250"
KUBELET_HOSTNAME="--hostname_override=192.168.50.133"
KUBELET_API_SERVER="--api_servers=http://192.168.50.130:8080"
KUBELET_ARGS=""
$ systemctl restart kube-proxy kubelet docker flanneld
$ systemctl enable kube-proxy kubelet docker flanneld
minion1:
$ ip a | grep flannel | grep inet
inet 172.17.45.0/16 scope global flannel0
minion2:
$ ip a | grep flannel | grep inet
inet 172.17.38.0/16 scope global flannel0
minion3:
$ ip a | grep flannel | grep inet
inet 172.17.93.0/16 scope global flannel0
$ kubectl get nodes
NAME LABELS STATUS
192.168.50.131 kubernetes.io/hostname=192.168.50.131 Ready
192.168.50.132 kubernetes.io/hostname=192.168.50.132 Ready
192.168.50.133 kubernetes.io/hostname=192.168.50.133 Ready
You are now set. The Kubernetes cluster is now configured and running. We can start to play around with pods.
| Back | FazBrowse Home | New Git URL |