I have been playing around with Kubernetes and Docker for almost 2 weeks now on a self-built cluster.
It is highly scalable, and if you use it properly, it will reduce the downtime of your application significantly. However, I came along with a lot of rebuilds, issues and limitations, and would like to share in this article.
Availability of the right build for the right container image
The first thing that came into my mind when I am trying to build my own website is to find the right software to be used. Apart from functionality, there are also a lot of other considerations, especially when it comes to finding the right container image.
They both work like Linux package management software, like apt or yum.
However, finding the right software is not as easy there, you have to consider:
- Is the right software package available, with the right configuration options? Bear in mind that you may not have access to the raw configuration files (the container may construct them for you). As such, some special features may not be fully available, or the setup may not fit your infrastructure entirely.
- Is the container image available in the right operating system and architecture? I find it hard, especially using official repositories, to find images for ARM processor, which my cluster is running on.
- How is persistent storage being handled? You may need to review the image configuration options (e.g. the docker-compose file) to dig around.
- Unless you are using an official repositories or those from "verified" publisher, you may find the images that you are using out-of-date and may contain security vulnerabilities.
So, how do I mitigate the shortcomings?
Finding the right software that is fit for work is a skill that is essential to any IT managers. After all, it comes doen to the following criteria:
- What kind of function do you need?
- What is the cost?
- Does it work with the platform that you want it to run on?
- How easy is it to maintain the software in a long run?
My opinion with Kubernetes specific answer to the above are:
- There are so many commercial / open source offering available, and they often come with docker images. Try out the demo sites is essential. If a software do not even has a demo, how good can it be?
- Once you have found the top choices (often 2 or 3), check in Docker Hub to see if they are available as docker image, and whether they are maintained by the software author or a verified publisher.
- Cost is a commercial preference. For setting up my own website, I do not want to spend a dime, so open source it is. But if you want to find a reliable database with commercial support, maybe go with PostgreSQL which provides paid support options.
- Stick with a common platform in the Kubernetes cluster. For my example, I run Raspberry Pi and low cost x86-64 servers. So I have chosen Ubuntu which can work in both architecture, configurations and software repository are almost the same. It makes administration consistent.
- Eventually I may move my website to Google Cloud or AWS, so I tried to stick with containerised software as much as possible, and try to stick with standard configurations.
- I opted for the LTS branch or Ubuntu for now to avoid major OS upgrade as long as possible.
- Only try to build docker images by youself as a last resort.
The above principles does not only work with my choices in Kubernetes, but also work in general in the technology industry. After all I worked in this field for so many years and the the principles work really well so far!