Here when you use env it means the when the pod is created and then you utilize those environment variables.
Below is from the kubernetes site https://kubernetes.io/docs/concepts/configuration/configmap/
A ConfigMap is an API object used to store non-confidential data in key-value pairs. Pods can consume ConfigMaps as environment variables, command-line arguments, or as configuration files in a volume.
In order to use the tag name for your image you would have to define it in the environment where you are running the kubernetes resource.
A simple way would be run export RELEASE_LEVEL=1.1.1 from a shell script and then in the image use it like image: sid_z:$RELEASE_LEVEL
Edited:
Indeed like @willrof mentioned to substitute to yaml you can either use sed command where you save actual yaml in a kind of template and then substitute it with the value of environment variable like so
sed s/RELEASE_LEVEL/$RELEASE_LEVEL/ deployment.yaml.template > deployment.yaml
here template would be like:
containers:
- name: simple-app
image: <Image>:**RELEASE_LEVEL**
imagePullPolicy: Always
and apply the yaml or use envsubst (update environment variable in the file) like so. Note here you have to copy it to a different file and then rename it to the actual file. envsubst do not update in place. In the below example when you feed the file to envsubst and you have exported the environment variable like explained above, it will replace the variable with actual value.
envsubst deployment.yaml deployment.yaml.out
mv deployment.yaml.out deployment.yaml
your yaml should be like
containers:
- name: simple-app
image: <Image>:**$RELEASE_LEVEL**
ports:
- containerPort: 80
name: http
ideally it would be a part of shell script or individual commands in order.