Chapter 6. Using the Red Hat Developer Hub Operator to run Developer Hub with your custom configuration
Use the Developer Hub Operator to run Red Hat Developer Hub with your custom configuration by creating your Backstage custom resource (CR) that can perform the following actions:
- Mount files provisioned in your custom config maps.
- Inject environment variables provisioned in your custom secrets.
Prerequisites
-
By using the OpenShift CLI (
oc), you have access, with developer permissions, to the OpenShift Container Platform cluster aimed at containing your Developer Hub instance. - Chapter 2, Installing the Red Hat Developer Hub Operator
- Chapter 4, Provisioning your custom Red Hat Developer Hub configuration
Procedure
Author your Backstage CR in a
my-rhdh-custom-resource.yamlfile to use your custom config maps and secrets.my-rhdh-custom-resource.yamlcustom resource example with dynamic plugins and RBAC policies config maps, and external PostgreSQL database secrets.apiVersion: rhdh.redhat.com/v1alpha3 kind: Backstage metadata: name: <my-rhdh-custom-resource> spec: application: appConfig: mountPath: /opt/app-root/src configMaps: - name: my-rhdh-app-config - name: rbac-policies dynamicPluginsConfigMapName: dynamic-plugins-rhdh extraEnvs: envs: - name: HTTP_PROXY value: 'http://10.10.10.105:3128' - name: HTTPS_PROXY value: 'http://10.10.10.106:3128' - name: NO_PROXY value: 'localhost,example.org' secrets: - name: my-rhdh-secrets extraFiles: mountPath: /opt/app-root/src secrets: - name: my-rhdh-database-certificates-secrets key: postgres-crt.pem, postgres-ca.pem, postgres-key.key replicas: 2 database: enableLocalDb: falseapplicationappConfig-
Register your
my-rhdh-app-configandrbac-policiesconfig maps. dynamicPluginsConfigMapName-
Register your
dynamic-plugins-rhdhconfig map. extraEnvsenv- Enter your proxy environment variables.
secrets-
Register your
<my_product_secrets>andmy-rhdh-database-secretssecrets.
extraFilessecrets-
Register the
postgres-crt.pem,postgres-ca.pem, andpostgres-key.keyfiles contained in themy-rhdh-database-certificates-secretssecret.
replicas- Enable high availability (HA) by increasing the replicas count to a value higher or equal to 2.
databaseenableLocalDb- Use your external PostgreSQL database rather than the internal PostgreSQL database.
Apply your Backstage CR to start or update your Developer Hub instance.
$ oc apply --filename=my-rhdh-custom-resource.yaml --namespace=my-rhdh-project