Category: Kubernetes, github, yaml

This is just one blog post in an ongoing series about fun things you can do with the Kubernetes CLI, kubectl. Pods are where the magic happens, where we get our logs, and where we spend most of our time troubleshooting outages and malfunctions.

Combine that with some data extraction, and we can do some pretty amazing things: The demo.yml definitions that we're using define some labels that we can use to filter our queries: Armed with these semantics, we can run some neat sub-queries against our Pods: Q: How is prod doing today?Q: What images are we running on the backend?Note: This one uses the image.fmt output format from Silly Kubectl Trick #2. Using subshell expansion in Bash and Zsh, we can combine these calls with other commands that deal with individual pods: Powerful, but a little less convenient than I would like.

For example, if the admin-ui from our sample deployment is off in the weeds, and we want to delete / recreate all of the pods: Just remember: with great power, comes great responsibility.

Related Articles