Kubernetes, the new cloud OS and data center
Kubernetes is a topic that’s on everyone’s mind, but at the same time, a lot of individuals don’t understand why. Is it the actual platform itself? Or what the platform does for engineers in today’s world? The answer to those questions is – sort of both. Kubernetes does several things, but the primary pieces include the following:
- Deploying your containerized application
- Scaling your application
- Ensuring that your application is highly available
- Giving you the ability to secure your application and the users accessing the application
These four points sound like what engineers have already been doing with computers since the inception of the first mainframe. The question now becomes, why is Kubernetes so popular?
Kubernetes in the cloud
Everywhere you look, it feels like there’s a new way to utilize the Kubernetes platform or some new tool that’s supposed to make your life easier. Some of these platforms include the following (you’ll learn more about these in the upcoming chapters):
- Cloud Kubernetes services such as AKS, Google Kubernetes Engine (GKE), and Amazon Elastic Kubernetes Service (EKS)
- Platform-as-a-Service (PaaS) offerings such as OpenShift
- Serverless Kubernetes platforms such as Azure Container Apps and AWS Fargate profiles on EKS
Although that’s not an extensive list, you can see that just the sheer number of platforms that are at your disposal can make it extremely difficult to pick and choose what you should ultimately go with. The semi-agreed-upon answer to this question is that it all depends on your current ecosystem. If you’re in AWS, use EKS. If you’re in Azure, use AKS. If you’re a Red Hat Enterprise customer, check out OpenShift. The reason why is that, at the end of the day, all of the Kubernetes services are doing the same thing. They’re all using Kubernetes under the hood and utilizing cloud services to make your life easier.
For example, if you’re using AKS, chances are you probably want to use Azure Active Directory (AAD) to manage who has access to what in the AKS cluster. Azure makes it extremely straightforward to implement this because the goal of a Kubernetes service in the cloud is to do exactly that. All public clouds in general are trying to make your life easier, regardless of what cloud you’re using. A great example of this is how you can use AAD inside of GKE via federation with Cloud Identity to map AAD tenants, users, and groups.
Why Kubernetes?
The question from the beginning of this chapter around why people want to use Kubernetes has sort of been answered, but there’s still more to think about. Primarily, we must think about why everyone is flocking toward Kubernetes, especially Kubernetes services in the cloud. The answer to why people are using Kubernetes services in the cloud is typically something similar to one of the following:
- You don’t have to worry about the underlying infrastructure
- Worker nodes and Control Planes are scaled for you automagically
And although those are great answers, you’re still not any closer to the answer as to why you should use Kubernetes if all it’s doing is what everyone has been doing in tech for years. It’s not implementing anything new or out of the ordinary.
Simply put, the reason why people like Kubernetes is that it allows you to interact with your infrastructure via an API. When you run a Kubernetes command such as kubectl apply -f deployment.yaml
, you’re interacting with the Kubernetes API. When you run a command such as kubectl get deployments
, you’re interacting with an API. 99% of what you do when interacting with Kubernetes is all API-based. It’s a bunch of GET
and POST
requests. The reason why Kubernetes makes engineers’ lives easier is that what you used to have to do to get an application up and running on multiple servers is now abstracted away and it’s all now at the programmatic level. All APIs.
Kubernetes as a data center
Remember data centers? Those things that have the loud, big computers running with a bunch of fans and air conditioners? Perhaps you’re from the era of spending hours in a data center, racking and stacking servers, and taking a nap on the data center floor using your backpack as a pillow. If you’ve never done any of that, consider yourself a lucky person!
When thinking about a data center, there are several components, but let’s think about the main ones that engineers care about:
- Servers
- Network equipment (firewalls, load balancers, routers, switches, gateways, and so on)
- Outbound and inbound connectivity
- Security
- The ability to run software and virtualization on the servers
Containerization platforms such as LXC and Docker were able to give us the fifth point mentioned here – virtualization of OSes and the ability to run software – but what about the rest? Engineers needed a way to orchestrate and manage the software and virtualized OSes. That’s where Kubernetes comes into play.
Kubernetes fills every piece of the data center puzzle:
- Networking, including Pod-to-Pod communication, services, service meshes, Ingress, load balancing, and routing.
- Security and encryption between Pods and services
- High availability for clusters
- The ability to deploy, manage, scale, and maintain applications of any kind (must be containerized)
- Authentication and authorization capabilities from third-party tools such as AAD and IAM users/roles
Kubernetes is a one-stop shop for everything that you would find in a data center. The biggest difference is that the infrastructure (if you’re running in the cloud and not on-premises) is completely abstracted away. You don’t have to worry about the day-one operations; you only have to worry about getting an application deployed, orchestrated, and working as you and your team see fit.
One important piece of information to think about here is with new technology comes new problems. Kubernetes isn’t easy. Just because you don’t have to deal with sleeping on a data center floor doesn’t mean you won’t have an entirely new set of problems to understand and fix. Does Kubernetes make your life easier as an engineer? Yes. Does Kubernetes make your life harder? Yes. Although, the goal is to make your life a little less hard with Kubernetes, please keep in mind that it isn’t a magic box that you set and forget.