Containers & Kubernetes

Overarching Project


At the time of writing these materials, it is still very common to use Docker Compose for local development and Kubernetes for production. This is because Docker Compose is easier to use and faster to start, while Kubernetes is considerably more complex to set up.

It is important to mention, however, that there are also plenty of production deployments that use Docker Compose. Kubernetes is not a silver bullet, and whether it is suitable for the project should be evaluated on a case-by-case basis.

There are increasingly also tools that make development with Kubernetes easier, such as Skaffold. The developer experience with Kubernetes is still, however, quite far from that of Docker Compose.

As we have built much of our overarching project with Docker Compose, let’s continue with it. For deployment with Kubernetes, the key would be to define the Kubernetes resources for the services we have in the Docker Compose file, and change some of the services to use Kubernetes-specific resources like specific operators.

As an example, we could change the PostgreSQL database to use an operator instead of a plain container — the similar would be done also for Redis.

For an existing project built with Docker Compose, we could also use a tool like Kompose. Kompose can automate some of the work that focuses on creating Kubernetes configurations out of a Docker Compose file. It does not work perfectly, however, so some manual work would be needed.

Loading Exercise...