Skip to content

rm3l/rhdh-test-instance

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RHDH Test Instance

A comprehensive test instance setup for Red Hat Developer Hub (RHDH) on OpenShift, providing a ready-to-use developer portal with authentication, app-config, and dynamic plugin config.

Overview

This project provides automated deployment scripts and configuration files to set up a fully functional RHDH test instance on OpenShift.

Features

  • πŸ€– GitHub PR Integration with /test command for on-demand deployments
  • πŸ“¦ Multiple Install Types: Support for both Helm and Operator (Comming Soon) installation methods
  • πŸ”„ Flexible Version Support: Deploy any RHDH version (latest, semantic versions like 1.7, CI builds like 1.7-98-CI)
  • 🌐 Cluster Information Sharing: Automatic sharing of deployment URLs, OpenShift console access, and cluster credentials
  • πŸ” Integrated Keycloak Authentication: Automatic Keycloak deployment with pre-configured realm and test users
  • πŸ‘₯ Pre-configured Test Users: Ready-to-use test accounts (test1, test2) with authentication setup
  • 🏠 Local Deployment: Support for local development and testing environments
  • ⚑ Resource Management: Automatic cleanup with configurable timers and resource limits
  • 🎯 Instance Limits: Maximum of two concurrent test instances to manage resource usage
  • πŸ’¬ User-friendly feedback with deployment status comments and live URLs
  • πŸ› οΈ Debug & Customization Support: Shared cluster credentials for troubleshooting and custom configurations

GitHub PR Workflow Integration

Deploy test environments directly from Pull Requests using slash commands and test different configurations without local setup.

Slash Commands

The bot supports flexible deployment commands directly from PR comments:

/test deploy <install-type> <version> [duration]

Parameters:

  • install-type: helm or operator (operator Comming Soon)
  • version: Version to deploy (see supported versions below)
  • duration: Optional cleanup timer (e.g., 4h, 2.5h)

Examples:

/test deploy helm 1.7 4h          # Deploy RHDH 1.7 with Helm, cleanup after 4 hours
/test deploy operator 1.6 2.5     # Deploy RHDH 1.6 with Operator, cleanup after 2.5 hours
/test deploy helm 1.7            # Deploy latest CI version with Helm with defaut duration 3h
/test deploy operator 1.7-98-CI   # Deploy specific CI build with Operator

How to Use PR Integration

  1. Comment on any PR on rhdh-test-instance repo:
    /test deploy helm 1.7 4h
    

Feedback Loop

The bot provides comprehensive feedback through PR comments for eg:

πŸš€ Deployed RHDH version: 1.7 using helm

🌐 RHDH URL: https://redhat-developer-hub-rhdh.apps.rhdh-4-17-us-east-2-kz69l.rhdh-qe.devcluster.openshift.com

πŸ–₯️ OpenShift Console: Open Console

πŸ”‘ Cluster Credentials: Available in vault under ocp-cluster-creds with keys:
β€’ Username: CLUSTER_ADMIN_USERNAME
β€’ Password: CLUSTER_ADMIN_PASSWORD

⏰ Cluster Availability: Next 1 hours

Live Status of deploy Job

Prow Status: https://prow.ci.openshift.org/?repo=redhat-developer%2Frhdh-test-instance&type=presubmit&job=pull-ci-redhat-developer-rhdh-test-instance-main-deploy

Job History: https://prow.ci.openshift.org/job-history/gs/test-platform-results/pr-logs/directory/pull-ci-redhat-developer-rhdh-test-instance-main-deploy

Testing Custom Configurations via PRs

Users can deploy different configuration flavors by:

  1. Creating a PR with modified configuration files
  2. Using bot commands to deploy the PR's configuration:
    /test deploy helm 1.7 2h
    

Local Deployment

For local development and testing environments, you can deploy RHDH directly to your OpenShift cluster.

Note: Bring Your Own Cluster (BYOC)
Local deployment requires you to have access to your own OpenShift cluster.

