An Alternative to Kubernetes

Kubernetes is an container-orchestration system which helps you to automate your deployment, scaling and management of containerized applications. Originally this platform was designed by Google and is today part of the Cloud Native Computing Foundation. Kubernetes is surely one of the major providers in the market of container operating systems.

But what many do not know, is the complexity of this platform if used in smaller projects. To understand this you need to know, that Kubernetes was designed for the operation of large cloud environments as they are operated by Google, Amazon or Microsoft.  This means that with the help of Kubernetes you can not only manage one server, but hundreds of servers with thousands of services. For most projects, this power is superfluous.

But behind the scene we are still talking simply about Docker which is the core technology of containerized applications. And Docker in its core is just a command line interface (CLI) to manage a visualization feature of the Linux Kernel named Linux control groups (cgroups). Control groups allow processes to be organized into hierarchical groups whose usage of various types of resources can then be limited and monitored. This is what we all today know as the container technology.

Docker Compose

With Docker you can build, start and monitor a containerized application with just one command line. For example, the following command starts a MySQL database:

$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql

To build and operate more complex applications consisting of different services with the help of Docker we need to bundle several containers in one place. This is called a stack and can be described in a single file. Docker-Compose is the tool to managed these stacks. In the following example you can see a stack consisting of a MySQL Database and a WordPress application.

version: '3.1'
services:
  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: your_root_password
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: "yourpassword"
  wordpress:
    depends_on:
       - mysql
    image: wordpress:4.9.8
    environment:
      WORDPRESS_DB_HOST: mysql:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: "yourpassword"

To start such a stack consisting of two containers just run:

$ docker-compose up

This is pretty simple to use. Of course you can extend the compose file with a lot of additional information and configuration parameters. You can find more information about Docker-Compose on the docker homepage.

Docker-Swarm

The second question, which comes into the game with containers, is how you can manage applications distributed on different machines. Distribution is necessary to build more robust environments which will not depend on a single point of failure – like a disk error or hardware crash.

Docker-Swarm is a build-in technology of the docker engine to archive a distribution of services and application stacks. And this is the point which is often overseen by people starting with containers and Kubernetes. Equals as Kubernetes also Docker-Swarm provides features to manage distributed applications and services. But in difference to Kubernetres, Docker-Swarm is much more simple to use and offers a lot of features and technologies:

  • Cluster management integrated with Docker Engine
  • Decentralized design
  • Declarative service model
  • Scaling
  • Desired state reconciliation
  • Multi-host networking
  • Service discovery
  • Load balancing
  • Secure by default
  • Rolling updates

All this features come out of the box if you have installed the docker engine.

Conclusion

If you are interested in container-orchestration, you must not need to start with the often oversized technology offered by Kubernetes. This is mostly true if your project did not consists of dozens or hundreds of servers. The Docker Tools are a good alternative to Kubernets and  easy to learn. Docker Tools are mostly sufficient and flexible enough for most projects – also in production. After all Docker-Compose and Docker-Swarm are easy to learn as these tools are part of the Docker core technology.

To get a more detailed insight how to build a lightweight environment with Docker-Swarm, take a look at my Open Source project Imixs Cloud on GitHub.

 

Leave a Reply

Your email address will not be published. Required fields are marked *