Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List pods with secrets in volumes or envvars
kubectl get pods -n main -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{'\t'}Volumes:{'\t'}{.spec.volumes[*].secret.secretName}{'\n'}{'\t'}Envvars:{'\t'}{.spec.containers[*].env[*].valueFrom.secretKeyRef}{.name}{.key}{'\n'}{end}"

returns

gw-main-7b5789879-w85tz	2020-02-06T20:07:00Z
	Volumes:	gw-token-jrwgm istio.gateway
	Envvars:	map[key:client-id name:salesforce] map[key:redirect-url name:salesforce] map[key:public-url name:salesforce]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.