Description of problem:
The Backstage CRD allows to declare environment variables for the pod of RHDH and they are only added into the backstage-backend container, but not into the init container. There is an example of usage to declare the registry authentication file (`REGISTRY_AUTH_FILE`) to pull images successfully from a private container image registry.
Prerequisites (if any, like setup, operators/versions):
Tested in a RDHD instance operated by the Operator (but it seems that it could happen into an instance managed by the Helm Chart.)
Steps to Reproduce
- Declare some environment variables in a Backstage CR as:
spec:
application:
appConfig:
configMaps:
- name: rhdh-app-config
mountPath: /opt/app-root/src
dynamicPluginsConfigMapName: rhdh-dynamic-plugins
extraEnvs:
envs:
- name: NODE_TLS_REJECT_UNAUTHORIZED
value: '0'
- name: LOG_LEVEL
value: debug
- name: REGISTRY_AUTH_FILE
value: /opt/app-root/src/.config/.dockerconfigjson
- Apply the changes and confirm the variables defined
- The backstage-backend container includes them:
- The install-dynamic-plugins init container does not include them:
Actual results:
The environment variables are only declared into the backend container.
Expected results:
The environment variables are also declared into the init container.
Reproducibility (Always/Intermittent/Only Once):
Build Details:
Additional info (Such as Logs, Screenshots, etc):
Another alternative it could be to define which environment variables must be declared for the init container. Maybe with an definition such as:
spec:
application:
appConfig:
configMaps:
- name: rhdh-app-config
mountPath: /opt/app-root/src
dynamicPluginsConfigMapName: rhdh-dynamic-plugins
extraEnvs:
envs:
- name: NODE_TLS_REJECT_UNAUTHORIZED
value: '0'
- name: LOG_LEVEL
value: debug
initExtraEnvs:
- name: REGISTRY_AUTH_FILE
value: /opt/app-root/src/.config/.dockerconfigjson
- is duplicated by
-
RHDHBUGS-1988 NODE_TLS_REJECT_UNAUTHORIZED should also apply to the backstage init container
-
- Closed
-
- is incorporated by
-
RHIDP-8715 Enable configuration in Backstage CR for mounting files and injecting env variables into non-backstage-backend containers
-
- Release Pending
-
- relates to
-
RHDHBUGS-872 How to pull oci images of dynamic plugins from a private container image registry
-
- Closed
-
-
RHIDP-8713 Enable configuration in Backstage CR for mounting files and injecting env variables into non-backstage-backend containers
-
- In Progress
-