Kubernetes: As Simple as Possible

Kubernetes: As Simple as Possible

Learn the concepts of Kubernetes without worrying about documentation jargon.

What is Kubernetes? ☸️

“Kubernetes is an open-source container-orchestration system for automating computer application deployment, scaling, and management.”

When I first read that explanation, I could not understand a word. If you can’t either, then don’t worry, you’re not alone.

Kubernetes (or k8s) is a platform that automatically manages your application which is usually split into micro-services in the form of containers. Kubernetes provides the necessary resources needed to run these containers with the help of Load Balancing, Heartbeat Monitors, Horizontal and Vertical Scaling, Automated Rollout, and several other features.

Usually, you would have to deploy your application on a server, and when you eventually have more people using your service, it would be a hassle to scale your application since you would have to do everything manually. With k8s, most of the difficult manual aspects are now automated.

Control Plane.png

Simplifying the important k8s jargon

Cluster

Clusters consist of the entire k8s architecture, essentially it is a series of nodes connected together.

Pod

A pod holds one or more container(s). Pods are the simplest unit that exists within Kubernetes.

Node

Nodes are the hardware components. They can be Physical Servers or Virtual Machines. Each node will automatically assign pods to itself based on resource availability.

Deployment

A deployment is a set of rules that state how the container must be run in the cluster. Some of the important things specified in deployments are :

  1. Replicas: Defines the number of replicas to be made for the container.
  2. Image: Specifies the container image to be used, this is updated in future deployments.
  3. ImagePullPolicy: Specifies how often a container image is pulled from the container registry.

Service

This is an object that specifies how a deployment or another resource can be accessed.

There are 4 different types of Services, (ServiceTypes):

  1. ClusterIP: Allocates a cluster IP (internal IP) to a resource and doesn’t allow external access. This is the default configuration.
  2. NodePort: Allocates a static port for the service on all the Nodes. You can either specify this or let k8s pick one for you. The range of ports is 30000–32767.
  3. LoadBalancer: Creates an External Load Balancer on the cloud platform that k8s is running ( GCP, AWS, etc. ), and this allows external access to the service.
  4. ExternalName: Instead of using k8s selectors, it uses domain names instead.

More info on these types can be found here.

Benefits of k8s

  1. Automatic Load Balancing: Kubernetes automatically balances the incoming load to the micro-service by spreading it out across nodes so that a single node doesn’t handle all the requests.
  2. Self-Healing: When a container fails, k8s automatically procures a new pod to provide failover with minimum possible downtime.
  3. Automated Rollout and Rollbacks: When a new release needs to be deployed, k8s can rollout this release while keeping the service running without downtime. Similarly, it can provide support for rolling back to a previous release.
  4. Secrets and ConfigMaps: These are additional configurations where you can store sensitive data like API keys, OAuth keys, passwords, etc. These can then be made available to the containers. When any update needs to be done to this data, you can do so without having to rebuild the containers.

Drawbacks

  1. Quite unnecessary for small applications: When starting with a new app that doesn’t necessarily have that much traffic, Kubernetes is an extra hassle for the developers.
  2. Migrating to k8s is painstaking: Existing software will have to be modified to accommodate the k8s architecture.
  3. Expensive: Due to all the automated features that it provides, the costs of running a k8s cluster can add up quickly.

Conclusion

With all that being said, Kubernetes is a wonderful tool that will shape the landscape of the technology world soon, and we will see a shift towards k8s from less automated application setups.

Check out my Youtube video on the same topic ❤️

Check out my Twitter