Quantcast
Channel: A Portal to a Portal
Viewing all articles
Browse latest Browse all 1850

Note to self - use kubectl to query images in a pod or deployment

$
0
0

In both cases, we use JSON ...

For a deployment, we can do this: -

kubectl get deployment foobar --namespace snafu --output jsonpath="{..image}"

which returns the image name(s) on the same line

Or we can do this: -

kubectl get deployment foobar --namespace snafu --output JSON | jq -r '.spec.template.spec.containers[].image'

which does much the same, although with each image on a separate line 'cos formatting

Alternatively, we can examine the pod: -

kubectl get pods --namespace snafu --selector app=foobar --output jsonpath="{..image}"

which, again, returns the image(s) on the same line, but for each pod in the deployment - which perhaps leads to duplication

For me, kubectl get deployment is simpler ...


Viewing all articles
Browse latest Browse all 1850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>