Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ Considering that this is a new install on a clean OS, the next tasks should be p

5. Create a config file

**Option A** - Use a pre-built template (recommended):

```bash
./use-template.sh --list # See available templates
./use-template.sh ipi-ipv4-compact # Activate a template
```

See [config-templates/](config-templates/) for all available templates.

**Option B** - Start from the full example:

`cp config_example.sh config_$USER.sh`

6. Configure dev-scripts working directory
Expand All @@ -60,7 +71,30 @@ Considering that this is a new install on a clean OS, the next tasks should be p

## Configuration

Make a copy of the `config_example.sh` to `config_$USER.sh`.
### Using Templates (recommended)

Pre-built templates are available in [`config-templates/`](config-templates/) for common deployment scenarios. Use the helper script to activate one:

```bash
# List all templates
./use-template.sh --list

# Activate a template - creates config_$USER.sh
./use-template.sh ipi-ipv4-compact

# Or pass CI_TOKEN directly
CI_TOKEN=sha256~xxxx ./use-template.sh agent-sno-ipv4
```

Then edit `config_$USER.sh` to set your `CI_TOKEN` if you haven't passed it via environment.

### Manual Configuration

Alternatively, make a copy of the `config_example.sh` to `config_$USER.sh`:

```bash
cp config_example.sh config_$USER.sh
```

Go to https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/, click on your name in the top
right, copy the login command, extract the token from the command and
Expand Down
95 changes: 95 additions & 0 deletions config-templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Config Templates

Pre-built configuration templates for common dev-scripts deployment scenarios.

## Quick Start

```bash
# List available templates
./use-template.sh --list

# Activate a template (copies it to config_$USER.sh)
./use-template.sh <template-name>

# Edit to add your CI_TOKEN (if not already set)
vi config_$USER.sh

# Deploy (IPI)
make

# Deploy (Agent-based)
cd agent && ./01_agent_requirements.sh && ./03_agent_build_installer.sh && \
./04_agent_prepare_release.sh && ./05_agent_configure.sh && \
./06_agent_create_cluster.sh
```

You can also pass `CI_TOKEN` via environment variable to skip the manual edit:

```bash
CI_TOKEN=sha256~your-token ./use-template.sh ipi-ipv4-compact
make
```

## Available Templates

### IPI (Installer Provisioned Infrastructure)

| Template | Description | Masters | Workers | IP Stack |
|----------|-------------|---------|---------|----------|
| `ipi-ipv4-compact` | Compact IPv4 cluster | 3 | 0 | IPv4 |
| `ipi-ipv4-ha` | HA IPv4 cluster | 3 | 2 | IPv4 |
| `ipi-ipv6-ha` | HA IPv6 cluster | 3 | 2 | IPv6 |
| `ipi-dualstack-v4v6-ha` | HA dual-stack cluster (IPv4-primary) | 3 | 2 | v4v6 |
| `ipi-dualstack-v6v4-ha` | HA dual-stack cluster (IPv6-primary) | 3 | 2 | v6v4 |

### Agent-Based Installer

| Template | Description | Scenario | IP Stack |
|----------|-------------|----------|----------|
| `agent-sno-ipv4` | Single Node OpenShift | SNO_IPV4 | IPv4 |
| `agent-sno-ipv6` | Single Node OpenShift | SNO_IPV6 | IPv6 |
| `agent-compact-ipv4` | Compact cluster (3 masters) | COMPACT_IPV4 | IPv4 |
| `agent-ha-ipv4` | HA cluster (3+2) | HA_IPV4 | IPv4 |
| `agent-ha-ipv6` | HA cluster (3+2) | HA_IPV6 | IPv6 |

## Customizing Templates

After activating a template, you can edit `config_$USER.sh` to customize any
settings. See [config_example.sh](../config_example.sh) for a full reference of
all available options.

Common customizations:

