Kuburnetes Configuration

Kuburnetes is  a system for container management. Open sourced by google.

Githttps://github.com/googlecloudplatform/kubernetes

Why Kuburnetes: lean, Portable, extensible, self-healing

Components:

1. Master: API Server, Scheduler, Registries, Controller-manager

2. Minion:  PODs, Kubelet, cAdvisor, Proxy

  3. Pod: Grouping of containers

4. Service and labels

5. Container

6. API Server

7. etcd

8. cAdvisor

9. kubectl: CLI which provides master access

CLI to manage is kubectl (kubecfg is deprecated) . All blogs talks configuration with kubecfg which may not work now.

Configuration

Current Kuburnetes is implemented on various ways.  This present setup use Fedora Manual setup.

My configuration has two nodes. ( one Master, One minor)

———–

Kuburnetes is  a system for container management. Open sourced by google.

Githttps://github.com/googlecloudplatform/kubernetes

Why Kuburnetes: lean, Portable, extensible, self-healing

Components:

1. Master: API Server, Scheduler, Registries, Controller-manager

2. Minion:  PODs, Kubelet, cAdvisor, Proxy

  3. Pod: Grouping of containers

4. Service and labels

5. Container

6. API Server

7. etcd

8. cAdvisor

9. kubectl: CLI which provides master access

CLI to manage is kubectl (kubecfg is deprecated) . All blogs talks configuration with kubecfg which may not work now.

Configuration

Current Kuburnetes is implemented on various ways.  This present setup use Fedora Manual setup.

My configuration has two nodes. ( one Master, One minon)

———–

1) System Information:

Both the machines has Fedora20

[root@fed-master ~]# cat /etc/issue
Fedora release 20 (Heisenbug)

[root@fed-minor ~]# cat /etc/issue
Fedora release 20 (Heisenbug)

fed-master = 9.121.59.12
fed-minion = 9.121.59.15

2) Install kuburnetes

yum install –enablerepo=updates-testing kubernetes

3) if DNS not configured in lab, add below on both nodes.

[root@fed-master ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 hadoop2
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
9.121.59.12 fed-master
9.121.59.15 fed-minion
[root@fed-master ~]#

4) Edit /etc/kubernetes/config on all hosts

# Comma seperated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS=”–etcd_servers=http://fed-master:4001″

# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR=”–logtostderr=true”

# journal message level, 0 is debug
KUBE_LOG_LEVEL=”–v=0″

# Should this cluster be allowed to run privleged docker containers
KUBE_ALLOW_PRIV=”–allow_privileged=false”

5) Disable the firewall on both the master and minon

6) Configure the kubernetes services on the master.

6.1 ) edit /etc/kubernetes/apiserver:

# The address on the local server to listen to.
KUBE_API_ADDRESS=”–address=0.0.0.0″

# The port on the local server to listen on.
KUBE_API_PORT=”–port=8080″

# How the replication controller and scheduler find the kube-apiserver
KUBE_MASTER=”–master=http://fed-master:8080″

# Port minions listen on
KUBELET_PORT=”–kubelet_port=10250″

# Address range to use for services
KUBE_SERVICE_ADDRESSES=”–portal_net=10.254.0.0/16″

# Add you own!
KUBE_API_ARGS=””

6.2) Edit /etc/kubernetes/controller-manager

# Add you own!
KUBE_CONTROLLER_MANAGER_ARGS=””

# Comma seperated list of minions
KUBELET_ADDRESSES=”–machines=fed-minion”

6.3 ) Start the appropriate services on master:

for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl status $SERVICES
done

7) Configure the kubernetes services on the minon

7.1) Edit /etc/kubernetes/kubelet

# The address for the info server to serve on
KUBELET_ADDRESS=”–address=0.0.0.0″

# The port for the info server to serve on
KUBELET_PORT=”–port=10250″

# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME=”–hostname_override=fed-minion”

# Add your own!
KUBELET_ARGS=””

7.2) start Servcies:

for SERVICES in kube-proxy kubelet docker; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl status $SERVICES
done

8)  Check the setup on Master

[root@fed-master ~]# kubectl get minions
NAME LABELS
fed-minion <none>

All set. Ready to go.

9)  create  a yaml file on master

[root@fed-master ~]# cat kubeintro.yaml
apiVersion: v1beta1
kind: Pod
id: www
desiredState:
manifest:
version: v1beta1
id: www
containers:
– name: nginx
image: dockerfile/nginx
[root@fed-master ~]#

10) create pod:

[root@fed-master ~]# kubectl create -f kubeintro.yaml
www

11) Get pod status

[root@fed-master ~]# kubectl get pods
NAME                IMAGE(S)            HOST                LABELS              STATUS
redis-master        dockerfile/redis    fed-minion/         name=redis-master   Running
www                 dockerfile/nginx    fed-minion/                       Running
php                 dockerfile/nginx    fed-minion/         name=foo            Running

12) go to Master web browser on run :

fed-master:8080

Welcome to Kubernetes

You can keep adding more minons and run pods on minon.

For now only one master can manage. Multiple masters for redudancy code is available. But not well tested.

Thanks to Kubernetes github.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s