Quick Start

  1. Clone the repository:

    git clone <repository-url>
    cd rhdh-test-instance
  2. Deploy RHDH with Helm:

    ./install.sh helm 1.5-171-CI
  3. Or deploy with the latest main version:

    ./install.sh helm 1.7
  4. Access your RHDH instance: The script will output the URL where your RHDH instance is accessible.

Installation Methods

Method 1: Helm Chart Installation

./install.sh helm <version>

Available versions:

  • 1.7 - Latest stable 1.7 version
  • 1.6 - Latest stable 1.6 version
  • 1.5 - Latest stable 1.5 version
  • 1.7-98-CI - Specific CI build
  • 1.6-45-CI - Specific CI build

Example:

./install.sh helm 1.7

Method 2: Operator Installation (Comming Soon)

./install.sh operator <version> 

Example:

./install.sh operator 1.7

Accessing Your Local RHDH Instance

After successful installation, access your RHDH instance at:

https://redhat-developer-hub-<namespace>.<cluster-router-base>

Login Process

  1. Navigate to the RHDH URL
  2. Click "Sign In"
  3. Use one of the test users (test1/test1@123 or test2/test2@123)
  4. Explore the developer portal features

Configuration

Application Configuration

The main application configuration is stored in config/app-config-rhdh.yaml:

# Key configuration areas:
app:
  baseUrl: "${RHDH_BASE_URL}"
  
auth:
  environment: production
  providers:
    oidc:
      production:
        metadataUrl: "${KEYCLOAK_METADATA_URL}"
        clientId: "${KEYCLOAK_CLIENT_ID}"
        clientSecret: "${KEYCLOAK_CLIENT_SECRET}"

catalog:
  locations:
    - type: url
      target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml

Dynamic Plugins

Configure dynamic plugins in config/dynamic-plugins.yaml:

includes:
  - dynamic-plugins.default.yaml
plugins:
  - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic
    disabled: false

Helm Values

Customize deployment in helm/value_file.yaml:

upstream:
  backstage:
    extraAppConfig:
      - configMapRef: app-config-rhdh
        filename: app-config-rhdh.yaml
    extraEnvVarsSecrets:
      - rhdh-secrets

Authentication with Keycloak

Automatic Keycloak Deployment

The installation script automatically deploys Keycloak with:

  • Admin user: admin / admin123
  • Predefined realm: rhdh
  • Pre-configured OIDC client
  • Test users for development

Test Users

The following test users are created automatically:

Username Password Email Role
test1 test1@123 test1@redhat.com User
test2 test2@123 test2@redhat.com User

Keycloak Configuration

Keycloak is configured with:

  • Realm: rhdh
  • Client ID: rhdh-client

Project Structure

rhdh-test-instance/
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ app-config-rhdh.yaml      # Main RHDH configuration
β”‚   β”œβ”€β”€ dynamic-plugins.yaml      # Dynamic plugins configuration
β”‚   └── rhdh-secrets.yaml         # Kubernetes secrets template
β”œβ”€β”€ helm/
β”‚   └── value_file.yaml           # Helm chart values
β”œβ”€β”€ utils/
β”‚   └── keycloak/
β”‚       β”œβ”€β”€ keycloak-deploy.sh    # Keycloak deployment script
β”‚       β”œβ”€β”€ keycloak-values.yaml  # Keycloak Helm values
β”‚       └── rhdh-client.json      # Keycloak client configuration
β”œβ”€β”€ install.sh                    # Main installation script
β”œβ”€β”€ OWNERS                        # Project maintainers
└── README.md                     # This file

Environment Variables

PR Deployments (Vault Integration)

When using PR deployments, secrets are automatically pulled from vault at: https://vault.ci.openshift.org/ui/vault/secrets/kv/kv/list/selfservice/rhdh-test-instance/

These secrets are available as environment variables with the same name and can be used directly in Kubernetes secrets. From there, they can be referenced in app-config-rhdh.yaml or dynamic-plugins.yaml configurations.

Access Requirements:

  • To add or view vault secrets, ensure you have appropriate access
  • For access requests, reach out in #team-rhdh slack channel

Local Deployments (.env Configuration)

For local development, you can add secrets in a .env file and use them in your app-config or dynamic plugins configuration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%