Most Useful Kubernetes Tricks

In partnership with

TechOps Examples

Hey — It's Govardhana MK 👋

Welcome to another technical edition.

Every Tuesday – You’ll receive a free edition with a byte-size use case, remote job opportunities, top news, tools, and articles.

Every Thursday and Saturday – You’ll receive a special edition with a deep dive use case, remote job opportunities and articles.

👋 Before we begin... a big thank you to today's sponsor HUBSPOT

Want to get the most out of ChatGPT?

ChatGPT is a superpower if you know how to use it correctly.

Discover how HubSpot's guide to AI can elevate both your productivity and creativity to get more things done.

Learn to automate tasks, enhance decision-making, and foster innovation with the power of AI.

If you’re not a subscriber, here’s what you missed last month.

To receive all the full articles and support TechOps Examples, consider subscribing:

🛠️ TOOL OF THE DAY

Zesty - An automated Kubernetes cost optimization platform.

  • Rightsize CPU, memory, and storage and cut waste with workload aware automation.

  • Multi-dimensional automation for K8s optimization.

  • Predictive scaling based on real-time and historical patterns.

  • Fast application boot time through hibernated nodes deployed in under 30 seconds with pre-cached images.

IN TODAY'S EDITION

🧠 Use Case
  • Most Useful Kubernetes Tricks

👀 Remote Jobs

📚️ Resources

🧠 USE CASE

Most Useful Kubernetes Tricks

We tend to look for lateral, highly diversified options to learn, understand, and equip ourselves with the knowledge to run, troubleshoot, and live with Kubernetes, yet we seldom use the simplest and most native options.

Two such options, which have greatly helped me and many others but are equally greatly ignored, are Kubectl explain and Kubectl aliases.

Kubectl explain

With kubectl installation, you can use kubectl explain which is greatly helpful to quickly understand Kubernetes resource definitions and their fields.

For example: kubectl explain pod shows that a Pod is a collection of containers that can run on a host, created by clients and scheduled onto hosts. It then lists its main fields apiVersion (schema version), kind (type of resource), metadata (object details), spec (desired behavior), and status (current state).

kubectl explain pod output

You can apply this same approach to explore resources like node, service, and deployment etc.,

You don’t need any expensive and exhaustive documentation, you can learn about Kubernetes resources right within your terminal.

Kubectl aliases

Be it you are preparing for Kubernetes certification exams or you are involved in troubleshooting day in and day out, as many Kubernetes engineers are, typing long kubectl commands repeatedly can be time consuming and error prone. Aliases give you the ability to map frequently used, verbose commands to short, memorable keystrokes.

For example: Instead of typing kubectl get pods --all-namespaces every time, you could simply run kgpa

While debugging, commands like kubectl describe pod <pod-name> can be shortened to kdesc <pod-name>

These can be added to your ~/.bashrc or ~/.zshrc so they’re always available in your terminal session. Reload your shell (source ~/.bashrc) and your muscle memory will start kicking in, cutting command execution time dramatically.

Looking to promote your company, product, service, or event to 55,000+ Cloud Native Professionals? Let's work together.