If you are a developer who uses containers, chances are you and your team have heard about Kubernetes. At its core, Kubernetes is a container operating system for the web, but has grown to be much more. Sure, Kubernetes can manage your containers, network traffic, and bring up a crashed ad, but it has also become a widely adopted platform with a growing community.
“When you see Kubernetes as a platform for building other platforms, it becomes more of an ecosystem tool,” said Kelsey Hightower, Staff Developer Advocate, Google Cloud Platform. “Kubernetes reflects another checkpoint on how we deal with distributed systems and containers—all backed by a community that will evolve on its own, independent of a specific vendor.”
But where does one begin? In this Kubernetes tutorial, we’ll break down how teams should think about implementing Kubernetes and share some insightful resources that can help your team solve specific challenges.
“There is a big difference between installing Kubernetes and using Kubernetes as a developer,” Hightower explains.
“I like to use the car analogy. There are some people who can design a car from scratch—from the motor to transmission—and put the whole thing together to mass produce it. But that’s different from the person who is expected to drive it.”
Kubernetes is for both operators and developers. Teams looking to unpack Kubernetes and have it deploy your app can do so quickly. However, with more knowledge of the Kubernetes platform, your team can build out extensions as your business needs and application requirements gets more sophisticated.
“Kubernetes should not get in your way no matter what you want to do above it,” Hightower states. “Kubernetes supports you deploying when you want, where you want.”
Kubernetes has a robust community and growing base of practitioners. Because Kubernetes is becoming a next-evel platform, it’s a neutral space for developers to share, regardless of their level of expertise or industry.
Anyone looking for dynamic resources and advice should join any of these Kubernetes communities:
Developers dipping their toes in the Kubernetes water should first know that running an app with this tool is fairly straightforward.
“The first Kubernetes best practice is not to run Kubernetes,” says John Arundel, principal consultant of Bitfield Consulting. “Let me clarify that. Don’t run Kubernetes yourself, use a managed Kubernetes service such as Google Kubernetes Engine.”
“The one book that every developer and sysadmin should read is ‘Kubernetes Up And Running’.” Arundel suggests. “It explains what Kubernetes is and how it works, and shows you how to go from running your first container to reasonably complex, stateful multi-pod applications.”
Alongside the Kubernete tutorials here at Stackify, YouTube has other great Kubernetes tutorials that provide an overview of container management. Google’s Aparna Sinha has a video on how to set up your clusters for scale and availability across zones and regions.
“It’s not that difficult to get a basic Kubernetes cluster up and running, but production-grade clusters are a little harder,” advises Arundel.
Developers should consider services that run on master nodes, a higher availability for worker nodes, security, authorization with Kubernetes RBAC roles, Pod Security Policies (PSP), and dependency management.
“All this stuff is complicated and easy to get wrong, and if you get it wrong, your business could be hacked or suffer catastrophic failures,” Arundel states.
Intermediate teams should be customizing Kubernetes functionality to extend the basic components of the platform out to fit your needs.
“Maybe you want all your apps to have an SSL certificate and want your endpoint protected,” says Hightower. “Kubernetes doesn’t have that out of the box. You’ll see developers in the ecosystem understand the Kubernetes API and build out these extensions, or what we call operators.”
Ultimately the goal for intermediate teams is to begin utilizing the simple Kubernetes API to add functionality.
By now, you’ve built a Kubernetes system that should have massively reduced the time and effort it takes to deploy an application.
“If you previously deployed every week, you should have no problem deploying every day on Kubernetes.” Arundel states. “Continuous infrastructure’ is the cloud native equivalent of ‘continuous deployment’: instead of doing manual actions such as a deploy, you simply push to a Git repo, and an automatic system will run tests and make your changes live.”
Hightower suggests developers should look into Webhook controls and and admission controls as their needs grow.
“Every developer needs access to a particular database. We could have them describe it outside the Kubernetes deployment object, or we can create an admission controller. There are a whole set of resources on the official Kubernetes website—just search for admission controllers and you’ll see how to make one of these things.”
Kubernetes is a powerful DevOps tool with the potential to radically transform how your dev team operates, but it really comes down to how your business is moving and what you’ll need your applications to do.
Developers have a wide spectrum of resources and education options– from Kubernetes conferences and niche online communities, to the wealth of advanced content hosted by the official Kubernetes homepage.
“Kubernetes is a tool that was born in the cloud era,” Hightower states. “We know that these tools need great APIs and they need to be open sourced so they can be trusted in the long term. We also know that these tools need to be backed by big communities so we can ask questions of our peers and not rely 100% on the vendor for support.”