$ docker run -e APP_COLOR=pink simple-webapp-color
To set an environment variable set an env
property in pod definition file.
apiVersion: v1
kind: Pod
metadata:
name: simple-webapp-color
spec:
containers:
- name: simple-webapp-color
image: simple-webapp-color
ports:
- containerPort: 8080
env:
- name: APP_COLOR
value: pink
There are other ways of setting the environment variables such as ConfigMaps
and Secrets