```bash
# Change the OCP version
export OPENSHIFT_RELEASE_STREAM="4.21"

# Use a GA release instead of nightly
export OPENSHIFT_RELEASE_TYPE="ga"

# Increase VM resources
export MASTER_MEMORY=32768
export MASTER_VCPU=16

# Change working directory
export WORKING_DIR="/home/dev-scripts"

# Enable FIPS
export FIPS_MODE=true

# Enable MetalLB
export ENABLE_METALLB_MODE="l2"
```

## Creating New Templates

To add a new template, create a `.sh` file in this directory following the
existing naming convention:

- `<method>-<variant>-<ip-stack>.sh`
- Examples: `ipi-ipv4-compact.sh`, `agent-sno-ipv4.sh`

Each template should include:
1. A header comment describing the deployment scenario
2. The `CI_TOKEN` placeholder block
3. Only the settings that differ from defaults
28 changes: 28 additions & 0 deletions config-templates/agent-compact-ipv4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
################################################################################
## Agent-Based Compact IPv4 (3 masters, 0 workers)
##
## A compact cluster using the agent-based installer with IPv4 networking.
## Three control-plane nodes that also run workloads, no dedicated workers.
##
## Usage:
## ./use-template.sh agent-compact-ipv4
## # Then edit config_$USER.sh to set your CI_TOKEN
## cd agent && ./01_agent_requirements.sh && ./03_agent_build_installer.sh && \
## ./04_agent_prepare_release.sh && ./05_agent_configure.sh && \
## ./06_agent_create_cluster.sh
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv4 single stack (default is v6)
export IP_STACK="v4"

# Agent-based installer settings
export AGENT_E2E_TEST_SCENARIO="COMPACT_IPV4"
28 changes: 28 additions & 0 deletions config-templates/agent-ha-ipv4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
################################################################################
## Agent-Based HA IPv4 (3 masters, 2 workers)
##
## A full HA cluster using the agent-based installer with IPv4 networking.
## Standard production-like topology with separate control plane and workers.
##
## Usage:
## ./use-template.sh agent-ha-ipv4
## # Then edit config_$USER.sh to set your CI_TOKEN
## cd agent && ./01_agent_requirements.sh && ./03_agent_build_installer.sh && \
## ./04_agent_prepare_release.sh && ./05_agent_configure.sh && \
## ./06_agent_create_cluster.sh
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv4 single stack (default is v6)
export IP_STACK="v4"

# Agent-based installer settings
export AGENT_E2E_TEST_SCENARIO="HA_IPV4"
28 changes: 28 additions & 0 deletions config-templates/agent-ha-ipv6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
################################################################################
## Agent-Based HA IPv6 (3 masters, 2 workers)
##
## A full HA cluster using the agent-based installer with IPv6 networking.
## Useful for testing IPv6-only environments with agent-based deployments.
##
## Usage:
## ./use-template.sh agent-ha-ipv6
## # Then edit config_$USER.sh to set your CI_TOKEN
## cd agent && ./01_agent_requirements.sh && ./03_agent_build_installer.sh && \
## ./04_agent_prepare_release.sh && ./05_agent_configure.sh && \
## ./06_agent_create_cluster.sh
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Agent-based installer settings
export AGENT_E2E_TEST_SCENARIO="HA_IPV6"

# Local registry is required for IPv6 deployments
export ENABLE_LOCAL_REGISTRY=true
28 changes: 28 additions & 0 deletions config-templates/agent-sno-ipv4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
################################################################################
## Agent-Based SNO IPv4 (Single Node OpenShift)
##
## A single-node OpenShift deployment using the agent-based installer.
## Ideal for edge computing scenarios or minimal footprint testing.
##
## Usage:
## ./use-template.sh agent-sno-ipv4
## # Then edit config_$USER.sh to set your CI_TOKEN
## cd agent && ./01_agent_requirements.sh && ./03_agent_build_installer.sh && \
## ./04_agent_prepare_release.sh && ./05_agent_configure.sh && \
## ./06_agent_create_cluster.sh
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv4 single stack (default is v6)
export IP_STACK="v4"

