In previous articles, we described how components, APIs, resources, and Templates are used within Red Hat Developer Hub to map enterprise service offerings and enable discovery with teams. Today the focus is on the installation of Developer Hub in a basic configuration.
The large amount of documentation and steps for building, configuring, and installing upstream Backstage is daunting, for all but the most in-tune user. An admin must consider databases, authentication, plug-ins, and homepage setup before beginning to evaluate Backstage. Red Hat Developer Hub simplifies this process with opinionated defaults, allowing new users to ease into exploring features and experimentation. Learn how Developer Hub simplifies Backstage configuration and allows teams to focus on their enterprise components instead of configuration.
We will explore how to install Developer Hub through a Helm chart or operators for ease of use.
Installing Developer Hub with the operator
Installing Developer Hub follows the standard pattern for other operators. To install the operator, we require a namespace in Red Hat OpenShift, the creation of an OperatorGroup, and finally the creation of the subscription to instantiate the operator. Save the manifests, then use oc apply -f <file>.yaml to apply them to your cluster in order.
namespace.yaml
---
kind: Namespace
apiVersion: v1
metadata:
name: rhdh-operatoroperatorgroup.yaml
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: rhdh-operator
namespace: rhdh-operator
spec:
upgradeStrategy: Defaultsubscription.yaml
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: rhdh
namespace: rhdh-operator
spec:
channel: fast
installPlanApproval: Automatic
name: rhdh
source: redhat-operators
sourceNamespace: openshift-marketplaceAfter you’ve applied the subscription and the operator finishes installing, we can create our Backstage custom resource. This manifest controls the configuration and deployment of Developer Hub. This simple manifest will install an instance of Developer Hub with a local postgresql instance.
Backstage.yaml
---
apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage
metadata:
name: developer-hub
labels:
app.kubernetes.io/name: backstage
namespace: rhdh-operator
spec:
application:
appConfig:
mountPath: /opt/app-root/src
extraFiles:
mountPath: /opt/app-root/src
replicas: 1
route:
enabled: true
database:
enableLocalDb: trueAfter a few minutes, your Developer Hub instance should be deployed and ready. To retrieve the URL, look at the provided route.
$ oc get route backstage-developer-hub -n rhdh-operator -o=jsonpath="{.spec.host}"
backstage-developer-hub-rhdh-operator.apps-crc.testingAt this point, the guest user is available to view the UI, but this user has very few permissions. To enable this user to have more permissions, we can enable the Allow Outside Development option.
Enabling guest user permissions
This action provides the guest user with elevated permissions to Developer Hub. You should only use this in a proof-of-concept or experimental environment.
Create a ConfigMap to use to augment Developer Hub’s application configuration. This configmap will contain a file called “app-config.yaml” used to override the default configurations. We will enable a feature to give the guest user more permission to the Developer Hub APIs for experimentation purposes.
app-config.yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: app-config-rhdh
namespace: rhdh-operator
data:
app-config.yaml: |
app:
title: My Red Hat Developer Hub Instance
auth:
environment: development
providers:
guest:
dangerouslyAllowOutsideDevelopment: trueAfter applying the ConfigMap to your operator namespace, the Backstage CR must be modified to recognize the new configuration. This is done by adding the name of the ConfigMap to the “appConfig” section in the specification.
Backstage.yaml
---
apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage
metadata:
name: developer-hub
labels:
app.kubernetes.io/name: backstage
namespace: rhdh-operator
spec:
application:
appConfig:
configMaps:
- name: app-config-rhdh
mountPath: /opt/app-root/src
extraFiles:
mountPath: /opt/app-root/src
replicas: 1
route:
enabled: true
database:
enableLocalDb: trueYou can quickly do this with a patch.
oc patch backstage developer-hub -n rhdh-operator --type merge --patch '{"spec": {"application": {"appConfig": {"configMaps": [{"name": "app-config-rhdh"}]}}}}'After the Developer Hub container restarts and becomes ready, the guest user will have permissions to add components, APIs, or just view the administration panel for extensions.
Final thoughts
In this article, we created a basic install of Red Hat Developer Hub with elevated permissions to the guest user as an evaluation. In the next article, we will build on this with configuration options allowing integration with GitHub, importing static catalogs, and enabling dynamic plug-ins. Take advantage of the trial to explore Red Hat Developer Hub.