Skip to content

Instantly share code, notes, and snippets.

@tanelmae
Created November 24, 2021 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanelmae/e7e80b93dff85a99baa7bf1b3d59f251 to your computer and use it in GitHub Desktop.
Save tanelmae/e7e80b93dff85a99baa7bf1b3d59f251 to your computer and use it in GitHub Desktop.
List ingresses with specific class
function ingress-by-class() {
echo "Namespace >> Ingress name"
echo "-------------------------"
kubectl get ingresses \
-o=jsonpath="{range .items[?(@.metadata.annotations.kubernetes\.io/ingress\.class==\"${1}\")]}{@.metadata.namespace}{\" >> \"}{@.metadata.name}{\"\n\"}{end}" --all-namespaces
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment