Ugly Command Party - Day 10
Shea Stewart
Technologist working in Platform & Customer Engineering Capacities @ RunWhen
On the 10th of the ugly command party, the command I'll share is:
Ugly Command Name: Find Ingress Owner and Service Health
What does it do?
Kind of like “kuebctl tree”, but aimed at ingress objects.
Given an ingress object, this command builds on Day 4’s “Fetch Ingress Object Health in Namespace” command by determining the owner of the Ingress object. So now it will give you the ingress object health, and if pods are running for the ingress object it will identify the owner of the ingress (e.g. deployment, statefulset, daemonset).
When would you use it?
If you know the ingress name but wand to quickly dig into the related objects, this command can get you the health, owner, service names and pods behind the object.
What is the command?
Please view the GitHub Gist below to find the code snippet. Due to a limitation with LinkedIn, it does not accept some code in the code snippet and breaks the Article feature :-/
What is some sample output?
Ingress: online-boutique
Backend Service: frontend-external, Port: 80
Endpoint Pod:
- Pod Name: frontend-848d9f9dc9-5tdhm, Pod IP: 10.104.227.20
- Pod Name: frontend-848d9f9dc9-pjhkv, Pod IP: 10.104.230.67
- Pod Name: frontend-848d9f9dc9-fg4rv, Pod IP: 10.104.232.29
Owner: frontend Deployment
Health Status: Healthy
------------
What does it need?
If you want this command tailored for your environment and ready to copy & paste, this command has been added to the open source library of commands available through RunWhen Local. Check it out here: https://docs.runwhen.com/public/runwhen-local/getting-started/running-locally
Find an example of the command here: https://runwhen-local.sandbox.runwhen.com/online-boutique/online-boutique-Nginx-Ingress-HTTP-Errors/#find-ingress-owner-and-service-health
Have an ugly command to share? Collaborate with us on GitHub with issues or discussions
This is part of a series.?Check out?this article?to see additional ugly commands posted in the series.