How Kubernetes is used in Industries and what all use cases are solved by Kubernetes?
By: Shalini Rana
Tags: Case Study, Kubernetes, Neptuneai, Kubernetes Cluster, Neptune

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. 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.

Kubernetes, or K8s, is a container orchestration system. In other words, when you use Kubernetes, a container based application can be deployed, scaled, and managed automatically.

The objective of Kubernetes is to abstract away the complexity of managing a fleet of containers that represent packaged applications and include everything needed to run wherever they’re provisioned. By interacting with the Kubernetes REST API, you can describe the desired state of your application, and Kubernetes does whatever is necessary to make the infrastructure conform. It deploys groups of containers, replicates them, redeploys if some of them fail, and so on.

Because it’s open source, a k8s cluster can run almost anywhere, and the major public cloud providers all provide easy ways to consume this technology. Private clouds based on OpenStack can also run Kubernetes, and bare metal servers can be leveraged as worker nodes for it. So if you describe your application with Kubernetes building blocks, you’ll then be able to deploy it within VMs or bare metal servers, on public or private clouds.

Let’s take a look at the basics of how Kubernetes works so that you will have a solid foundation to dive deeper.

Kubernetes architecture:

📝The Kubernetes architecture is relatively simple. You never interact directly with the nodes hosting your application, but only with the control plane, which presents an API and is in charge of scheduling and replicating groups of containers named Pods. Kubectl is the command line interface you can use to interact with the API to share the desired application state or gather detailed information on the infrastructure’s current state.

Let’s look at the various pieces.

Nodes

✍Each node that hosts part of your distributed application does so by leveraging Docker or a similar container technology, such as Rocket from CoreOS. The nodes also run two additional pieces of software: kube-proxy, which gives access to your running app, and kubelet, which receives commands from the k8s control plane. Nodes can also run flannel, an etcd backed network fabric for containers.

Master

✍The control plane itself runs the API server (kube-apiserver), the scheduler (kube-scheduler), the controller manager (kube-controller-manager) and etcd, a highly available key-value store for shared configuration and service discovery implementing the Raft consensus Algorithm.

Now let’s look at some of the terminology you might run into.

Kubernetes Terminology:

📝Kubernetes has its own vocabulary which, once you get used to it, gives you some sense of how things are organized. These terms include:

Pods : Pods are a group of one or more containers, their shared storage, and options about how to run them. Each pod gets its own IP address.

: Pods are a group of one or more containers, their shared storage, and options about how to run them. Each pod gets its own IP address. Labels : Labels are key/value pairs that Kubernetes attaches to any objects, such as pods, Replication Controllers, Endpoints, and so on.

: Labels are key/value pairs that Kubernetes attaches to any objects, such as pods, Replication Controllers, Endpoints, and so on. Annotations : Annotations are key/value pairs used to store arbitrary non-query able metadata.

: Annotations are key/value pairs used to store arbitrary non-query able metadata. Services : Services are an abstraction, defining a logical set of Pods and a policy by which to access them over the network.

: Services are an abstraction, defining a logical set of Pods and a policy by which to access them over the network. Replication Controller : Replication controllers ensure that a specific number of pod replicas are running at any one time.

: Replication controllers ensure that a specific number of pod replicas are running at any one time. Secrets : Secrets hold sensitive information such as passwords, TLS certificates, OAuth tokens, and ssh keys.

: Secrets hold sensitive information such as passwords, TLS certificates, OAuth tokens, and ssh keys. ConfigMap: ConfigMaps are mechanisms used to inject containers with configuration data while keeping containers agnostic of Kubernetes itself.

What can you do with Kubernetes?

📝The primary advantage of using Kubernetes in your environment, especially if you are optimizing app dev for the cloud, is that it gives you the platform to schedule and run containers on clusters of physical or virtual machines (VMs).

More broadly, it helps you fully implement and rely on a container-based infrastructure in production environments. And because Kubernetes is all about automation of operational tasks, you can do many of the same things other application platforms or management systems let you do — but for your containers.

Developers can also create cloud-native apps with Kubernetes as a runtime platform by using Kubernetes patterns. Patterns are the tools a Kubernetes developer needs to build container-based applications and services.

With Kubernetes you can:

Orchestrate containers across multiple hosts.

Make better use of hardware to maximize resources needed to run your enterprise apps.

Control and automate application deployments and updates.

Mount and add storage to run stateful apps.

Scale containerized applications and their resources on the fly.

