My Kubernetes Experience: A Beginner’s Guide

Safe
5 min readMay 31, 2023

--

You know, Kubernetes (K8s) really isn’t so scary
For a while now, I always just turned away from anything that wasn’t directly related to front-end. I have so many DevOps engineers around me so I would constantly hear them use these terms that sounded like normal English, like secrets, containers, pods, etc but in reality were something entirely different.
Because of my project on Outreachy, I decided to face my fears so, I went looking for Kubernetes, and voila
If at all you’re a scaredy pants like me, I’m sure you’ll find this interesting and just maybe want to take up DevOps as a new career path.
That said, here’s everything I think you should know before going deep into Kubernetes.

First things first,

Kubernetes is an open-source orchestration tool that helps you manage containerized applications in different deployment environments, it provides the ability to run dynamically scaling containerized applications and utilizes an API for management. It was developed by Google.

Kubernetes is a Greek word which means helmsman or pilot (hence the idea behind the logo)

Now let's talk about…

Containers

Containers are lightweight, isolated, and portable instances of an image that runs as a process on a host machine. When a container is created from an image, it becomes a live, running instance of that image. Each container has its own file system and runtime environment, and it operates in isolation from other containers and the host system.

An Image is a static, read-only file that serves as a template for creating containers. It contains the application code, runtime, system tools, libraries, and dependencies required to run the application.

Docker is a containerization technology that enables the creation of Linux technologies, it is a tool designed to ease creation, deployment and running of applications using containers.

Kubernetes architecture consists of;

Control Plane (Master Node) which is responsible for managing and controlling the cluster. They coordinate the overall operation of the cluster, monitor the state of nodes and containers, schedule containers onto worker nodes, and handle cluster-wide tasks such as scaling, load balancing, and service discovery. The control plane includes components like the API server, etcd for cluster data storage, controller-manager, and scheduler.

Worker Nodes are where the actual containerized applications run. They execute and manage containers, handle incoming workload requests, and communicate with the control plane. Each worker node typically runs a container runtime, such as Docker, and hosts multiple containers. Worker nodes have the necessary resources, such as CPU, memory, and storage, to execute container workloads.

K8s manages packaged applications using helm and helm charts

Helm is a package manager for Kubernetes, which simplifies the deployment and management of applications on a Kubernetes cluster. It provides a convenient way to define, install, and upgrade complex applications and services as a cohesive unit, called a “chart.”

Microservice is a software architectural pattern that aims to decompose monolithic applications into smaller, more manageable services that can be developed and deployed independently. Each microservice is responsible for a specific function or feature of the overall application

Pod is the smallest deployable unit in the Kubernetes ecosystem. It represents a group of one or more containers that are scheduled and run together on a single worker node in a Kubernetes cluster.

Replicaset allows you to define the number of pods that need to be running in a way that if a pod crashes it would be recreated to get back to the desired state.

Node refers to a physical or virtual machine that is part of a Kubernetes cluster and is responsible for running containers.

Cluster is a set of physical or virtual machines, called nodes, that are interconnected and collectively used to run containerized applications.

Minikube is a one-node cluster where the master processes and worker processes both run on one machine, with a docker container run-time pre-installed so the containers in the pods can run.

Statefulset takes care of replicating database pods, scaling them up or down as required to make sure databases synchronize so they’ll be no inconsistencies.

Kubectl command line tool for K8s, submits commands such as create, delete, etc to the API server, the worker process on Minikube then take up this command and executes it.

ConfigMap creates an external configuration to your application it contains the URL of databases or some other service that you use, so you connect it to the pod, the pod gets the data that ConfigMap contains so when you need to make adjustments, it can be effected on just your configMap and you’ll be good.

Secret- Since ConfigMap is for non-confidential data only, secrets are used to store secret data like credentials in base 64 instead of plain text. Secret components are meant to be encrypted using third-party tools that are deployed on Kubernetes since k8s doesn’t encrypt them out of the box, just like confit map you’ll connect this to the pod so it sees the data and read from it

Deployment is an abstraction on the pod, it provides a declarative way to manage and update a set of replicated pods. It enables you to define the desired state of your application and lets Kubernetes handle the details of creating, scaling, and managing the pods.

Kudos! I’m so proud of you for making it to the end, I'm sure by now you already feel like a DevOps engineer. This is the first part of a couple more articles to come so be sure to turn on your notifications, I really hope you learnt something

--

--

Safe
Safe

Written by Safe

An experienced web developer and DevOps engineer learning and experimenting with new technologies, sharing knowledge and helping beginners in the tech community

No responses yet