Ugly Command Party - Day 4
Shea Stewart
Technologist working in Platform & Customer Engineering Capacities @ RunWhen
On the 4th of the ugly command party, the command I'll share is:
Ugly Command Name: Fetch Ingress Object Health in Namespace
What does it do?
Looks through every Ingress object in a namespace and:
When would you use it?
If you’re struggling with an ingress coming up, or have a lot of ingress objects to audit in a namespace, it’s a quick way to get a list of what has a valid configuration and what doesn’t from the Ingress through to the pod.
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: failed
Backend Service: failed, Port: 80
Validation: Endpoint for service failed does not have any pods
Health Status: Unhealthy
=====================
------------
Ingress: failed2
Backend Service: failed2, Port: 80
Error from server (NotFound): services "failed2" not found
Validation: Service failed2 does not exist
Error from server (NotFound): services "failed2" not found
Validation: Service failed2 does not exist
Health Status: Unhealthy
=====================
------------
Ingress: ob
Backend Service: frontend-external, Port: 80
Endpoint Pod:
- Pod Name: frontend-848d9f9dc9-jt4cc
Pod IP: 10.104.45.5
- Pod Name: frontend-848d9f9dc9-tsgtn
Pod IP: 10.104.53.6
- Pod Name: frontend-848d9f9dc9-btmp9
Pod IP: 10.104.56.23
Health Status: Healthy
------------
Ingress: online-boutique
Backend Service: frontend-external, Port: 80
Endpoint Pod:
- Pod Name: frontend-848d9f9dc9-jt4cc
Pod IP: 10.104.45.5
- Pod Name: frontend-848d9f9dc9-tsgtn
Pod IP: 10.104.53.6
- Pod Name: frontend-848d9f9dc9-btmp9
Pod IP: 10.104.56.23
Health Status: Healthy
------------
What does it need?
I 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-Ingress-Health/#fetch-ingress-object-health-in-namespace
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.