Last active
January 12, 2021 13:13
-
-
Save koenighotze/5c96f97e8663d008b3b1740b5798afdf to your computer and use it in GitHub Desktop.
Dump virtual service mappings for all namespaces for a Istio service mesh
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
#!/usr/bin/env bash | |
for ns in $(kubectl get ns -o=jsonpath='{.items[*].metadata.name}' | sort); do | |
echo Namespace: $ns | |
kubectl get vs \ | |
-n $ns ${ns}-master \ | |
-o=jsonpath='{" Destination: "}{.spec.http[*].route[*].destination.host}{"\n Regex mapping:\n "}{range .spec.http[*].match[*]}{.uri.regex}{"\n "}{end}{"\n"}{"\n Prefix mapping:\n "}{range .spec.http[*].match[*]}{.uri.prefix}{"\n "}{end}' 2>/dev/null \ | |
|| echo "No istio virtual services" | |
echo | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A simple gist for dumping all http info from all virtual services