You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 87c2965
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/admin.md
+94-3Lines changed: 94 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,14 +67,105 @@ When creating the Backstage CR, the Operator will try to create a Backstage Pod,
67
67
Also, if Backstage CR configured with *EnabledLocalDb*, it will create a PostgreSQL container pod, configured in *(db-statefulset.yaml).spec.template.spec.Containers[].image*
68
68
69
69
By default, the Backstage Operator is configured to use publicly available images.
70
-
If you plan to deploy to a [restricted environment](https://docs.openshift.com/container-platform/4.14/operators/admin/olm-restricted-networks.html),
70
+
If you plan to deploy to a [restricted environment](https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/disconnected_environments/olm-restricted-networks),
71
71
you will need to configure your cluster or network to allow these images to be pulled.
72
72
For the list of related images deployed by the Operator, see the `RELATED_IMAGE_*` env vars or `relatedImages` section of the [CSV](../bundle/manifests/backstage-operator.clusterserviceversion.yaml).
73
-
See also https://docs.openshift.com/container-platform/4.14/operators/admin/olm-restricted-networks.html
73
+
See also https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/disconnected_environments/olm-restricted-networks
74
+
75
+
#### Plugin Registry Mirroring
76
+
77
+
In air-gapped environments, Backstage dynamic plugins distributed as OCI artifacts need to be mirrored to internal registries. The Backstage Operator supports optional plugin registry mirroring that automatically transforms plugin package URLs to use your internal mirror registries.
78
+
79
+
The mirror configuration uses the same format and matching rules as OpenShift's [ImageDigestMirrorSet (IDMS)](https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/images/image-configuration-classic#images-configuration-registry-mirror_image-configuration) and [ImageTagMirrorSet (ITMS)](https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/images/image-configuration-classic#images-configuration-registry-mirror_image-configuration), making it familiar to OpenShift administrators and allowing direct reuse of existing IDMS/ITMS configurations.
80
+
81
+
**Important:** Unlike OpenShift's IDMS (digest-only) and ITMS (tag-only) which only mirror specific pull types, the operator's mirror configuration works for **both tag-based** (`:v1.0`) **and digest-based** (`@sha256:...`) plugin references. This is because the operator performs application-level URL transformation before the init container pulls plugins, rather than container runtime-level mirroring like IDMS/ITMS.
82
+
83
+
**How it works:**
84
+
85
+
- The operator reads mirror configuration from an optional ConfigMap mounted at `/plugins-mirror/mirrors.yaml`
86
+
- Plugin package URLs with `oci://` prefix are transformed using IDMS-style matching rules before being written to the init container's package list
87
+
- Only OCI URLs are transformed - npm packages, HTTP URLs, and file paths remain unchanged
88
+
- The transformed URLs are visible in the Backstage CR status under `status.plugins`
89
+
90
+
**Configuration:**
91
+
92
+
1. Create a ConfigMap named `plugin-registry-mirror` in the operator's namespace (usually `backstage-system` or `rhdh-operator`):
93
+
94
+
```yaml
95
+
apiVersion: v1
96
+
kind: ConfigMap
97
+
metadata:
98
+
name: plugin-registry-mirror
99
+
namespace: rhdh-operator # Must be in operator namespace
100
+
data:
101
+
mirrors.yaml: |
102
+
# Mirror configuration for plugin OCI images
103
+
# Works for both tag-based (:v1.0) and digest-based (@sha256:...) references
104
+
imageMirrors:
105
+
# Mirror quay.io to internal registry
106
+
- source: quay.io
107
+
mirrors:
108
+
- my-registry.example.com/quay-mirror
109
+
110
+
# Mirror Red Hat registry
111
+
- source: registry.redhat.io
112
+
mirrors:
113
+
- my-registry.example.com/redhat-mirror
114
+
115
+
# Multiple mirrors (first is used, others ignored)
116
+
- source: ghcr.io
117
+
mirrors:
118
+
- primary-mirror.example.com/ghcr
119
+
- backup-mirror.example.com/ghcr
120
+
```
121
+
122
+
2. Restart the operator pod to load the configuration:
3. Verify the transformed URLs in your Backstage CR status:
129
+
130
+
```bash
131
+
kubectl get backstage my-backstage -o jsonpath='{.status.plugins}'| jq
132
+
```
133
+
134
+
**Mirroring rules (based on IDMS):**
135
+
136
+
-**Most specific namespace match**: When multiple sources match a plugin URL, the longest/most specific source wins. For example, if you have both `quay.io` and `quay.io/rhdh` configured, a plugin from `oci://quay.io/rhdh/plugin:1.0` will use the `quay.io/rhdh` mirror configuration.
137
+
-**Only OCI URLs are mirrored**: Plugins specified as `oci://registry.example.com/plugin:tag` or `oci://registry.example.com/plugin@sha256:...` are transformed. npm packages (`@scope/package`), HTTP URLs (`https://...`), and file paths are not affected.
138
+
-**First mirror is used**: If multiple mirrors are specified for a source, only the first one is used (fallback support may be added in future versions).
139
+
140
+
**For OpenShift users with existing IDMS/ITMS:**
141
+
142
+
You can copy mirror entries from your existing ImageDigestMirrorSet or ImageTagMirrorSet:
143
+
144
+
```bash
145
+
# Extract entries from IDMS
146
+
oc get imagedigestmirrorset rhdh-plugins -o jsonpath='{.spec.imageDigestMirrors}'| \
147
+
yq -P 'imageMirrors: .'> mirrors.yaml
148
+
149
+
# OR extract entries from ITMS
150
+
oc get imagetagmirrorset rhdh-plugins -o jsonpath='{.spec.imageTagMirrors}'| \
151
+
yq -P 'imageMirrors: .'> mirrors.yaml
152
+
153
+
# Create ConfigMap from the mirror configuration
154
+
oc create configmap plugin-registry-mirror \
155
+
--from-file=mirrors.yaml \
156
+
-n rhdh-operator
157
+
```
158
+
159
+
**Important notes:**
160
+
161
+
- The ConfigMap must be created **before** the operator starts, or the operator must be restarted after creating/updating the ConfigMap
162
+
- Configuration changes require operator pod restart (acceptable for air-gap scenarios where mirrors rarely change)
163
+
- If the ConfigMap doesn't exist, no mirroring is applied (default behavior)
164
+
- The operator deployment already includes the volume mount configuration with `optional: true`, so the operator will start successfully whether or not the ConfigMap exists
0 commit comments