DEV Community

Cover image for My First Six Months With Kubernetes
Rahul Bagal
Rahul Bagal

Posted on

My First Six Months With Kubernetes

I'm a big fan of Kubernetes. In fact, I think it's one of the most exciting things happening in computing today. It has a lot to do with that. Kubernetes is an open-source container orchestration system built by Google and it allows you to manage multiple containers on a cluster of nodes. You can deploy your applications in any combination of containers: microservices or monoliths, distributed apps, or stateless services...it's all up to you! It took me several months until I started using this technology but now that I have my first few projects deployed on Kubernetes, here's what has changed for me so far

Kubernetes is a container orchestrator that automates deployment, scaling and operations of application containers.

In short: Kubernetes can be used to deploy and manage containers in production environments.

The Context

Kubernetes is an open source system for automating deployment, scaling, and management of containerized applications. It was started by Google in 2014 as a way to manage large numbers of containerized applications running on Google Cloud Platform. In 2016 it was open-sourced under the auspices of the Cloud Native Computing Foundation (CNCF).

Kubernetes makes it easy to deploy your application with minimal overhead; if you want to change something in your code or adjust how it runs in production then all you need to do is update the configuration files within kubectl (a command line tool) or make changes via a web interface like https://kube-updates/ . This means that when something goes wrong with one part of your infrastructure—for example if there’s an issue with infrastructure replication or availability—you don’t have any downtime!

Image Management

A container image is a file that contains the same code as a Dockerfile. The "Docker" part of Docker refers to its distributed nature, which makes it easy for developers to create and distribute their own images.

A Dockerfile is nothing more than a text file (with some basic syntax conventions) containing instructions for building an image from scratch. Each line in this file has one instruction that tells the computer how to build an image, such as:

Bash FROM linux:4.6 RUN apt-get update && apt-get install -y libpam0g libssl1.0 openssl /bin/sh ./configure --prefix=/usr && make && make install CMD ["/bin/bash"]

Pods and Containers

Pods and containers are the two main concepts that you need to understand when you're working with Kubernetes.

A pod is a group of one or more containers, it's similar to how we think about virtual machines in our traditional physical infrastructure. It's also an abstraction for multiple Docker processes running on the same host.

A container is kind of like a mini VM running inside another container (or sometimes directly within its own process). The main difference between a pod and a container is that while both can run multiple services or applications within them (like Nginx or MySQL), they're designed differently: pods are intended for single-purpose execution while containers are designed for multi-purpose deployment or scaling out beyond what would be possible using just one process per server instance without any other components like load balancers etcetera...

Deploying New Apps

Deploying new apps is a snap with Helm. Simply run kubectl apply and you're off to the races! If you need more control over your deployments, there's also the kubectl create command, which gives you access to all the same commands as above but lets you specify some values on their own instead of relying on Helm.

Upgrading Applications In Production

Upgrading your applications in production is a process that can be daunting for new users. We've written about this topic before, but here's a quick recap:

Rolling upgrades are when you upgrade one pod at a time. You leave all other pods running as they are, and wait until your application is fully upgraded before proceeding to the next one.

Rolling back an upgrade means restarting all pods after reverting back to an old version of Kubernetes or its underlying technology (e.g., Docker). It's not recommended because it can cause issues with dependent applications—but it will usually fix them if they're broken anyway!

Observability

With Kubernetes, you can monitor and log everything from your cluster's health to individual pods.

The most common monitoring tools are:

Prometheus—a system for collecting metrics about your application, storage infrastructure, and more

Logging—a way to add custom fields into logs so they're easier to read

Conclusion

The main takeaway from this article is:

Kubernetes is awesome. It’s open source, it can be used for cloud or bare metal deployments, and it’s easy to deploy and update using kubectl.

If you want to learn more about Kubernetes, check out the Kubernetes Blog. They have some amazing blog posts on all their products as well as guides for beginners that are written in plain English so anyone can understand them!

🤝

Top comments (0)