#!/bin/bash # 1. get all pod containers with istio proxy sidecars # 2. get pod app labels (some have app, others have app.kubernetes.io/name) # 3. return only uniques and not nulls version=1.19.0 kubectl get pods -A -o json | \ jq "[.items[] | select(.spec.containers[].image | contains(\"istio/proxyv2:$version\"))]" | \ jq '[.[].metadata.labels.app, .[].metadata.labels."app.kubernetes.io/name"]' | \ jq 'unique | .[] | select( . != null)'