Kubernetes is a portable, extensible system for running and coordinating containerized workloads and services across a cluster of machines. It is designed to manage the life cycle of containerized applications with the guarantee of stability, scalability, and high availability.

The following picture shows a Kubernetes cluster running on Google Kubernetes Engine (GKE):

Image for post
Image for post

From the picture, you can see that:

  • A Kubernetes cluster has one or more master nodes (for high availability purposes). A master node consists of the following core components:

There are actually more components in a Kubernetes cluster. But as a developer, you do not need to dive deeply to be familiar with any of these components. It is enough for you to know that a Kubernetes cluster is a distributed system that consists of multiple machines running across multiple zones.

While Kubernetes utilizes containers ( docker containers as default for GKE clusters) as the underlying mechanism to deploy & run applications, it builds additional layers of abstraction on the top of the container interface to make it easier for developers to containerize their applications. Instead of managing and interacting with containers directly, developers use objects and workloads that Kubernetes provides to construct their applications.

Here are the main objects and workloads that Kubernetes provides:

  • Namespaces: A Namespace is considered a virtual cluster in a Kubernetes cluster. It is used to separate projects and teams. In our system, each of our applications (a.k.a microservices) has two Namespaces, one for the demo environment and another one for the prod environment.

When working with Kubernetes, you need to know how to utilize its CLI tool kubectl to interact with Kubernetes clusters. Here are some frequently used kubectl commands that you may use in your daily work.

  • Connecting a GKE cluster: gcloud container clusters get-credentials <your_cluster> --region <region> --project <your_project> is the command for connecting to the given GKE cluster. You may need to check official docs for more details about connecting to a Kubernetes cluster with a specific cloud provider.

I recommend you read this blog if you are curious about the minimal deploy-able unit in Kubernetes: Pods.

Reference

A software engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store