Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 926 Bytes

07.Configure-Environment-Variables-in-Applications.md

File metadata and controls

34 lines (28 loc) · 926 Bytes

Configure Environment Variables In Applications

ENV variables in Docker

$ docker run -e APP_COLOR=pink simple-webapp-color

ENV variables in kubernetes

  • 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
    

    env

  • There are other ways of setting the environment variables such as ConfigMaps and Secrets

    cms

K8s Reference Docs