By having envsubst to the container, an Init pod or any type of pod/deployment can grab the already installed environment variables in the pod/deployment and create the more precise configuration files to the pod/deployment.
Example:
/etc/database/creds-template.conf
Will allow like ${DB_USERNAME} and ${DB_PASSWORD} that are already set in environment like k8s secret mounts or environment secrets references to be substituted so that the original file, at rest, does NOT have the creds exposed.
By having envsubst to the container, an Init pod or any type of pod/deployment can grab the already installed environment variables in the pod/deployment and create the more precise configuration files to the pod/deployment. Example: /etc/database/creds-template.conf
Will allow like ${DB_USERNAME} and ${DB_PASSWORD} that are already set in environment like k8s secret mounts or environment secrets references to be substituted so that the original file, at rest, does NOT have the creds exposed.