Using Kubernetes for your deployments

 

What is Kubernetes

Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.
The name Kubernetes originates from Greek, meaning helmsman or pilot. K8s as an abbreviation results from counting the eight letters between the “K” and the “s”. Google open-sourced the Kubernetes project in 2014. Kubernetes combines over 15 years of Google’s experience running production workloads at scale with best-of-breed ideas and practices from the community.

Why K8s

There are certain benefits in deploying the docker images in K8s, compared to traditional deployments in physical machines or on VMs. Here are some of the main benefits for deployment, including:

  • Scale up/down β€” Automatically or manually
  • HA, Service discovery and load balancing
  • Better resource utilization
  • Self healing
  • Immutable infrastructure
  • Velocity

As this blog is more targeted at providing a practical, hands-on experiment, I am not going to delve into the above topics. (That’s how you say I’m not lazy) πŸ™‚ . But I strongly suggest you read and explore these topics to understand the benefits as well as the challenges that are involved. This article[5] is about providing some detailed information on the benefits of using Kubernetes.

Components in K8s

  • Cluster β€” A set of worker machines, called nodes that run containerized applications. Every cluster has at least one worker node.
  • Node β€” A node is a worker machine in Kubernetes.
  • Namespace β€” An abstraction used by Kubernetes to support multiple virtual clusters on the same physical cluster.
  • Pod β€” The smallest and simplest Kubernetes object. A Pod represents a set of running containers on your cluster.
  • ReplicaSet β€” A ReplicaSet (aims to) maintain a set of replica Pods running at any given time.
  • Service β€” An abstract way to expose an application running on a set of Pods as a network service.
  • Deployment β€” An API object that manages a replicated application.
  • Controller β€” In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed.
  • Each controller tries to move the current cluster state closer to the desired state.