Having a good logging solution for almost any project is crucial. It is much easier to debug application logs. ELK (Elasticsearch / Logstash / Kibana) stack is popular among different platforms and often is a choice for in-house logging solution. Unlike Docker compose or Swarm, with Kubernetes we don’t have a possibility to specify logging driver for each container individually. This means we could set up logging driver on Docker engine level, but it is not a pretty solution. Since all logs are stored as files inside /var/log/containers, we can have an agent which will be deployed as DeamonSet and read those files from each worker and send them to Logstash.
For all those who used docker-compose and similar tools, sometimes having environment files is crucial to keep docker-compose.yaml file organized and to make it easier to use and understand. When you move from docker-compose to Kubernetes you will probably search for this kind of feature. Prior to Kubernetes version 1.6, it was not possible to add environment file as a ConfigMap and just use it for container specs when needed. It is really useful when you have a lot of properties for your app and especially when you want to use it for multiple apps. So, instead of specifying each environment variable individually we can reference the whole ConfigMap.
In my previous post, I presented an easy way how to deploy Kubernetes cluster with Rancher. Kubernetes is hard to install without using third party tools, but luckily they released an official tool for simple deployment kubeadm. Please note that kubeadm is still in Alpha and not ready for production use, but it is good enough to play with on development environments. Kubernetes installation with kubeadm really simplifies deployment procedure and it is easy to use. Also, I find it very stable during my testing. kubeadm is a part of Kubernetes distribution starting with 1.4.0 release, but it does not track same release process at the moment. I’m expecting it to be ready for Kubernetes 1.6.
When it comes to Docker containers and orchestration there are a lot of available options. Almost every few months some new Docker orchestration tool is available. At least that was the case at the beginning. Most of those tools are opensource projects, but of course, there are some enterprise orchestration tools. However, Google’s Kubernetes is most used and really popular tool. Like with all Google products it is also complicated to install and manage. They recently released kubeadm Kubernetes deployment tool, but this is still in Alpha and not ready for production environments. In this post, I will show you how to deploy Kubernetes on top of Rancher which is my favorite. With Rancher, you could decide which Docker orchestration tool to use, like Cattle (Rancher), Kubernetes, Mesos or Docker Swarm.