This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository provides PR-driven deployment of Red Hat Developer Hub (RHDH) test instances on OpenShift clusters. Users open a PR (optionally with custom configuration changes) and use the /test deploy slash command in PR comments to trigger automated deployment via Prow CI. The system handles cluster provisioning, Keycloak auth setup, RHDH installation, and posts deployment URLs and credentials back to the PR.
Two installation methods are supported (Helm and Operator), with optional Orchestrator components. Local deployment is also possible as a secondary use case. The codebase is entirely Bash scripts and YAML configuration.
Users deploy test instances by commenting on PRs:
/test deploy <install-type> <version> [duration]
install-type:helmoroperatorversion:1.9,1.9-190-CI,nextduration: optional cleanup timer (e.g.,4h,2.5h; default3h)
Examples:
/test deploy helm 1.7 4h
/test deploy operator 1.6 2.5h
The bot responds with RHDH URL, OpenShift console link, and cluster credentials (from Vault). Users can test custom configurations by modifying config files in the PR branch before deploying. Max two concurrent instances.
Prow job status: https://prow.ci.openshift.org/?repo=redhat-developer%2Frhdh-test-instance&type=presubmit&job=pull-ci-redhat-developer-rhdh-test-instance-main-deploy
# Helm deployment (primary method)
make deploy-helm VERSION=1.9 NAMESPACE=rhdh
# Helm with orchestrator
make deploy-helm VERSION=1.9 ORCH=true
# Operator deployment (requires install-operator first)
make install-operator VERSION=1.9
make deploy-operator VERSION=1.9make undeploy-helm # Remove Helm-deployed RHDH
make undeploy-operator # Remove Operator-deployed RHDH
make undeploy-infra # Remove Keycloak
make clean # Remove everything (RHDH + Keycloak)make status # Show pod status in namespace
make logs # Tail RHDH pod logs
make url # Print the RHDH portal URL| Variable | Default | Description |
|---|---|---|
NAMESPACE |
rhdh |
OpenShift namespace for RHDH |
VERSION |
1.9 |
RHDH version (supports 1.9, 1.9-190-CI, next) |
ORCH |
false |
Enable Orchestrator components |
CATALOG_INDEX_TAG |
auto-detected | Plugin catalog index tag |
deploy.sh (entry point)
├── Parses args: method (helm/operator), version, namespace, --with-orchestrator
├── Sources secrets from .env (local) or Vault (CI)
├── Deploys Keycloak via utils/keycloak/keycloak-deploy.sh
├── Creates namespace and app-config ConfigMap from config/
└── Delegates to:
├── helm/deploy.sh — Resolves version from Quay API, installs RHDH Helm chart
└── operator/deploy.sh — Applies Backstage CR after optional operator install
- config/ — RHDH application config (app-config-rhdh.yaml), dynamic plugin definitions, and Kubernetes Secret templates. These are applied as ConfigMaps/Secrets to the cluster.
- helm/ — Helm-specific deployment:
deploy.shresolves chart versions from Quay,value_file.yamlprovides Helm overrides. - operator/ — Operator-based deployment:
install-operator.shinstalls the RHDH operator CRD,deploy.shapplies the Backstage CR fromsubscription.yaml. - utils/keycloak/ — Full Keycloak deployment automation: Helm install, realm/client/user/group creation via Keycloak REST API. Test users defined in
users.json, groups ingroups.json.
- Keycloak is deployed first (Bitnami Helm chart) with an OIDC client (
rhdh-client) and test users (test1/test2, password:test1@123/test2@123). - Environment variables (Keycloak URLs, credentials) are exported and substituted into
config/rhdh-secrets.yaml. config/app-config-rhdh.yamlconfigures RHDH with OIDC auth pointing to Keycloak and catalog entity locations from GitHub.- For Helm: the RHDH chart is installed with dynamic plugins config. For Operator: a Backstage CR is applied referencing the ConfigMaps.
- When
ORCH=true, orchestrator plugins are merged intodynamic-plugins.yamland serverless operators are installed.
- PR deployments (primary): secrets pulled automatically from Vault at
vault.ci.openshift.orgunderselfservice/rhdh-test-instance/ - Local deployments: secrets loaded from
.envfile (copy.env.exampleto.env); Vault is used when.envis absent
oc, helm, jq, curl, podman (or docker for container-based operator install)
Helm deploy resolves semantic versions (e.g., 1.9) to the latest patch by querying the Quay.io API for available chart tags. CI versions like 1.9-190-CI and next are passed through directly.