Kubernetes

Generate and set an ENVKEY

First, generate an ENVKEY.

Set an ENVKEY secret

To set an ENVKEY in your cluster, create a secret for it and give it a name (envkey-app-name.environment-name is a good pattern to follow).

kubectl create secret generic core-api.production \
  --from-literal=ENVKEY=YOUR-ENVKEY

Make sure you don't commit your ENVKEYs to version control.

Expose secrets as environment variables

Expose any secrets set in the previous step as ENVKEY environment variables to the appropriate containers:

containers:
  - name: core-api-container
    image: core-api
    env:
      - name: ENVKEY
        valueFrom:
          secretKeyRef:
            name: core-api.production
            key: ENVKEY

Integrate Docker containers

Follow the Docker integration guide to integrate all your cluster's Docker containers.


Did this page help you?