Kubernetes 101: How to get started with container orchestration
Kubernetes is one of the best things to happen to DevOps in the past few years. But, if you missed the first wave, the terminology and technology can be confusing sometimes. Here, Ashley Lipman goes over the basics of this container orchestration system and explains how new developers can get started with this fundamental technology.
With Kubernetes, life as a developer is a whole lot simpler. Although it started life as an open source project at Google, Kubernetes now is one of the fastest growing automation systems for containers today. Though there is a steep learning curve with Kubernetes, it’s still a simple, highly effective orchestration engine.
Kubernetes is also known as K8s and it might just be the greatest thing that’s hit the DevOps scene in the last few years. With the right skills, Kubernetes can majorly boost the development process by automating updates and even managing apps and services without worrying about downtime. So, how can beginners get started with Kubernetes and why should they even want to? This intro guide breaks down everything you need to know about Kubernetes, so you can hit the ground running.
What is Kubernetes?
Before we can discuss how to get started with Kubernetes, we need to review what it is. In essence, Kubernetes is an open-source container management system. It helps make managing containers across many nodes just as easy as managing containers on a single system. How does it accomplish this? Its main features include Traffic Load Balancing, Scheduling, Scaling, and even automatic restarts.
Kubernetes is often confusing at first because it largely uses its own vernacular within the orchestration space. If you want to understand the system, you need to get familiar with the language. The first word you need to know is “nodes.” Nodes are compromised of several clusters and clusters are the entire running system. In this sense, a node can be a physical machine or a VM.
Another term you’ll run into in Kubernetes is “deployment.” This is what Kubernetes uses to manage configuration changes to horizontal scaling and running pods. Basically, it’s a template for creating more pods. As you can see, systems can be highly automated with Kubernetes. It works well with other familiar platforms like AppOptics. Finally, because Kubernetes is open source, it’s always improving and updating.
Getting started with Kubernetes
Your first step to getting started with Kubernetes is to create a cluster so you can deploy an app. The cluster needs to include both a master and one or more node. To start, run a cluster on a local machine. The Minikube software is the perfect space to test your initial development.
After starting the Minikube software, use the cluster command
kubectl cluster-info to view cluster information. Then, you’ll need to list available nodes with another command
kubectl get nodes. Note from the output the available nodes and masters.
Next, it’s time to deploy a containerized application into your cluster. You do this with a deployment configuration. This is when you’ll describe how to create instances for your app; the master can schedule these instances within nodes. Once again, open the interactive terminal and create a new deployment. View your new deployment with the command
kubectl get deployments. Like before, you’ll be able to see the available nodes.
The last step is to create a proxy. Pods run on private networks that can’t be accessed from outside networks. Using the
kubectl command, you can communicate with the application through an API. You need the proxy to expose the application so other services can use it. Once again, open a terminal window and submit the proxy command
This command started the connection between the virtual terminal window and your new cluster. Click back to your first terminal window and use the curl command
curl http://localhost:8001/version. Then, you can get the output of your pod by using the query command
kubectl describe pods. From here, you’ll see information like the pod name, IP address, and restart count.
The future of Kubernetes
These steps above are the perfect introduction to Kubernetes. Using this system is easy once you familiarize yourself with the terminology and basic practices. From there, you’re free to use it any way that helps you run your container systems more efficiently.
Because Kubernetes is open source, you can expect to see even more updates in the future. Kubernetes is likely to become a normal, efficient practice of DevOps in the future. Join the pioneer groups on the cusp of new technology by adopting this container orchestration system today.