Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.
Kubernetes is a platform for managing containerized workloads and services. that make easy declarative configuration and automation.
Kubernetes works in a cluster, consisting of a set of worker machines, these machines are called nodes, that run containerized applications, and every cluster has at least one worker node.
Also, a Kubernetes cluster has a control plane, it manages the worker nodes and the cluster state.
These are the various components that you need to have for a complete and working Kubernetes cluster.
The components of a Kubernetes cluster by kubernetes.io
In my opinion, this section is very important, mainly if you want to have a differential in your career, and this knowledge will help me a lot in many situations to solve problems.
Sometimes we only have an interest in knowing how works the motor of a car when we have a problem on the highway and the car
The Control Plane manages the cluster state. It makes decisions about the cluster, for example, increasing the number of pod replicas or scheduling something.
The Control Plane must not run any pods
The node components are in every node of the cluster, they are responsible for maintaining the pods running and providing the Kubernetes runtime environment.
Before you follow this step, please install the Kind according to your environment
https://kind.sigs.k8s.io/docs/user/quick-start/
For this series, let's prepare an environment for you to follow the examples.
For now, let's prepare a local environment to focus only on the fundamentals at the end of the series, we will together create a Kubernetes cluster like a production environment.
There are many options to create a K8s locally
I've been using Kind and it has been serving me
Let's use the mode of Multi-node clusters
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
Basically, we're talking to Kind, "Please, create for me, a cluster with 4 machines. 1 Control Plane and 3 workers nodes"
Now, run the command in your terminal:
kind create cluster --config kind-config.yml --name programmingonmars
You should have this result below
To use your k8s cluster, run the command below
kubectl cluster-info --context kind-programmingonmars
Now we're connected in our k8s cluster!
Let's check the nodes using the command:
kubectl get nodes
This is so cool we created 3 works and 1 control plane as we declared in the kind-config.yml
Kind is a tool for running local Kubernetes clusters using Docker container "nodes". kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.
Só, if we run the command:
docker container ls
We can see 4 containers running
Now you're ready to start your new journey in the Kubernetes world, let's run a First Application on Kubernetes
Tags: k8s, infrastructure, kubernetes, devops