e2e-deploy-rhdh
Skill171 starsChanged 20 days agoApache-2.0View on GitHub
Deploy RHDH to an OpenShift cluster using local-run.sh for E2E test execution, with autonomous error recovery for deployment failures
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 6 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Use this skill when you need a running RHDH instance to reproduce and fix a test failure.
- Distinctive: line 17
Before running the deployment, verify these tools are installed:
- Very specific: line 35
Only set RHDH_E2E_SECRETS_BIN when explicitly testing a different CLI build.
- Distinctive: line 46
If resources are insufficient:
- Distinctive: line 67
If a deployment container is already running, wait for it to finish instead of starting a new one.
- Very specific: line 114
WARNING: Do NOT use shortened job names like nightly-ocp-helm for -j — these do not match the glob patterns in openshift-ci-tests.sh.
- Very specific: line 146
After local-run.sh completes (with -s for OCP jobs, or after full execution for K8s jobs), run Playwright on the host against the URL …
- Very specific: line 159
Use the actual deployed namespaces if they differ from these defaults.
- Very specific: line 164
Verify RHDH is accessible:
- Very specific: line 192
Node.js errors: Check for JavaScript errors in logs that indicate code issues
- Very specific: line 202
Image doesn't exist: Verify on quay.io: curl -s 'https://quay.io/api/v1/repository/rhdh/rhdh-hub-rhel9/tag/?filter_tag_name=like:<tag>'
- Very specific: line 203
Pull secret missing: Check namespace::setup_image_pull_secret in .ci/pipelines/lib/namespace.sh
- Distinctive: line 204
Registry auth: Ensure the pull secret has correct credentials
- Very specific: line 215
Values file error: Check merged values against .ci/pipelines/value_files/values_showcase.yaml
- Very specific: line 216
Chart version mismatch: Verify chart version with helm::get_chart_version from .ci/pipelines/lib/helm.sh
- Distinctive: line 229
Operator not installed: Check CatalogSource and Subscription
- Very specific: line 230
CRD not ready: Wait for CRD with k8s_wait::crd pattern from .ci/pipelines/lib/k8s-wait.sh
- Distinctive: line 234
When deployment issues stem from the operator or chart, search the relevant repos using whichever tool is available.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy RHDH
Deploy Red Hat Developer Hub to a cluster for E2E test execution using the existing local-run.sh workflow.
When to Use
Use this skill when you need a running RHDH instance to reproduce and fix a test failure.
Prerequisites
Before running the deployment, verify these tools are installed:
# Required tools (local-run.sh checks these automatically)
podman --version # Container runtime
oc version # OpenShift CLI
kubectl version --client # Kubernetes CLI
bw --version # Bitwarden CLI (for local secrets)
node --version # Runtime and standalone stream decoder
e2e-tests/node_modules/.bin/rhdh-e2e-secrets --help # Project-pinned secret profile CLI
jq --version # JSON processor
curl --version # HTTP client
rsync --version # File sync
bc --version # Calculator (for resource checks)Install dependencies with yarn install in e2e-tests to provide the project-pinned CLI,
then export an unlocked Bitwarden session with export BW_SESSION=$(bw unlock --raw).
Only set RHDH_E2E_SECRETS_BIN when explicitly testing a different CLI build.
Podman Machine Requirements
The podman machine must be running with adequate resources:
podman machine inspect | jq '.Resources'
# Requires: >= 8GB RAM, >= 4 CPUsIf resources are insufficient:
podman machine stop
podman machine set --memory 8192 --cpus 4
podman machine startDeployment Using local-run.sh
The primary deployment method uses e2e-tests/local-run.sh, which handles Bitwarden secret
selection, cluster service account setup, RHDH deployment, and test execution.
Execution Rules
CRITICAL — deployment is a long-running operation:
- Never run
local-run.shin the background. Operator installations can take 20-30 minutes. Use the Bash tool withtimeout: 600000(10 minutes) and if it times out, check the container log — do NOT assume failure. - Before starting a deployment, check for existing containers:
If a deployment container is already running, wait for it to finish instead of starting a new one. Monitor via the container log:podman ps --format "{{.Names}} {{.Status}}" | grep -i rhdh-e2e-runnertail -f e2e-tests/.local-test/container.log - Never launch concurrent deployments. Two deployments to the same cluster will race and both fail. If a deployment appears stuck, check the container log and cluster state before deciding it failed. The runner rejects concurrent invocations in the same checkout and holds its lock until the wrapped runner stops, including on cancellation. After an uncatchable termination, confirm the previous runner has stopped before removing the stale lock as documented in
e2e-tests/README.md. - How to detect actual failure vs slow progress: The operator install script outputs detailed debug logs. If the container log shows active progress (timestamps advancing), the deployment is still running. Only consider it failed if:
- The podman container has exited (
podman psshows no running container) - AND the container log shows an error message (e.g., "Failed install RHDH Operator")
- The podman container has exited (
CLI Mode (Preferred)
CRITICAL: CLI mode requires -r and -t. Always supply -j with the full Prow job name to select the intended job; otherwise the runner defaults to the main OCP Helm PR job. Missing -r or -t enters interactive mode and can hang in automated contexts.
cd e2e-tests
./local-run.sh -j "$PROW_JOB_NAME" -r "$IMAGE_REPO" -t "$IMAGE_TAG"Example — OCP job (deploy-only with -s):
cd e2e-tests
./local-run.sh -j periodic-ci-redhat-developer-rhdh-main-e2e-ocp-v4-20-helm-nightly -r rhdh-community/rhdh -t next -sExample — K8s job (AKS/EKS/GKE) (full execution, no -s):
cd e2e-tests
./local-run.sh -j periodic-ci-redhat-developer-rhdh-main-e2e-eks-helm-nightly -r rhdh-community/rhdh -t nextExample — disconnected OCP nightlies (requires a real OpenShift cluster; connected is fine; no bastion):
cd e2e-tests
# Operator: prepare uses --to-registry OCP_INTERNAL; MIRROR_* bootstrapped in-container
./local-run.sh -j periodic-ci-redhat-developer-rhdh-main-e2e-ocp-disconnected-operator-nightly -r rhdh-community/rhdh -t next -s
# Helm: oc-mirror to the cluster image registry route
./local-run.sh -j periodic-ci-redhat-developer-rhdh-main-e2e-ocp-disconnected-helm-nightly -r rhdh-community/rhdh -t next -slocal-run.sh refuses disconnected jobs unless oc is logged into OpenShift. It passes DISCONNECTED=true and LOCAL_DISCONNECTED=1; the runner writes the mirror CA under ${SHARED_DIR}/disconnected-mirror/ and keeps the merged pull secret in a private container-only temporary directory. Prefer Operator first when validating OCP_INTERNAL, then Helm. Air-gap prepare details live in rhdh-operator — do not paste them here.
Parameters:
-j / --job: The full Prow CI job name extracted from the Prow URL. Theopenshift-ci-tests.shhandler uses bash glob patterns (like*ocp*helm*nightly*) to match, so the full name works correctly. Example:periodic-ci-redhat-developer-rhdh-main-e2e-ocp-v4-20-helm-nightly-r / --repo: Image repository (required for CLI mode — without it the script enters interactive mode)-t / --tag: Image tag (e.g.,1.9,next)-s / --skip-tests: Deploy only, skip test execution. OCP jobs only — K8s jobs (AKS, EKS, GKE) do not support this flag and require the full execution pipeline
WARNING: Do NOT use shortened job names like nightly-ocp-helm for -j — these do not match the glob patterns in openshift-ci-tests.sh.
Image Selection
Refer to the e2e-fix-workflow rule for the release branch to image repo/tag mapping table.
Deploy-Only Mode (OCP Jobs Only)
For OCP jobs, deploy without running tests so you can run specific tests manually:
./local-run.sh -j "$PROW_JOB_NAME" -r "$IMAGE_REPO" -t "$IMAGE_TAG" -sNote: K8s jobs (AKS, EKS, GKE) do not support deploy-only mode. They require the full execution pipeline — run without -s.
What local-run.sh Does
- Validates prerequisites: Checks required tools, podman resources, the project-pinned secrets CLI, and the Bitwarden session
- Verifies the image: Checks the image exists on quay.io via the Quay API
- Pulls the runner image:
quay.io/rhdh-community/rhdh-e2e-runner:main - Loads Bitwarden secrets: Retrieves and validates the
rhdh-qeprofile throughrhdh-e2e-secretsbefore any cluster mutation - Sets up cluster access: Creates
rhdh-local-testerservice account with cluster-admin, generates an 8-hour token - Copies the repo: Syncs the local repo to
.local-test/rhdh/(excludes node_modules) - Runs a Podman container: Executes
container-init.shinside the runner image, which:- Receives the profile-selected FD 3 stream through Podman stdin and decodes it into private files in
/tmp/secretstmpfs before dependency installation, matching the original CI sourcing path - Logs into the cluster
- Sets platform-specific environment variables
- Runs
.ci/pipelines/openshift-ci-tests.shfor deployment
- Receives the profile-selected FD 3 stream through Podman stdin and decodes it into private files in
Post-Deployment: Setting Up for Manual Testing
After local-run.sh completes (with -s for OCP jobs, or after full execution for K8s jobs), run Playwright on the host against the URL printed by the deployment:
export BW_SESSION=$(bw unlock --raw)
export BASE_URL=https://showcase.example.com
export NAME_SPACE=showcase
e2e-tests/local-test.sh -- --project=showcase --headed
# or
export BASE_URL=https://showcase-rbac.example.com
export NAME_SPACE_RBAC=showcase-rbac
e2e-tests/local-test.sh -- --project=showcase-rbac --headedUse the actual deployed namespaces if they differ from these defaults. Set
NAME_SPACE_RUNTIME for runtime tests. local-test.sh loads the Bitwarden profile for Playwright. Set
K8S_CLUSTER_URL and K8S_CLUSTER_TOKEN explicitly for cluster-aware projects; the script does
not generate them or read deployment configuration.
Verify RHDH is accessible:
curl -sSk "$BASE_URL" -o /dev/null -w "%{http_code}"
# Should return 200Deployment Error Recovery
Common Deployment Failures
CrashLoopBackOff
Symptoms: Pod repeatedly crashes and restarts.
Investigation:
# Check pod status
oc get pods -n <namespace>
# Check pod logs
oc logs -n <namespace> <pod-name> --previous
# Check events
oc get events -n <namespace> --sort-by=.lastTimestampCommon causes and fixes:
- Missing ConfigMap: The app-config ConfigMap wasn't created → check
.ci/pipelines/resources/config_map/for the correct template - Bad plugin configuration: A dynamic plugin is misconfigured → check
dynamic-plugins-configConfigMap against.ci/pipelines/resources/config_map/dynamic-plugins-config.yaml - Missing secrets: Required secrets not mounted → verify secrets exist in the namespace
- Node.js errors: Check for JavaScript errors in logs that indicate code issues
ImagePullBackOff
Investigation:
oc describe pod -n <namespace> <pod-name> | grep -A5 "Events"Common causes:
- Image doesn't exist: Verify on quay.io:
curl -s 'https://quay.io/api/v1/repository/rhdh/rhdh-hub-rhel9/tag/?filter_tag_name=like:<tag>' - Pull secret missing: Check
namespace::setup_image_pull_secretin.ci/pipelines/lib/namespace.sh - Registry auth: Ensure the pull secret has correct credentials
Helm Install Failure
Investigation:
helm list -n <namespace>
helm status <release-name> -n <namespace>Common causes:
- Values file error: Check merged values against
.ci/pipelines/value_files/values_showcase.yaml - Chart version mismatch: Verify chart version with
helm::get_chart_versionfrom.ci/pipelines/lib/helm.sh
Operator Deployment Failure
Investigation:
oc get backstage -n <namespace>
oc describe backstage <name> -n <namespace>
oc get csv -n <namespace> # Check operator subscription statusCommon causes:
- Backstage CR misconfigured: Compare against
.ci/pipelines/resources/rhdh-operator/rhdh-start.yaml - Operator not installed: Check CatalogSource and Subscription
- CRD not ready: Wait for CRD with
k8s_wait::crdpattern from.ci/pipelines/lib/k8s-wait.sh
Cross-Repo Investigation
When deployment issues stem from the operator or chart, search the relevant repos using whichever tool is available. Try them in this order and use the first one that works:
- Sourcebot (if available): search
rhdh-operatorandrhdh-chartrepos for specific error patterns or configuration keys - Context7 (if available): query
redhat-developer/rhdh-operatororredhat-developer/rhdh-chartfor docs and code snippets - Fallback —
gh search code:gh search code '<pattern>' --repo redhat-developer/rhdh-operatororredhat-developer/rhdh-chart - Fallback — local clone: clone the repo into a temp directory and grep for the pattern
Key areas to look for:
- rhdh-operator: Backstage CR configuration, CatalogSource setup, operator installation scripts
- rhdh-chart: Helm values schema, chart templates, default configurations
Reference Files
- Main deployment scripts:
.ci/pipelines/openshift-ci-tests.sh,.ci/pipelines/utils.sh - Library scripts:
.ci/pipelines/lib/helm.sh,.ci/pipelines/lib/operators.sh,.ci/pipelines/lib/k8s-wait.sh,.ci/pipelines/lib/testing.sh - Helm values:
.ci/pipelines/value_files/ - ConfigMaps:
.ci/pipelines/resources/config_map/ - Operator CRs:
.ci/pipelines/resources/rhdh-operator/ - Environment variables:
.ci/pipelines/env_variables.sh
In this repository20 other files it gives its agents.
- .cursor/rules/add_extension_metadata.mdcCursor rule
- .cursor/rules/ci-e2e-testing.mdcCursor rule
- .cursor/rules/e2e-coverage-imports.mdcCursor rule
- .cursor/rules/e2e-fix-workflow.mdcCursor rule
- .cursor/rules/github-workflows-security.mdcCursor rule
- .cursor/rules/managing-ai-rules.mdcCursor rule
- .cursor/rules/playwright-locators.mdcCursor rule
- e2e-diagnose-and-fixSkill
- e2e-parse-ci-failureSkill
- e2e-reproduce-failureSkill
- e2e-submit-and-reviewSkill
- e2e-verify-fixSkill
- patch-backstageSkill
- e2e-deploy-rhdhSkill
- e2e-diagnose-and-fixSkill
- e2e-parse-ci-failureSkill
- e2e-reproduce-failureSkill
- e2e-submit-and-reviewSkill
- e2e-verify-fixSkill
- patch-backstageSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

