Rancher Infrastructure Services
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!