What is Kubernetes?

With the widespread adoption of containers among organizations, Kubernetes, the container-centric management software, has become the de facto standard to deploy and operate containerized applications. Google Cloud is the birthplace of Kubernetes — originally developed at Google and released as open source in 2014. Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open source community. Inspired by Google’s internal cluster management system, Borg, Kubernetes makes everything associated with deploying and managing your application easier. Providing automated container orchestration, Kubernetes improves your reliability and reduces the time and resources attributed to daily operations.

Test your knowledge with a hands-on lab in Google Cloud Skills Boost

Kubernetes defined

Kubernetes (sometimes shortened to K8s with the 8 standing for the number of letters between the “K” and the “s”) is an open source system to deploy, scale, and manage containerized applications anywhere.

Kubernetes automates operational tasks of container management and includes built-in commands for deploying applications, rolling out changes to your applications, scaling your applications up and down to fit changing needs, monitoring your applications, and more—making it easier to manage applications.

How Kubernetes works

As applications scale across multiple containers and servers, Kubernetes helps simplify management. It orchestrates deployments using an open source API, grouping containers into pods for scaling based on demand and resource availability. Kubernetes also automates service discovery, load balancing, and resource allocation, and monitors health to enable self-healing by restarting or replicating containers.

For enterprise developers, here’s a step-by-step breakdown of how Kubernetes works:

  • Define your application: Start by defining the desired state of your application using YAML files. These files specify the containers to run, the resources they need (CPU, memory), and how they should be exposed to the network.
  • Send request to Kubernetes API: You submit these YAML files to the Kubernetes API, typically using the kubectl command-line tool.
  • Scheduler assigns pods to nodes: The Kubernetes scheduler analyzes your application's requirements and finds the best nodes in the cluster to run your containers (packaged as pods).
  • Kubelet launches containers: On each node, a Kubelet process receives instructions from the control plane and launches the containers.
  • Services expose applications: Kubernetes Services provide a stable IP address and DNS name for your application, allowing other applications to access it, even as pods are created, destroyed, and rescheduled.
  • Controllers ensure desired state: Kubernetes controllers continuously monitor the state of your application and take corrective action if needed. For example, if a pod crashes, the controller will automatically create a new one to replace it.
  • Scaling and updates: You can easily scale your application by updating the number of replicas in your deployment configuration. Kubernetes will automatically create or remove pods to match the desired scale. Rolling updates allow you to deploy new versions of your application without downtime.

What are the benefits of Kubernetes?

 Automated operations

Kubernetes has built-in commands to handle a lot of the heavy lifting that goes into application management, allowing you to automate day-to-day operations. You can make sure applications are always running the way you intended them to run.

Infrastructure abstraction

When you install Kubernetes, it handles the compute, networking, and storage on behalf of your workloads. This allows developers to focus on applications and not worry about the underlying environment.

Service health monitoring

Kubernetes continuously runs health checks against your services, restarting containers that fail, or have stalled, and only making available services to users when it has confirmed they are running.

Optimized resource utilization

By efficiently packing containers onto nodes based on their requirements, Kubernetes optimizes resource utilization. This, in turn, helps to reduce wasted resources and lower infrastructure costs.

Simplified application management

Streamlines application management with Kubernetes. Kubernetes offers a uniform approach to deploying, updating, and managing applications of varying complexities.

Enhanced portability

Kubernetes is an open-source platform that runs consistently across diverse environments, from on-premises data centers to public clouds, providing enterprises with flexibility and portability.

Solve your business challenges with Google Cloud

New customers get $300 in free credits to spend on Google Cloud.
Talk to a Google Cloud sales specialist to discuss your unique challenge in more detail.

Kubernetes versus Docker

Often misunderstood as a choice between one or the other, Kubernetes and Docker are different yet complementary technologies for running containerized applications. 

Docker lets you put everything you need to run your application into a box that can be stored and opened when and where it is required. Once you start boxing up your applications, you need a way to manage them; and that's what Kubernetes does.

Kubernetes is a Greek word meaning  ‘captain’ in English. Like the captain is responsible for the safe journey of the ship in the seas, Kubernetes is responsible for carrying and delivering those boxes safely to locations where they can be used.

  • Kubernetes can be used with or without Docker
  • Docker is not an alternative to Kubernetes, so it’s less of a “Kubernetes vs. Docker” question. It’s about using Kubernetes with Docker to containerize your applications and run them at scale
  • The difference between Docker and Kubernetes relates to the role each play in containerizing and running your applications
  • Docker is an open industry standard for packaging and distributing applications in containers
  • Kubernetes uses Docker to deploy, manage, and scale containerized applications

Common Kubernetes use cases

Kubernetes is used to create applications that are easy to manage and deploy anywhere. When available as a managed service, Kubernetes offers you a range of solutions to meet your needs. Here are some common use cases.

Increasing development velocity

Kubernetes helps you to build cloud-native microservices-based apps. It also supports containerization of existing apps, thereby becoming the foundation of application modernization and letting you develop apps faster.

  • Example: A financial services company uses Kubernetes to deploy microservices for its online banking platform, enabling faster development cycles and improved scalability.

Deploying applications anywhere

Kubernetes is built to be used anywhere, allowing you to run your applications across on-site deployments and public clouds; as well as hybrid deployments in between. So you can run your applications where you need them.

  • Example: A global ecommerce company uses Kubernetes to deploy its application across multiple cloud providers, ensuring high availability and avoiding vendor lock-in.

Running efficient services

Kubernetes can automatically adjust the size of a cluster required to run a service. This enables you to automatically scale your applications, up and down, based on the demand and run them efficiently.

  • Example: A media streaming service uses Kubernetes to automatically scale its video encoding infrastructure based on the number of users watching content, optimizing resource utilization, and reducing costs.

FAQs

Explore these commonly asked questions about Kubernetes

A Kubernetes cluster consists of nodes (virtual or physical machines) running containerized applications orchestrated by Kubernetes.

A Kubernetes pod, the smallest deployable unit, houses one or more containers, representing a single running process instance.

A Kubernetes deployment ensures the desired application state by managing replicas and smooth updates.

A Service is a Kubernetes object that provides a stable IP address and DNS name for your application, allowing other applications to access it.

You can scale your application by updating the number of replicas in your deployment configuration. Kubernetes will automatically create or remove pods to match the desired scale.

Take the next step

Start building on Google Cloud with $300 in free credits and 20+ always free products.

Google Cloud