Skip to main content
BlogContainers (Kubernetes, Docker)Kubernetes the Hard Way

Kubernetes the Hard Way

A maze-like circular pattern in purple centering around the Kubernetes symbol. The text reads, "Kubernetes the Hard Way".

For the uninitiated, Kubernetes can be a beast. We experience so many benefits and conveniences, but a lot is happening under the hood that we’re shielded from. To peel back some of the layers of complexity, I forked a well-known repository—Kelsey Hightower’s Kubernetes the Hard Way—to make a Linode-specific approach. My forked repo is available here.

If you haven’t encountered Kelsey’s tutorial before, it’s worth looking at. He’s one of the better-known Kubernetes evangelists in the industry and one of the earliest contributors to the project.

If you’ve never deployed a Kubernetes cluster before, then I would recommend taking the following steps first, to get a sense of the differences of doing it the hard way:

Okay, now if you’re ready to really dive into what makes Kubernetes work, I’ll walk you through some of the biggest lessons I learned from Kubernetes the Hard Way. It will take the things that you probably once took for granted and make sense of them in a totally new way. Hopefully, this will be enough to get you interested in giving it a try yourself!

Lesson 1: You will do it wrong.

The amazing thing about Hightower’s work is that it shows you why scripted deployments of Kubernetes are so widely used. He does this by simply walking you through exactly what happens when you run one of those deployments.

You might make a simple typo while running a command on all three of your control plane nodes at once, and then need to go back to type it all in again. You might also get to the end of a lab only to realize the smoke test for the section completely failed, and you’ll need to restart it. We learn the most when we make mistakes, because then we go back and figure out exactly what we had done wrong. In fact, one of the most useful things about the whole tutorial is the clean up section, because you may have moments when things are so irreparably broken in your cluster that you just need to start again from scratch.

Did I mention earlier that Kubernetes is hard?

Lesson 2: Kubernetes is not magic.

If you’ve only ever worked in managed Kubernetes clusters, you might feel like Kubernetes is a magical system that just keeps your stuff running for you. Working through Kubernetes the Hard Way makes it obvious that there is no magic inside of Kubernetes. It’s just a bunch of code that does what good software does best: make it seem like you’re a wizard.

When you’re stumbling over getting the hostname on your Linodes set properly or trying to figure out what is going on with Kubernetes’ networking model, it becomes very clear that you’re not dealing with some magic container dust that you can sprinkle on your infrastructure just to make everything that’s difficult disappear.

At the end of it all, when you’re finished deploying a Kubernetes cluster by typing out every command that makes it a reality—instead of just pushing a button to get some production code out into the world—you’ll finally understand why it’s so great to have push-button solutions for Kubernetes. It will also mean you can dive in and fix things when your clusters are acting up—things that you may not have known were part of the platform.

Lesson 3: Read the docs.

One of the things that I realized about halfway through Hightower’s tutorial the first time I ran through it was that the links to the docs are not there just for fun; they are essential. It is necessary to read through the Kubernetes docs to set up this massive system.

While it is certainly possible to simply type everything into your terminal and get all of the Linodes necessary to run a small Kubernetes cluster, you would need superhuman typing skills and ensure nothing goes wrong along the way. Sure, you might get to the end and have a bit more knowledge about what makes Kubernetes tick, but it would be nowhere near as much as if you’d been paying attention to the links that drop in each of the individual labs.

This little lesson might be obvious for some readers. However, some of you might go through that cycle of being unable to determine how to get one of the labs to work, and you’ll jump straight to the Clean Up section of the guide to start over again. Before you do that, check out the key links. Read the docs along the way, and you’ll be much happier.

Conclusion: Don’t give up!

If you’re still reading this and haven’t been scared off yet, I commend you. You may not need my final word of wisdom, but I’ll give it to you anyways: Don’t give up. Regardless of how difficult it might be, setting up Kubernetes the hard way isn’t an impossible task. After all, push-button solutions do this all the time, without anyone even thinking about it. If a computer can follow a bunch of instructions, then so can you.

Also, the feeling of looking at a website you’ve deployed to a Kubernetes cluster you built by hand is a little bit like getting a view of a mountain lake that can only be accessed by a day-long hike. You’ll be very happy you did it.

Hightower’s guide is so helpful, which is why I forked it for Linode-specific resources. I definitely learned a lot, but even more than that, I had a lot of fun doing it! As technologists, this is why we got into technology in the first place: We love solving hard problems.

If you’re up for a challenge, go check out the guide yourself, spin up some Linodes, and become a Kubernetes wizard!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *