logo
logo
Sign in

Getting Started with Kubernetes

avatar
Mia Liang
Getting Started with Kubernetes

What is Kubernetes? 

At its core, Kubernetes is a portable, extensible, and open-source platform designed to help development teams everywhere better manage containerized workloads and services. It's a groundbreaking solution that empowers both declarative configuration and automation in equal measure.

But more than that, Kubernetes has become incredibly popular over the last few years thanks to its large, rapidly growing ecosystem. Various Kubernetes services, support, and even optimized tools are widely available - finally unlocking a world of possibilities for development teams that previously would have been difficult (if not impossible) to replicate on their own).

Google first open-sourced the Kubernetes project all the way back in 2014 and it was itself the product of more than 15 years of Google's experience in running sophisticated production workloads at scale. The combination of best-of-breed ideas, along with the best practices honed by one of the most passionate communities on the Internet, has truly created a perfect storm in the best possible way.

Kubernetes Basics

To put it as simply as possible, Kubernetes is a container orchestration platform that was designed from the top down to automate as many of the manual processes involved with containerized applications as possible. This includes those processes that were related to tasks like deploying, managing, and even scaling those containers.

In a larger sense, this means that developers can cluster together groups of hosts running various containers, for example, and Kubernetes will help easily and efficiently manage them. Those hosts can be on-premise, in public, private, or hybrid clouds. Note that this also makes Kubernetes the perfect option for hosting cloud-native applications that require rapid scaling, too.

Kubernetes Architecture

In the traditional deployment era, organizations ran applications on physical servers. This was a challenge, as there was really no way to define resource boundaries for those apps on the servers in question. If many different apps were running on the same server, there would undoubtedly be situations where one app was hogging up most of the resources. Because of that, the other apps would underperform at the same time.

Then came the virtualized development era, which allowed developers to run many different virtual machines (also known as VMs) on a single CPU. This allowed for the far better utilization of resources, especially when compared to the traditional deployment era.

Kubernetes, on the other hand, exists to help teams take advantage of the next era of deployment: the container era. Containers are very similar on the surface to virtual machines in that they make it easier to share resources like operating systems among a variety of applications. Because of that, containers are considered to be very lightweight. Each container has its own file system, memory, process space, CPU, and much, much more - and Kubernetes helps you manage every last aspect of this in the most efficient way possible.

Running Your First Container

As previously mentioned, Kubernetes is all about helping you implement and rely on a container-based infrastructure in your production environments. Once you run your first container, you can accomplish a large number of different tasks within Kubernetes, like:

  • Orchestrating that and other containers across multiple hosts as needed.
  • Making a far better use of hardware available to maximize resources while running the enterprise apps in question.
  • Control and automate not only the deployment of your applications, but updates as well.
  • Scale containerized applications (and all associated resources) in real-time, thus allowing you to respond to certain performance fluctuations almost instantly.

After running your first container you'll also be pleased to know that Kubernetes lets you declaratively manage services, too. This all but guarantees that any applications you deploy are always running exactly the way you want them to, no questions asked.

To install Kubernetes for the first time, open Minikube and use the following code to create a cluster:

  • minikube start

To create a Kubernetes deployment using your existing image, execute the following code in the command prompt:

  • kubectl create deployment hello-minikube --image=k8s.gcr.io/[IMAGE NAME HERE]:1.10

To get the URL of the service that you're working with, and to view all relevant details so that you can get a better idea of what is really happening, use the following code at any time:

  • minikube service hello-minikube --url

If you should want to delete the service you're working with in any question, you can do so using the following command:

  • kubectl delete services hello-minikube

The Benefits of Kubernetes

While it's absolutely true that Kubernetes and container deployment offers benefits that are very similar to virtual machines, it also brings with it a host of additional advantages that are certainly worth a closer look.

Chief among these is the fact that Kubernetes and containers supports agile application creation and deployment, all things to the increased ease-of-use and efficiency of container image creation.

But perhaps the biggest benefit of all comes by way of the environmental consistency that Kubernetes brings with it across development, testing, and well into production. With the right application performance monitoring tool by your side, everything you need runs every bit as effectively on a smaller device like a laptop as it would in the cloud. This, coupled with an application-centric management that runs all applications on an operating system using logical resources, unlocks a host of new possibilities for development teams everywhere that would have been unthinkable even as recently as a decade ago.

collect
0
avatar
Mia Liang
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more