DEV Community

Cover image for Basic kubernetes
Israel-Lopes
Israel-Lopes

Posted on • Updated on

Basic kubernetes

Kubernetes is a container orchestrator. Seeing the need for high scalability, kubernetes sees itself necessary, imagine the situation of having to manage many docker containers, kubernetes does it for you.

Configmap

Configmap is a file that injects configuration data into the container.

Basically, configmap is a single configuration file for more than one container, making it easier for you not to have the need to configure containers one by one.

Secrets

The secret saves password in kubernetes and retrieves it inside the container.

Load Balancer

Load balancer and a load balancer. It balances the load level between the containers so they don't get overloaded.

Service Discovery

Service discovery has a record of all containers and together with the load balance it delegates to which container the mass of data will go, its priority and the container that is healthier.

POD

POD is a unit, a wrapper that seals a container, ie the POD it wraps a container and seals it. By default a POD will always have a container inside, but there may be exceptional cases where you have more than one container inside a POD, but this is not advisable.

The POD it checks if the container is with enough quality to run the container.

Image description

ReplicaSet

The replicaset monitors the number of POds that are in the air at all times.

The replicaSet can be configured for example to run two PODs at all times, if a POD dies, the replicaSet will replicate that POD again from scratch.

The replicaSet also stores the container version.

Image description

Deployment

On top of the replicaSet we have the deployment. The deployment it guarantees that it can generate a new version, it also guarantees the replicaSet, it has the replicaSet inside that guarantees the amount of replica PODs.

Image description

Service

Image description

The service makes it possible for other people or systems to access the deployment, thereby accessing the PODs. It is external to the deployment.

In the service, a configuration is made from a label called selector.

An example of this is that the selector can be called app:front or app:back. That way we can diversify the selector for a front end or back end application for example.

NOTE: Each deployment will have its service.

Using the service, there are a few possibilities:

  • Generate an internal ip.
  • Generate an external ip, for external access.
  • Provide a door.

Round-robin is a randomization algorithm that works in conjunction with service.

Running local kubernetes with kind

Kind simulates a Kubernetes cluster using

auxiliary material

Texto alternativo da imagem)

Top comments (2)

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

Question: Why is it not advisable to have more than one container per pod? For example, Microsoft recommends using a second container to include their dotnet-monitor HTTP server.

Collapse
 
israellopes profile image
Israel-Lopes

Having multiple containers in a pod can make it more difficult for developers to manage and orchestrate those containers, and can lead to scalability and availability issues.
In the example you mentioned, Microsoft is suggesting using a second container to include their dotnet-monitor HTTP server.