Rancher Series
- Part 1: RancherOS
- Part 2: Rancher–First Application
- Part 3: Rancher Infrastructure Services
- Part 4: Floating IP and Containers
Rancher provides Infrastructure Services; many of which we used to run our first application.
It provides Networking service; which gives 172.17.0.0/16 Docker bridge ips and 10.42.0.0/16 Rancher managed ips. It then setups a secure network using IPsec tunnels that enables cross host container communication. Using this our web containers were able to connect to MongoDB containers across multiple hosts seamlessly.
We also saw Load Balancer service; that uses HAProxy and it not only scale to multiple hosts but when we “linked” our web service to it; it also find them across multiple hosts and uses all of them as load balancer targets.
It provides a DNS service; when we linked MongoDB cluster into the web server container; we were able to ping all the containers with the service alias; we could use the DNS name of our linked server instead of giving multiple IPs; but we had to setup Mongoose accordingly that we are connecting to a cluster and not to a single MongoDB host
It also provides Metadata service; that we will see more in this post, Persistent Storage Service; using which we can expose volumes to our containers; topic of upcoming Post, Audit Logging; using which admins can view who is configuring what in the environment using the admin web interface and Service Accounts; using which we can make applications that can interact with Rancher using its API
Using Metadata service; we can query the data Rancher is maintaining for the environment. Its a HTTP based API and data is spitted out in JSON format. To try it out; I created a “Standalone Container” using debian; and installed CURL (apt-get install curl). The API end point is http://rancher-metadata; which is made available through Rancher’s DNS service to the container; there are two versions; I used 2015-12-19. The version is appended to the URL and then we need to add different paths for different queries. Here’s the screenshot of some of the queries that I tried to find out if the Load Balancer of our first application is running or not!
-
To access RancherOS machine using PuTTY; you first need to create PuTTY PPK file using PuTTY Key Generator; import the id_rsa file that has our private key that we generated using Git Tools while installing RancherOS and save this private key; the PuTTY key generator will make a PPK file; keep it in the same %UserProfile%\.ssh folder; and then connect to your RancherOS machine using >putty –i %UserProfile%\.ssh\id_rsa.ppk rancher@YourRancherOSMachineIP