A Brief Overview of Important Kubernetes Concepts

Posted By : Ankit Gupta | 01-Sep-2020

This blog post provides a brief overview of important Kubernetes concepts. To begin to understand the usefulness of Kubernetes, we have to first understand two concepts: immutable infrastructure and containers.

 

Immutable infrastructure is a practice where servers, once deployed, were never modified. If something needs to be changed, you never do so directly on the server.

 

Containers offer a way to package code, runtime, system tools, system libraries, and configs altogether. This shipment is a lightweight, standalone executable. This way, your application will behave the same every time no matter where it runs (e.g, Ubuntu, Windows, etc.). Containerization is not a new concept, but it has gained immense popularity with the rise of microservices and Docker

 

Armed with those concepts, we can now define Kubernetes as a container or microservice platform that orchestrates computing, networking, and storage infrastructure workloads. Because it doesn’t limit the types of apps you can deploy , Kubernetes extends how we scale containerized applications so that we can enjoy all the benefits of a truly immutable infrastructure. The general rule of thumb for K8S: if your app fits in a container, Kubernetes will deploy it.

By the way, if you’re wondering where the name “Kubernetes” came from, it is a Greek word, meaning helmsman or pilot. The abbreviation K8s is derived by replacing the 8 letters of “ubernete” with the digit 8.

The Kubernetes Project was open-sourced by Google in 2014 after using it to run production workloads at scale for more than a decade. Kubernetes provides the ability to run dynamically scaling, containerised applications, and utilising an API for management. Kubernetes is a container management tool, minifying cloud computing costs whilst simplifying the running of resilient and scalable applications.

Kubernetes has become the standard for running containerised applications in the cloud, with the main Cloud Providers (AWS, Azure, GCE, IBM and Oracle) now offering managed Kubernetes services

Kubernetes Basic Terms and Definitions

Basic K8S objects and several higher-level abstractions is known as controllers. These are the building block of your application lifecycle.

Basic objects include:

  • Pod: A group of one or more containers
  • Service: An abstraction that defines a logical set of pods as well as the policy for accessing them
  • Volume: An abstraction that lets us persist data. (This is necessary because containers are ephemeral—meaning data is deleted when the container is deleted)
  • Namespace: A segment of the cluster dedicated to a certain purpose, for example a certain project or team of devs

 

Controllers, or higher-level abstractions, include:

  • ReplicaSet (RS). Ensures the desired amount of pod is what’s running.
  • Deployment. Offers declarative updates for pods an RS.
  • StatefulSet. A workload API object that manages stateful applications, such as databases.
  • DaemonSet. Ensures that all or some worker nodes run a copy of a pod. This is useful for daemon applications like Fluentd.
  • Job. Creates one or more pods, runs a certain task(s) to completion, then deletes the pod(s).

Micro Service

A specific part of a previously monolithic application. A micro-service based architecture would have multiple services making up one, or more, end products. Micro services are typically shared between applications and makes the task of Continuous Integration and Continuous Delivery easier to manage. Explore the difference between monolithic and microservices architecture.

Images

Typically a docker container image – an executable image containing everything you need to run your application; application code, libraries, a runtime, environment variables and configuration files. At runtime, a container image becomes a container which runs everything that is packaged into that image.

Pods

A single or group of containers that share network and storage with a Kubernetes configuration, telling those containers how to behave. Pods share IP and port address space and can communicate with each other over localhost networking. Each pod is assigned an IP address on which it can be accessed by other pods within a cluster. Applications within a pod have access to shared volumes – helpful for when you need data to persist beyond the lifetime of a pod. Learn more about Kubernetes Pods.

Namespaces

Namespaces are a way to create multiple virtual Kubernetes clusters within a single cluster. Namespaces are normally used for wide scale deployments where there are many users, teams and projects.

Replica Set

A Kubernetes replica set ensures that the specified number of pods in a replica set are running at all times. If one pod dies or crashes, the replica set configuration will ensure a new one is created in its place. You would normally use a Deployment to manage this in place of a Replica Set. Learn more about Kubernetes ReplicaSets.

Deployments

A way to define the desired state of pods or a replica set. Deployments used to define HA policies to your containers by defining policies around how many of each container must be running at any one time.

Services

Coupling of a set of pods to a policy by which to access them. Services are used to expose containerised applications to origins from outside the cluster. Learn more about Kubernetes Services.

Nodes

A (normally) Virtual host(s) on which containers or pods are run.

Kubernetes architecture and components

A kubernetes cluster is made of a master node, which exposes the API, schedules deployments, and generally manages the cluster. Multiple worker nodes can be responsible for container runtime, like Docker or rkt, along with an agent that communicates with the master.

Master components

These master components comprise a master node:

  • Kube-apiserver. Exposes the API
  • Etcd. Key value stores all cluster data. (Can be run on the same server as a master node or on a dedicated cluster)
  • Kube-scheduler. Schedules new pods on worker nodes
  • Kube-controller-manager. Runs the controllers
  • Cloud-controller-manager. Talks to cloud providers

Node components

  • Kubelet. Agent that ensures containers in a pod are running
  • Kube-proxy. Keeps network rules and perform forwarding
  • Container runtime. Runs containers

 

We are a seasoned DevOps service provider company that specializes in using Kubernetes K8s Engine to facilitate seamless deployment, scaling, scheduling, and operation of app containers in private, cloud, or hybrid environments. Our DevOps solutions and services enable enterprises to accelerate their software development lifecycle and and achieve efficiency with continuous deployment and continuous delivery. Our DevOps service providers use agile methodologies to enhance enterprise productivity and streamline IT operations. 

About Author

Author Image
Ankit Gupta

Ankit is a Redhat Certified System Administrator and Redhat Certified Engineer. He is interested in learning new DevOps tools . He likes Linux, DevOps , Automation & Cloud Computing. He always try to complete the assigned tasks within in the given time.

Request for Proposal

Name is required

Comment is required

Sending message..