CodeDude

Logo

Kubernetes

It could be weird to start this category with Kubernetes because probably you think Kubernetes is for the DevOps people, but if you are a full-stack developer, probably you are interested in DevOps. Kubernetes is used by many developers to orchestrate containers and deploy applications. This post assumes that the reader has knowledge about containers, Docker, or Podman.

Introduction.

We have tools to create and maintain containers like Docker or Podman. These allow us to keep the application isolated in the same system. They avoid the classic “This works on my side” situation. For software development this is enough, but what about when we want to deploy containers? Of course we can deploy containers. Actually, we could create images and commit them in some repository so we can deploy Docker/Podman containers to our server and expose the application. But What about if you need to handle those containers in several servers, probably tens, hundreds, or thousands of servers? What about if one of them failed?

What’s Kubernetes?

Kubernetes, also known as K8s is an open-source container orchestration system for automating software deployment, scaling, and management. Originally designed by Google, the project is now maintained by a worldwide community of contributors, and the trademark is held by the Cloud Native Computing Foundation. Wikipedia.

So Kubernetes gives us the possibility to handle several containers through several nodes, getting high availability and removing downtime. The way that Kubernetes ensures high availability is by creating replicas of the applications. So you can have several copies of your application and its environment; if a copy fails, Kubernetes will send the traffic to another copy. So the final user never notices when the application fails. Kubernetes ensures the scalability by sending the traffic to different copies of your application. So if your application receives more traffic, you can increase the number of replicas.

Architecture.

Kubernetes has two groups of daemons: master and nodes.

Master

This group contains the following daemons: kube-apiserver, kube-controller-manager, and kube-scheduler (we will name them as API Server, Controller Manager, and Scheduler).

Nodes

This group contains the following daemons: kublet and kube-proxy.

Important concepts.

In addition to the concepts that we read in the Architecture section being important, there are other important ones.

Manifest and Deployments

When we are working with Docker or Podman, we can create images using the docker/podman command. But we have the alternative to create a Dockerfile. Same situation with containers; we could create them using Docker commands but also with a YAML file named docker-compose.yml. With manifest YAML files, we can create deployments instead of creating them with the kubectl command. In a future post I will explain how to create a manifest.

Bibliography.