Chapter 1. Deploying Developer Hub on AKS with the Operator You can deploy your Developer Hub on AKS using the Red Hat Developer Hub Operator. Procedure Obtain the Red Hat Developer Hub Operator manifest file, named rhdh-operator-<VERSION>.yaml , and modify the default configuration of db-statefulset.yaml and deployment.yaml by adding the following fragment: securityContext: fsGroup: 300 Following is the specified locations in the manifests: db-statefulset.yaml: | spec.template.spec deployment.yaml: | spec.template.spec Apply the modified Operator manifest to your Kubernetes cluster: kubectl apply -f rhdh-operator-<VERSION>.yaml Note Execution of the command is cluster-scoped and requires appropriate cluster privileges. Create an ImagePull Secret named rhdh-pull-secret using your Red Hat credentials to access images from the protected registry.redhat.io as shown in the following example: kubectl -n <your_namespace> create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<redhat_user_name> \ --docker-password=<redhat_password> \ --docker-email=<email> Create an Ingress manifest file, named rhdh-ingress.yaml , specifying your Developer Hub service name as follows: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: rhdh-ingress namespace: <your_namespace> spec: ingressClassName: webapprouting.kubernetes.azure.com rules: - http: paths: - path: / pathType: Prefix backend: service: name: backstage-<your-CR-name> port: name: http-backend To deploy the created Ingress, run the following command: kubectl -n <your_namespace> apply -f rhdh-ingress.yaml Create a ConfigMap named app-config-rhdh containing the Developer Hub configuration using the following example: apiVersion: v1 kind: ConfigMap metadata: name: app-config-rhdh data: "app-config-rhdh.yaml": | app: title: Red Hat Developer Hub baseUrl: https://<app_address> backend: auth: externalAccess: - type: legacy options: subject: legacy-default-config secret: "USD{BACKEND_SECRET}" baseUrl: https://<app_address> cors: origin: https://<app_address> Create a Secret named secrets-rhdh and add a key named BACKEND_SECRET with a Base64-encoded string value as shown in the following example: apiVersion: v1 kind: Secret metadata: name: secrets-rhdh stringData: BACKEND_SECRET: "xxx" Create a Custom Resource (CR) manifest file named rhdh.yaml and include the previously created rhdh-pull-secret as follows: apiVersion: rhdh.redhat.com/v1alpha1 kind: Backstage metadata: name: <your-rhdh-cr> spec: application: imagePullSecrets: - rhdh-pull-secret appConfig: configMaps: - name: "app-config-rhdh" extraEnvs: secrets: - name: "secrets-rhdh" Apply the CR manifest to your namespace: kubectl -n <your_namespace> apply -f rhdh.yaml Access the deployed Developer Hub using the URL: https://<app_address> , where <app_address> is the Ingress address obtained earlier (for example, https://108.141.70.228 ). Optional: To delete the CR, run the following command: kubectl -n <your_namespace> delete -f rhdh.yaml

Commands:
securityContext: fsGroup: 300
db-statefulset.yaml: | spec.template.spec deployment.yaml: | spec.template.spec
apply -f rhdh-operator-<VERSION>.yaml
-n <your_namespace> create secret docker-registry rhdh-pull-secret --docker-server=registry.redhat.io --docker-username=<redhat_user_name> --docker-password=<redhat_password> --docker-email=<email>
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: rhdh-ingress namespace: <your_namespace> spec: ingressClassName: webapprouting.kubernetes.azure.com rules: - http: paths: - path: / pathType: Prefix backend: service: name: backstage-<your-CR-name> port: name: http-backend
-n <your_namespace> apply -f rhdh-ingress.yaml
apiVersion: v1 kind: ConfigMap metadata: name: app-config-rhdh data: "app-config-rhdh.yaml": | app: title: Red Hat Developer Hub baseUrl: https://<app_address> backend: auth: externalAccess: - type: legacy options: subject: legacy-default-config secret: "USD{BACKEND_SECRET}" baseUrl: https://<app_address> cors: origin: https://<app_address>
apiVersion: v1 kind: Secret metadata: name: secrets-rhdh stringData: BACKEND_SECRET: "xxx"
apiVersion: rhdh.redhat.com/v1alpha1 kind: Backstage metadata: name: <your-rhdh-cr> spec: application: imagePullSecrets: - rhdh-pull-secret appConfig: configMaps: - name: "app-config-rhdh" extraEnvs: secrets: - name: "secrets-rhdh"
-n <your_namespace> apply -f rhdh.yaml
-n <your_namespace> delete -f rhdh.yaml