#!/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