To get list of docker images from kubernetes cluster, create new shell script with this content
#!/bin/bashdeployments="$(kubectl get deploy -n YOUR_NAME_SPACE -l version=prod -o name)"
for word in $deployments; do
contents="$(kubectl get $word -n YOUR_NAME_SPACE -o json)"
jq .spec.template.spec.containers[0].image <<< "$contents"
done
for word in $deployments; do
contents="$(kubectl get $word -n YOUR_NAME_SPACE -o json)"
jq .spec.template.spec.containers[0].image <<< "$contents"
done
ไม่มีความคิดเห็น:
แสดงความคิดเห็น