Declaratively manage services , which guarantees the deployed applications are always running the way you intended them to run.

, which guarantees the deployed applications are always running the way you intended them to run. Health-check and self-heal your apps with autoplacement, autorestart, autoreplication, and autoscaling.

However, Kubernetes relies on other projects to fully provide these orchestrated services. With the addition of other open source projects, you can fully realize the power of Kubernetes. These necessary pieces include (among others):

Registry, through projects like Docker Registry.

Networking, through projects like OpenvSwitch and intelligent edge routing.

Telemetry, through projects such as Kibana, Hawkular, and Elastic.

Security, through projects like LDAP, SELinux, RBAC, and OAUTH with multitenancy layers.

layers. Automation, with the addition of Ansible playbooks for installation and cluster life cycle management.

Services, through a rich catalog of popular app patterns.

Why do you need Kubernetes?

📝Kubernetes can help you deliver and manage containerized, legacy, and cloud-native apps, as well as those being refactored into microservices.

In order to meet changing business needs, your development team needs to be able to rapidly build new applications and services. Cloud-native development starts with microservices in containers, which enables faster development and makes it easier to transform and optimize existing applications.

Production apps span multiple containers, and those containers must be deployed across multiple server hosts. Kubernetes gives you the orchestration and management capabilities required to deploy containers, at scale, for these workloads.

Kubernetes orchestration allows you to build application services that span multiple containers, schedule those containers across a cluster, scale those containers, and manage the health of those containers over time. With Kubernetes you can take effective steps toward better IT security.

Kubernetes also needs to integrate with networking, storage, security, telemetry, and other services to provide a comprehensive container infrastructure.

Once you scale this to a production environment and multiple applications, it's clear that you need multiple, colocated containers working together to deliver the individual services.

Linux containers give your microservice-based apps an ideal application deployment unit and self-contained execution environment. And microservices in containers make it easier to orchestrate services, including storage, networking, and security.

This significantly multiplies the number of containers in your environment, and as those containers accumulate, the complexity also grows.

Kubernetes fixes a lot of common problems with container proliferation by sorting containers together into "pods." Pods add a layer of abstraction to grouped containers, which helps you schedule workloads and provide necessary services—like networking and storage—to those containers.

Other parts of Kubernetes help you balance loads across these pods and ensure you have the right number of containers running to support your workloads.

With the right implementation of Kubernetes—and with the help of other open source projects like Open vSwitch, OAuth, and SELinux you can orchestrate all parts of your container infrastructure.

Kubernetes Use Case Study:

About the Client

✍Neptune is a cloud-native data science lab that enables individuals and teams of data scientists to run multiple experiments simultaneously, thus shortening the time required to achieve their results. It also gives them the ability to collaborate, share results and manage the model training process.

Originally built by CodiLime, Neptune is currently being developed by CodiLime spin-off, Neptune Labs, Inc.

Challenge

✍Data scientists are currently in high demand as more and more companies uses machine learning to support their businesses. Most of them are more scientists or mathematicians than engineers, and handling infrastructure is usually outside of their comfort zone. The business challenge here was to make their work as painless as possible.

This goal needed to be addressed, taking into account also another challenge. The need for computing power varies greatly between different machine learning projects, and even within a single project, the requirements for the number of GPUs can rapidly change.

Results & benefits

✍We decided to use Kubernetes as a layer of abstraction that separates data scientists from the low-level infrastructure problems. Moreover, Neptune delivers a tailor-made autoscaling solution that is faster than those available off the shelf. It uses Kubernetes to smoothly handle the fluctuating amount of resources. As a result, users are presented with a cost-effective platform that fits their needs.

The benefits of the solution include:

It accommodates computing-heavy data experiments.

It offers flexible infrastructure management: on-demandscaling on the Kubernetes cluster.

GPUs are provisioned on demand only.

It has a cloud-native design.

Neptune’s usage statistics:

Solution

✍Neptune runs on Kubernetes and uses Helm templates to reduce the time needed to run new machines and start an experiment. The underlying Kubernetes cluster smoothest the process of establishing and closing experiment containers. At the same time, by leveraging MooseFS (a distributed filesystem), Neptune ensures that all containers share access to the training dataset, making additional storage for every machine unnecessary. Finally, Kubernetes makes Neptune infrastructure-agnostic, so it can be established in either a private or public cloud. Neptune can be run on a laptop, using cloud resources, or on a bare-metal infrastructure.

Thank You for Reading the Article. 😊🤗