About MCaaS
Environment Variables
This section will explain the different environment variables the applications can access when deployed to the Kubernetes platform.
MCaaS Default Variables
MCaaS team will provide various environment variables for applications deployed on the Kubernetes platform to use. The following are names and example values of the variables applications can access:
MCAAS_TENANT_SHORT_CODE=FCS
MCAAS_MODULE_SHORT_CODE=MOD1
MCAAS_APPLICATION_SHORT_CODE=APP1
MCAAS_SERVICE_SHORT_CODE=SVC1
MCAAS_ENVIRONMENT=development
MCAAS_IMAGE=123456789.dkr.ecr.us-east-1.amazonaws.com/MOD1-APP1-SVC1:dev-abcdefg123456789
MCAAS_GITHUB_ENTERPRISE_URL="https://github.helix.gsa.gov/"
The values of these default variables are derived from HelmRelease
file of the application:
# required labels
mcaasLabels:
tenantShortCode: FCS
moduleShortCode: MOD
applicationShortCode: APP
serviceShortCode: SVC
environment: development
image:
repository: <ecr-repository>
pullPolicy: IfNotPresent
tag: <git-sha-tag>
Adding Custom Environment Variables
You can also add your own environment variables as part of the deployment if needed. They can be added either via ConfigMap
or extraEnv
within HelmRelease
file of the application deployment.
To use ConfigMap
to add environment variables:
configMap:
create: true
useAsVolume: false
data:
key1: value1
key2: value2
# Use config map value as environment variable
envFromConfigMap:
- name: varname1 # name that is accessible in pod environment
key: key1 # key to the config map value
- name: varname2
key: key2
If useAsVolume
is set to true, the values can be accessed under mount path of /configmap
as files.
To create environment variables without using ConfigMap
:
extraEnv:
- name: VARNAME # name that is accessible in pod environment
value: value1
To use secrets from AWS Secrets Manager as environment variables, please refer to Secrets Management section for more information.