Thursday, October 5, 2017

Rancher 2.0 - Kubernete ready container environment

Rancher 2.0

I started to experiment new technologies especially containers for more than one year in my lab. Now a days technology architecture are light weight (micro service) and distributed, which enable you to easily configure and learn yourself in your laptop.   

I tested Rancher 0.8.0 few months before and now it is a time to test Rancher 2.0. 
It is a cluster ready container environment. It enables you to manage your existing kubernetes cluster in public cloud and  as well as those already running in on premises. Below diagram describe you the Rancher 2.0 architecture.Create and manage multiple kubernete clusters in Rancher 2.0. Now it is user friendly and easy configurable.


Run a single docker command  and you can get a Container cluster in a container. Rancher recommends your computer should have below requirements.
Ubuntu 16.04 (kernel v3.10+) or RHEL/CentOS 7.3
RAM at least 4GB 
Disk space  80GB
latest version of Docker engine installed .

 #docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:preview


[root@ansible-server ~]# docker ps
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                              NAMES
e2422b8acb64        rancher/server:preview   "/usr/bin/entry /usr/"   3 weeks ago         Up 58 seconds       3306/tcp, 0.0.0.0:8080->8080/tcp   zen_tesla

Wait for sometime and yon can get your Rancher Kubernete cluster environment in your server. Now I can access my Rancher console http://192.168.99.101:8080 (use your local host IP)


Adding additional host in my default cluster.

Copy the above command and run it in target host.This will join your new host into the cluster.

[root@ansible-client ~]# sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v2.0-alpha4 http://192.168.99.101:8080/v3/scripts/64EA5E2D127357876F60:1483142400000:xxXYZXXxxdcWReA5Ir6g
Unable to find image 'rancher/agent:v2.0-alpha4' locally
v2.0-alpha4: Pulling from rancher/agent
b3e1c725a85f: Pull complete
4daad8bdde31: Pull complete
63fe8c0068a8: Pull complete
4a70713c436f: Pull complete
bd842a2105a8: Pull complete
3f7d6fd71888: Pull complete
16914729cfd3: Pull complete
8c02e557c7ff: Pull complete
a2bbb798dbc8: Pull complete
a621cbb2db05: Pull complete
Digest: sha256:63b71388b4c4907394a103dc8abf57xxxxxxxxxxxxxxxxx5e79df24b084a0ae1
Status: Downloaded newer image for rancher/agent:v2.0-alpha4

INFO: Running Agent Registration Process, CATTLE_URL=http://192.168.99.101:8080/v1
INFO: Attempting to connect to: http://192.168.99.101:8080/v1
INFO: http://192.168.99.101:8080/v1 is accessible
INFO: Inspecting host capabilities
INFO: Boot2Docker: false
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration
INFO: Printing Environment
INFO: ENV: CATTLE_ACCESS_KEY=DA7B5FXXXXXXXXXXXXXXA
INFO: ENV: CATTLE_HOME=/var/lib/cattle
INFO: ENV: CATTLE_REGISTRATION_ACCESS_KEY=registrationToken
INFO: ENV: CATTLE_REGISTRATION_SECRET_KEY=xxxxxxx
INFO: ENV: CATTLE_SECRET_KEY=xxxxxxx
INFO: ENV: CATTLE_URL=http://192.168.99.101:8080/v3
INFO: ENV: DETECTED_CATTLE_AGENT_IP=192.168.99.104
INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v2.0-alpha4
INFO: Launched Rancher Agent: c2034dd35324127715ef49xxxxxxxxxxxxxxxxxxxxxxx6

Host has been added into the kubernete cluster and its ready for application container deployment.

Goto container tab and deploy your new container 

 In this window you see your application container resource consumption, health, configuration and console. You can scale up container on demand.
Learn more about Rancher in http://rancher.com/rancher2-0/

AWS Autoscaling demo lab Configuring VPC, Public/Private subnets, Internet Gateway (IGW), NAT gateway, etc.,   Crea...