Update centos_manual_config.md

This commit is contained in:
DrDePhobia 2016-05-22 15:21:13 -07:00
parent 1426735e85
commit 086e6d8e36
1 changed files with 47 additions and 37 deletions

View File

@ -1,7 +1,7 @@
--- ---
--- ---
* TOC * TOC
{:toc} {:toc}
## Prerequisites ## Prerequisites
@ -20,38 +20,38 @@ The Kubernetes package provides a few services: kube-apiserver, kube-scheduler,
Hosts: Hosts:
```conf ```conf
centos-master = 192.168.121.9 centos-master = 192.168.121.9
centos-minion = 192.168.121.65 centos-minion = 192.168.121.65
``` ```
**Prepare the hosts:** **Prepare the hosts:**
* Create a virt7-docker-common-release repo on all hosts - centos-{master,minion} with following information. * Create a virt7-docker-common-release repo on all hosts - centos-{master,minion} with following information.
```conf ```conf
[virt7-docker-common-release] [virt7-docker-common-release]
name=virt7-docker-common-release name=virt7-docker-common-release
baseurl=http://cbs.centos.org/repos/virt7-docker-common-release/x86_64/os/ baseurl=http://cbs.centos.org/repos/virt7-docker-common-release/x86_64/os/
gpgcheck=0 gpgcheck=0
``` ```
* Install Kubernetes on all hosts - centos-{master,minion}. This will also pull in etcd, docker, and cadvisor. * Install Kubernetes on all hosts - centos-{master,minion}. This will also pull in etcd, docker, and cadvisor.
```shell ```shell
yum -y install --enablerepo=virt7-docker-common-release kubernetes yum -y install --enablerepo=virt7-docker-common-release kubernetes
``` ```
* Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS) * Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS)
```shell ```shell
echo "192.168.121.9 centos-master echo "192.168.121.9 centos-master
192.168.121.65 centos-minion" >> /etc/hosts 192.168.121.65 centos-minion" >> /etc/hosts
``` ```
* Edit /etc/kubernetes/config which will be the same on all hosts to contain: * Edit /etc/kubernetes/config which will be the same on all hosts to contain:
```shell ```shell
# Comma separated list of nodes in the etcd cluster # Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd-servers=http://centos-master:2379" KUBE_ETCD_SERVERS="--etcd-servers=http://centos-master:2379"
@ -63,20 +63,20 @@ KUBE_LOG_LEVEL="--v=0"
# Should this cluster be allowed to run privileged docker containers # Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false" KUBE_ALLOW_PRIV="--allow-privileged=false"
``` ```
* Disable the firewall on both the master and node, as docker does not play well with other firewall rule managers * Disable the firewall on both the master and node, as docker does not play well with other firewall rule managers
```shell ```shell
systemctl disable iptables-services firewalld systemctl disable iptables-services firewalld
systemctl stop iptables-services firewalld systemctl stop iptables-services firewalld
``` ```
**Configure the Kubernetes services on the master.** **Configure the Kubernetes services on the master.**
* Edit /etc/kubernetes/apiserver to appear as such: * Edit /etc/kubernetes/apiserver to appear as such:
```shell ```shell
# The address on the local server to listen to. # The address on the local server to listen to.
KUBE_API_ADDRESS="--address=0.0.0.0" KUBE_API_ADDRESS="--address=0.0.0.0"
@ -94,25 +94,25 @@ KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# Add your own! # Add your own!
KUBE_API_ARGS="" KUBE_API_ARGS=""
``` ```
* Start the appropriate services on master: * Start the appropriate services on master:
```shell ```shell
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do
systemctl restart $SERVICES systemctl restart $SERVICES
systemctl enable $SERVICES systemctl enable $SERVICES
systemctl status $SERVICES systemctl status $SERVICES
done done
``` ```
**Configure the Kubernetes services on the node.** **Configure the Kubernetes services on the node.**
***We need to configure the kubelet and start the kubelet and proxy*** ***We need to configure the kubelet and start the kubelet and proxy***
* Edit /etc/kubernetes/kubelet to appear as such: * Edit /etc/kubernetes/kubelet to appear as such:
```shell ```shell
# The address for the info server to serve on # The address for the info server to serve on
KUBELET_ADDRESS="--address=0.0.0.0" KUBELET_ADDRESS="--address=0.0.0.0"
@ -127,28 +127,38 @@ KUBELET_API_SERVER="--api-servers=http://centos-master:8080"
# Add your own! # Add your own!
KUBELET_ARGS="" KUBELET_ARGS=""
``` ```
* Start the appropriate services on node (centos-minion). * Start the appropriate services on node (centos-minion).
```shell ```shell
for SERVICES in kube-proxy kubelet docker; do for SERVICES in kube-proxy kubelet docker; do
systemctl restart $SERVICES systemctl restart $SERVICES
systemctl enable $SERVICES systemctl enable $SERVICES
systemctl status $SERVICES systemctl status $SERVICES
done done
``` ```
*You should be finished!* *You should be finished!*
* Check to make sure the cluster can see the node (on centos-master) * Check to make sure the cluster can see the node (on centos-master)
```shell ```shell
$ kubectl get nodes $ kubectl get nodes
NAME LABELS STATUS NAME LABELS STATUS
centos-minion <none> Ready centos-minion <none> Ready
``` ```
**The cluster should be running! Launch a test pod.** **The cluster should be running! Launch a test pod.**
You should have a functional cluster, check out [101](/docs/user-guide/walkthrough/)! You should have a functional cluster, check out [101](/docs/user-guide/walkthrough/)!
## Support Level
IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level
-------------------- | ------------ | ------ | ---------- | --------------------------------------------- | ---------| ----------------------------
Bare-metal | custom | CentOS | _none_ | [docs](/docs/getting-started-guides/centos/centos_manual_config) | | Community ([@coolsvap](https://github.com/coolsvap))
For support level information on all solutions, see the [Table of solutions](/docs/getting-started-guides/#table-of-solutions) chart.