I have many versions and tags of containers used by Deployment in k8s (and hence many log groups).
It would be nice if i could display the container URI and tag in a readinessProbe
or livenessProbe
which then flows to persisted logging.
Basically so that I know my Pod whose logs I am viewing is running on the correct image.
I thought of simply echo
ing it as a container variable, so i thought of setting the container image URI as a container variable in the Pod manifest.
The docs at k8s EnvVarSource says it only supports certain fields for fieldRef
, importantly, it doesn't support grabbing the spec.containers
image
field.
Anyone has any smart ideas how I might achieve this in other ways?
Or when/if does the kubernetes team support this?
UPDATE:
i found that doing echo
under readinessProbe.exec.command
works (the Pod is Ready status) but the echo
output does not flow to the logs.
Only the application (server) output appear in the logs in my logging backend (CloudWatch).