# Agent-based installer settings
export AGENT_E2E_TEST_SCENARIO="SNO_IPV4"
28 changes: 28 additions & 0 deletions config-templates/agent-sno-ipv6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
################################################################################
## Agent-Based SNO IPv6 (Single Node OpenShift)
##
## A single-node OpenShift deployment using the agent-based installer with
## IPv6 networking. For edge scenarios requiring IPv6-only connectivity.
##
## Usage:
## ./use-template.sh agent-sno-ipv6
## # Then edit config_$USER.sh to set your CI_TOKEN
## cd agent && ./01_agent_requirements.sh && ./03_agent_build_installer.sh && \
## ./04_agent_prepare_release.sh && ./05_agent_configure.sh && \
## ./06_agent_create_cluster.sh
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Agent-based installer settings
export AGENT_E2E_TEST_SCENARIO="SNO_IPV6"

# Local registry is required for IPv6 deployments
export ENABLE_LOCAL_REGISTRY=true
26 changes: 26 additions & 0 deletions config-templates/ipi-dualstack-v4v6-ha.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
################################################################################
## IPI Dual-Stack HA Cluster (IPv4-primary, 3 masters, 2 workers)
##
## A dual-stack cluster using traditional IPI with Ironic.
## IPv4-primary with IPv6 secondary.
##
## Usage:
## ./use-template.sh ipi-dualstack-v4v6-ha
## # Then edit config_$USER.sh to set your CI_TOKEN
## make
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv4-primary dual stack
export IP_STACK="v4v6"

# Local registry is required for dual-stack deployments
export ENABLE_LOCAL_REGISTRY=true
26 changes: 26 additions & 0 deletions config-templates/ipi-dualstack-v6v4-ha.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
################################################################################
## IPI Dual-Stack HA Cluster (IPv6-primary, 3 masters, 2 workers)
##
## A dual-stack cluster using traditional IPI with Ironic.
## IPv6-primary with IPv4 secondary.
##
## Usage:
## ./use-template.sh ipi-dualstack-v6v4-ha
## # Then edit config_$USER.sh to set your CI_TOKEN
## make
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv6-primary dual stack
export IP_STACK="v6v4"

# Local registry is required for dual-stack deployments
export ENABLE_LOCAL_REGISTRY=true
27 changes: 27 additions & 0 deletions config-templates/ipi-ipv4-compact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
################################################################################
## IPI IPv4 Compact Cluster (3 masters, 0 workers)
##
## A minimal IPv4 single-stack compact cluster using traditional IPI
## (Installer Provisioned Infrastructure) with Ironic.
## Good for local development and testing with reduced resource requirements.
##
## Usage:
## ./use-template.sh ipi-ipv4-compact
## # Then edit config_$USER.sh to set your CI_TOKEN
## make
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv4 single stack (default is v6)
export IP_STACK="v4"

# Compact cluster: no workers
export NUM_WORKERS=0
24 changes: 24 additions & 0 deletions config-templates/ipi-ipv4-ha.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
################################################################################
## IPI IPv4 HA Cluster (3 masters, 2 workers)
##
## A full HA IPv4 cluster using traditional IPI (Installer Provisioned
## Infrastructure) with Ironic. Standard deployment with separate control
## plane and worker nodes.
##
## Usage:
## ./use-template.sh ipi-ipv4-ha
## # Then edit config_$USER.sh to set your CI_TOKEN
## make
##
################################################################################

# CI_TOKEN - **REQUIRED**
# Get this token from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/
# by clicking on your name in the top right corner and copying the login command
set +x
export CI_TOKEN='<insert-your-token-here>'
set -x

# Network: IPv4 single stack (default is v6)
export IP_STACK="v4"
Loading