This is a simple guide to get started with Red Hat Developer Hub and:
- Azure AD (Or Entra ID as it's now called...) for login.
- A private Azure DevOps org to hold your GPTs, and
- The ability to create new private Azure Repos with Red Hat Developer Hub.
This guide is based on Red Hat Developer Hub 1.0. To set this up for yourself you will need:
- An OpenShift cluster (it's possible OpenShift Local will work, but I haven't tried this myself).
- An Azure account with the ability to create a new App Registration (or re-use an existing one).
- An Azure DevOps organization.
First, create (or re-use) an App Registration. You will need all the standard details of this App Registration later when configuring Red Hat Developer Hub, so make sure to note the following:
- AZURE_CLIENT_ID
- AZURE_CLIENT_SECRET
- AZURE_TENANT_ID
You will also need to set a callback URL to redirect a user back to Red Hat Developer Hub once they login. The callback URL should match the following pattern that assumes you will install Red Hat Developer Hub in the namespace "rhdh":
https://developer-hub-rhdh.apps.<cluster url>/api/auth/microsoft/handler/frame
If you install Red Hat Developer Hub into a different namespace, then the URL pattern would be:
https://developer-hub-<namespace>.apps.<cluster url>/api/auth/microsoft/handler/frame
Of course, be sure to substitute the proper values before registering this callback url.
In your Azure DevOps Project, click on the "Gear" icon at the top-right beside your account link. This should be the "User Settings" options.
From this list, click on Personal Access Tokens and create a new Token. Give it whatever name makes sense to you. I used "rhdh-demo".
Make sure you have the correct Azure DevOps Organization selected and choose an appropriate expiration time. Remember, you will need to update your Red Hat Developer Hub configuration with a new token once this one expires, so you might want to pick a longer expiration time.
For demo purposes, I gave my token "Full Access", however, I'm sure you can probably scope this down considerably. I haven't tested this, but "Full Access" to just "Code" is likely good enough. Basically, Red Hat Developer Hub needs the rights to be able to read, update, and create new repos.
Make sure to note the actual token that gets created, as you won't be able to look it up again later.
First, create a new namespace for Red Hat Developer Hub. I'm simply using "rhdh":
oc new-project rhdh
Next, update the values in rhdh-secrets.yaml
under the manifests
directory with your App Registration details and your new Personal Access Token.
Review the contents of app-config-rhdh.yaml
. You will need to update the link to the templates list (line 37) with the location of your own templates list. A sample of templates will be added in a different repo shortly.
Apply these manifests to your namespace.
oc apply -k manifests -n rhdh
In the OpenShift Developer View navigate to your rhdh
project.
From here:
- Select +Add From the left navigation menu.
- Select "Helm Chart" (last entry in the "Developer Catalog" tile).
- Search for "Red Hat Developer Hub" and click on that tile.
- Click "Create".
- Leave "Release name" as the default value of
developer-hub
. - Switch to the YAML view ("Configure via: YAML view" radio button).
- Delete the default contents and paste in the contents of
values.yaml
in thehelm
directory of this repo. - Change the value of
clusterRouterBase
(line 5) to the apps url for your cluster (apps.<your cluster domain>
). - Click "Create"
This will spin up a PostgreSQL StatefulSet as well as a Red Hat Developer Hub Deployment. The process should only take a few minutes.
You're done!
Once Red Hat Developer Hub is running, you can click on the route to launch it. If you have configured your App Registration correctly and added the proper data to your secret, you should be able to login via Azure AD.
If you have provided a valid software templates link in your app config, when you click "Create" you should see your Golden Path Templates.
When you create a Golden Path Template instance, the new private repos should be created in your Azure DevOps project.
For more information and advanced configuration, please see the Red Hat Developer Hub 1.0 documentation.