Posts

Pods to Deployments | Kubernetes Architecture Evolution

When I was learning the basic kubernetes concepts, I was confused between pods, replicasets, and deployments. Each one seemed to have the other inside of it. I remained confused for a long time. I kept trying to avoid the topic. When I actually understood, it felt great. I do not want you to have that confusion when you are learning these concepts. That is why I created this post. Manifest files As we talked about in our previous post, to access your cluster, you use a tool called kubectl . While you can execute commands to deploy and manage resources, there is a better way of doing it. As you must know if you have read my posts about docker compose , Infrastructure As Code is often more efficient and easier to manage when compared to traditional CLI tools. This is why kubernetes also supports infrastructure as code. It is written in yaml. Those files are called kubernetes manifest files. It is best practice to use them. That is why we are going to be using them here. Step 1: Deploying

Installing Your Kubernetes Cluster: A Comprehensive Guide

 Kubernetes is a difficult concept to learn. It has so many moving parts. But as we all know, the best way to learn a difficult concept is to practice it. It is no different for kubernetes. For that, we need a kubernetes cluster. The problem is, kubernetes is such a complicated tool that even installing it is very difficult. I will guide you through it here. What will we do? Before we do something, I like outlining what exactly we will accomplish in this blog post. We are going to install a tool called kubeadm.. What is kubeadm? If you have ever tried to install kubernetes the traditional way, you will know that the process is extremely complicated and error-prone. You will also do a lot of very complicated configuration configuration, install tools with very specific steps, and make everything work together perfectly. That is extremely difficult. This is why, over the years, there have been many other tools created to aid in this process. One of the most popular is kubeadm. How does k

Docker Compose Explained: Simplifying Multi-Container Deployments

Docker compose and other IaC (Infrastructure as Code) tools are very important to learn. Today, they are almost essential knowledge to manage any sort of infrastructure, anywhere. Docker Compose is one of the most prominent tools in this space. According to Stackshare, at the time of writing, there are about 2108 companies using docker compose in their tech stack. This includes giant companies like Udemy. The knowledge of this relatively simple tool is very important. That is why I am going to break it down for you here. What is Docker Compose As mentioned before, Docker Compose is an IaC tool for Docker containers. It makes it significantly easier to deploy and manage containers in an environment with several containers. Why Docker Compose Now that you know what docker compose is, let's talk about why somebody would need such a tool. What benefits does it provide? Simplifies Deployment: Docker compose simplifies deployment. Once you have the IaC template in place, you can deploy a

Persistent Data in Docker: Explanation + Hands-On Demo

Docker containers, by nature, are ephemeral. They are not designed to stay without being deleted for long periods of time. While you could, theoretically never delete the image, most of the benefits of docker are realized when containers are temporary. There is something wrong with this approach, though. Almost all the data in the world is designed to be persistent. This poses a problem that docker volumes can solve. What are docker volumes? Docker volumes are a method of ensuring data persistence in a containerized environment. To comply with best practices, you need to make sure that spontaneously losing a container or 2 does not have an impact on anything but the performance of your infrastructure. To do this, all the important data in your containers needs to be put somewhere. Somewhere which is not liked to the life-cycle of the container itself. That somewhere is a volume. A docker volume is little more than a place to store data. From the point of view of the container, nothing

Hands-on docker: Deploying Your First Containerized App

This post and all of it's content has been written with the assumption that you are familiar with basic Docker concepts. If you are not, or just need a review of the topic, please click here. Once you have learnt the basics of docker, I am sure you want to implement you knowledge, right? I certainly know I was. I believe the best way to learn is by doing. So let's learn Docker in the most effective way we can, by using it. ALL THE COMMANDS IN THIS WALK-THROUGH NEED TO BE RUN WITH ADMIN PRIVILEGES The first step in this process is to install docker. I am assuming you do not have docker installed. If you do, you can skip this part. The docker installation steps are quite complex and differ for every OS. You will find several OS-specific guides to install docker if you look for them. There is actually an installation guide on the docker website itself. Here is the link to it https://docs.docker.com/engine/install/ . Before we create the container, we need the image. To create the

Introduction to Docker: A Guide to Containerization

Docker, at its core, is quite basic. It is a containerization engine. But what is containerization? Containerization performs the same basic function as virtualization. It creates several virtual computers inside a single computer or server. What makes containerization different from virtualization is that it is crazy fast. Like, insanely fast. When you are provisioning a virtual machine, you might expect it to take about 5-10 minutes assuming it is an OS designed to be very light-weight. A container, on the other hand, can provision an Ubuntu server in mere seconds! That is INSANE! I am sure you are wondering "How does Docker achieve that much performance?". Here is the secret to Docker's superpowers. When you create a VM, you are recreating the whole OS including the kernel. That is very resource intensive, and therefore, takes a lot of time. Docker simply shares the kernel with the host. As you would expect, though, this comes with quite a few drawbacks. As stated befo

Demystifying Docker Networking: A Clear Guide

Docker containers are great! Nobody can deny that, right? When you have used docker, have you ever wondered how the networking works behind the scenes. Usually, you just create a container and it magically has access to all the networking, but what is really happening behind the scenes? Did you know you can actually configure this networking?! Not only that, there are SIX ways you can do it!!! Isn't that insane?! Let's see what those six ways are. Intro to Docker Networking Docker networking is insane, but at the most basic level, it works like this. Each container has is in a docker network. Each network has a network driver. This is basically a networking type. There are several drivers you can pick from. That is what we are going to cover here shortly. Bridge The first network driver is bridge. This is the most basic driver. This is what you have been using without realizing. Each time you create a docker container and don't specify the network, it goes into something ca

Kubernetes 101: A Beginner's Guide

Kubernetes is a very important tool. Cloud Native Computing Foundation estimates that Kubernetes has a 96% market share in the container orchestration space. According to a Flexera study, 78% of small and medium sized businesses use Kubernetes. This is why learning kubernetes is imperative today. Here is a guide to the basics of Kubernetes. What is Kubernetes? Kubernetes is a container orchestration service. But that doesn't mean much, does it? Here is a more practical example. Imagine you are a server admin. you have 1 server to manage with 1 docker container. Your job is to make sure they are up. Sounds easy enough, right? Now, imagine you have 100 different containers to manage. You have to make sure they scale properly, mitigate and properly respond to failure, manage security, make updates, and do all that across all the containers. Now, let's say you had to do that across 100 servers. Sounds like a nightmare, right? Now consider that several companies run at a way bigger

Hands-On Docker Compose Guide

In a world where it is not uncommon for companies to have millions of containers, simply managing them through the docker CLI will not suffice. We need a tool that can help us manage chunks of containers and define them in a human-readable format. That is exactly what docker compose does. Basics At the most basic level, docker compose uses code to manage your infrastructure. This code is written in yaml format. The file that the code is written in is called docker-compose.yaml . Here is a basic docker-compose.yaml file: version : ' 3.8 ' services : service1 : image : nginx:alpine ports : - " 80:80 " service2 : image : alpine networks : mynetwork : As you can see, the structure of the file is quite basic. Let's go through everything 1 by 1. version : This specifies the version of docker compose in use by the file. services : This specifies the services that the file defines. Each service is, essentially, just the definition for a con