avatarJohn David Luther

Summary

The provided content outlines a structured approach to mastering Kubernetes by familiarizing users with 18 essential kubectl commands through a practical guide, scripts, and resources to explore and manage a Kubernetes cluster efficiently.

Abstract

The article "Mastering Kubernetes One Task at a Time — Know Thy Cluster, Thy (Kubectl) Commands!" emphasizes the importance of understanding foundational Kubernetes commands for effective cluster management. It introduces readers to a collection of 18 crucial kubectl commands, which are available in a script within a GitHub repository, facilitating quick navigation and exploration of a Kubernetes cluster. The guide provides a step-by-step approach to creating a KIND cluster using Terraform infrastructure as code (IaC), referencing detailed blog posts and gist code snippets for readers to follow. The author encourages readers to engage with Kubernetes.io documentation to enhance their learning experience, highlighting the importance of exploring the side menu links and "What's Next" sections for comprehensive coverage. The article serves as a practical resource for both new and experienced Kubernetes users, aiming to build confidence in using command-line tools and understanding cluster operations. The ultimate goal is to empower users to independently explore additional commands and functionalities within the Kubernetes ecosystem, with the provided commands acting as a starting point for daily cluster interactions.

Opinions

  • The author believes that having a strong grasp of essential kubectl commands is crucial for anyone working with Kubernetes clusters.
  • There is a strong emphasis on hands-on practice, with the author providing a script and resources to facilitate real-world experience.
  • The author values the Kubernetes.io documentation as a primary resource for learning and encourages readers to make full use of it, including navigating the side menu and "What's Next" sections.
  • The article is part of a series, suggesting the author's commitment to continuous learning and development in the field of Kubernetes and cloud technologies.
  • Encouragement for readers to follow the author and subscribe to updates indicates the author's desire to build a community and maintain engagement with their audience.
  • The author's request for readers to clap and share the article reflects a belief in the value of community recognition and support for educational content.

Mastering Kubernetes One Task at a Time — Know Thy Cluster, Thy (Kubectl) Commands!

18 kubectl commands you must have in your back pocket to know and explore your Kubernetes cluster with ease, like a Pro.

Table of Contents

  1. Introduction
  2. Create KIND Cluster
  3. Know Thy Cluster Script and Commands
  4. Conclusion
Mastering Kubernetes One Task at a Time — Know Thy Cluster, Thy (Kubectl) Commands!

Introduction

Mastering Kubernetes One Task at a Time is off to a great start with my first post, RBAC Authorization with X509 Client Cert Authentication, on the series. I hope you find it helpful and keep in touch with the entire series as it evolves.

Keeping the momentum going, the next task is ready. This one is designed to equip you with commands, all 18 of them, to situate yourself very quickly; start exploring a Kubernetes cluster to learn the basic setup before beginning on the tasks needed to build and deploy applications.

As a reminder, this script know-thy-cluster.sh is available in the GitHub repository de>https://github.com/jdluther2020/jdluther-kubernetes-io-tasks, and this repository also comes pre-installed on the EC2 instance hosting the KIND cluster under the /home/ec2-user/jdluther-kubernetes-io-tasks folder. You can either refer to and run the script directly or follow the gist page I will demonstrate below.

Let’s get hands-on!

Create KIND Cluster

We begin by creating the cluster using the terraform IaC, following the gist code links below. Refer to the blog for a detailed explanation.

  1. Gist codeThe AWS Way — IaC in Action — A Docker and KIND Ready Amazon EC2 Node-IaC Code. See the raw version for better readability and easier command copy/paste.
  2. See blog for more details — The AWS Way — IaC in Action — A Docker and KIND Ready Amazon EC2 Node.

Know Thy Cluster Script and Commands

We continue after the terraform script is done running. The gist code below shows the continuation starting with the terraform output output. Just following the command one after another is all that’s needed.

I’d highlight the Kuberneter.io documentation reference pages, as one of the main goals here is to learn to be able to look up the documentation to find your way while dealing with any Kubernetes work.

  1. Command line tool (kubectl) — https://kubernetes.io/docs/reference/kubectl/
  2. API Overview — https://kubernetes.io/docs/reference/using-api/

On any Kubernetes.io page, in addition to reading the page, please explore the links on the left side menu as well as the links under the What’s Next section at the bottom. In total that provides a full coverage as both links above prove.

Conclusion

The 18 kubectl commands I’ve covered here are essential to knowing and exploring a Kubernetes cluster and performing a quick test to ensure the cluster is accessible and functional.

I wanted to logically club them all under the Know Thy Cluster, Thy (Kubectl) Commands! task to provide an end-to-end demonstration to get a feel of the process and an opportunity to know these commands well since they’re frequently used by those who deal with Kubernetes clusters daily. Once familiar, it’s easy to venture out, explore, and deep dive into other commands and functionalities offered by the vast and rich world of Kubernetes at https://kubernetes.io/docs/home/.

All the best, and feel free to browse the next post of the series Containers and Pods with the link below.

If you benefited from reading the post, please 👏 a few times before parting, and help others by sharing it; I highly appreciate that!

Please follow to stay in touch, track, and be the first to get notified of all future writings on AWS Cloud, Containers, Kubernetes, and Machine Learning. Also, check all my stories on The AWS Way publication.

AWS
Kubernetes
Docker
Terraform
Infrastructure As Code
Recommended from ReadMedium