Created
December 14, 2017 16:37
-
-
Save mgoodness/7b57b57c74f4303792edc296dc584283 to your computer and use it in GitHub Desktop.
Outputs the number of Ingresses (>=5) in each Namespace, plus Annotations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function count-ingress | |
for namespace in (kubectl get ns -o name | cut -d/ -f2) | |
set -l product_name (kubectl get ns $namespace -o json | jq -r '.metadata.annotations."ticketmaster.com/name"') | |
set -l tech_owners (kubectl get ns $namespace -o json | jq -r '.metadata.annotations."ticketmaster.com/tech-owner"') | |
set -l count (kubectl -n $namespace get ing --no-headers --ignore-not-found | wc -l | tr -d ' ') | |
if test $count -ge 5; echo $namespace \($product_name - $tech_owners\): $count; end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment