100 Things You Didn't Know About Kubernetes - Part 1

100 Things You Didn't Know About Kubernetes - Part 1
F-16 Photo by Guy Croisiaux / Unsplash

🛩ī¸ Welcome to the first part of our exciting series, "100 Things You Didn't Know About Kubernetes." In this blog post, we'll uncover some hidden gems and powerful features that you may not have encountered before. Let's dive in!

1. Set Default Resources and Limits with LimitRange

In Kubernetes, you can set default resource requests and limits for every pod within a specific namespace using LimitRange. This is especially useful when you lack full control over the pods, such as in the case of auto-generated pods. Here's an example YAML to demonstrate how to use LimitRange:

apiVersion: v1
kind: LimitRange
metadata:
  name: resource-limits
spec:
  limits:
  - default:
      cpu: 100m
      memory: 200Mi
    defaultRequest:
      cpu: 50m
      memory: 100Mi
    type: Container

2. List All Kubernetes Object Types

Curious about all the object types your Kubernetes cluster provides? You can easily find out by running the following command:

kubectl api-resources

3. Sort Output by Any Arbitrary Field

Kubectl allows you to sort the output by any field of your choice. For example, to sort pods by their names, you can use the following command:

kubectl get pods --sort-by=.metadata.name

4. Join the Thriving Kubernetes Slack Community

Kubernetes has a vibrant and active community on Slack, where you can interact with developers from various projects across the ecosystem. Whether you're a newbie or an experienced developer, you can learn and collaborate with others. Remember to abide by the community rules and contribute back!

Join here: Kubernetes Slack

5. Unlock the Power of kubectl debug

The kubectl debug command is a powerful tool that allows you to create a sidecar container on any pod for debugging purposes. You can use any arbitrary image and even access the pod's mounted filesystem or share the same process context. Give it a try and see the magic unfold!

(Here, we would show the output of a sample kubectl debug command)

6. Debugging at the Node Level

Taking debugging further, you can use kubectl debug on a node context to gain full access to the underlying system, provided you have sufficient permissions. This command will create a new pod using the base image of your choice on the target node. For instance:

kubectl debug node/nodename -ti --image=ubuntu -- chroot /host bash

7. Discover the Kubectl Plugin Marketplace - Krew 🛩

The Kubernetes ecosystem offers a massive marketplace of useful kubectl plugins through Krew. Krew is a plugin manager that enriches your Kubernetes experience and makes your life easier. To explore a wide variety of plugins, visit: Krew Plugins

8. Must-Have Kubectl Krew Plugins 🛩

Here are some favourite and highly used Kubectl krew plugins worth checking out:

  • modify-secret: Easily change secrets on the fly without manually base64 encoding.
  • neat: Clean up Kubernetes manifests for better readability and organization.
  • kubelogin: Connect your cluster with any OIDC provider for secure authentication.
  • whoami: Displays the current user context in the cluster.
  • kubepug: Checks for deprecated resources, a valuable tool during upgrades.

9. Empower Your CI/CD with Prow 🛩ī¸

Did you know that Kubernetes' Project CI/CD is powered by Prow? Prow is a Kubernetes-native, highly configurable, scalable, and open-source CI system. With GitOps-based configuration, including permissions and pipelines managed through PR comments, Prow can scale to handle massive workloads. It can be a game-changer in fostering a self-service culture within your organization.

Explore Prow on GitHub: Prow - Kubernetes Test Infrastructure

10. Kubernetes Innovations Beyond Earth 🛩ī¸

Kubernetes' versatility extends beyond our planet! It's currently being tested to deliver online software updates to an F-16 airplane during flight, enhancing its capabilities and performance.

Read more about it: Software Innovations Making F-16 More Capable

We hope you enjoyed the first part of our "100 Things You Didn't Know About Kubernetes" series. Stay tuned for more fascinating insights in the upcoming parts!

Happy Kuberneting!