Skip to content

feat: add standalone setup-gateway.sh script for maas-default-gateway (backport to rhoai-3.4) - #489

Draft
somya-bhatnagar wants to merge 2 commits into
red-hat-data-services:rhoai-3.4from
somya-bhatnagar:cherry-pick-gateway-script-to-rhoai-3.4
Draft

feat: add standalone setup-gateway.sh script for maas-default-gateway (backport to rhoai-3.4)#489
somya-bhatnagar wants to merge 2 commits into
red-hat-data-services:rhoai-3.4from
somya-bhatnagar:cherry-pick-gateway-script-to-rhoai-3.4

Conversation

@somya-bhatnagar

Copy link
Copy Markdown

Cherry-pick of a24c8c8 from main to rhoai-3.4.

Summary

  • Adds standalone scripts/setup-gateway.sh script for maas-default-gateway setup
  • Supports two deployment modes: route (LoadBalancer) and clusterip (ClusterIP + Route)
  • Implements TLS auto-detection with four-level fallback
  • Fixes Route reencrypt termination with proper destinationCACertificate configuration
  • Updates documentation in scripts/README.md and docs/content/install/maas-setup.md

Changes

  • scripts/setup-gateway.sh (NEW): Standalone gateway setup script with route and clusterip modes
  • scripts/deploy.sh: Replaced inline gateway logic with call to setup-gateway.sh
  • scripts/README.md: Added documentation for setup-gateway.sh
  • docs/content/install/maas-setup.md: Updated Create Gateway section to reference script

Risk analysis

Risk rating: 2

Why: This is a cherry-pick of tested changes from main. The commit has already been validated in the upstream and downstream main branches. The changes extract existing functionality into a standalone script without altering core behavior, making it low-medium risk for the stable release branch.

Test plan

  • Verify gateway setup on ROSA cluster (route mode)
  • Verify gateway setup on disconnected cluster (clusterip mode)
  • Validate TLS auto-detection fallback chain
  • Confirm Route reencrypt termination works correctly

🤖 Generated by Claude Code

jira-autofix Bot and others added 2 commits May 27, 2026 16:12
…er docs samples (opendatahub-io#833)

Replace the fabricated "OpenShift 4.19.9" version requirement with a
generic "OpenShift cluster with Gateway API support" reference, linking
to
the existing prerequisites and platform-setup pages which maintain the
actual version and setup requirements.

Closes
[RHOAIENG-60554](https://redhat.atlassian.net/browse/RHOAIENG-60554)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jamie Land <jland@redhat.com>

---------

Signed-off-by: Jamie Land <jland@redhat.com>
Co-authored-by: jira-autofix-bot <jira-autofix-bot@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
…opendatahub-io#941)

Extracts gateway setup logic from `deploy.sh` into a standalone
`scripts/setup-gateway.sh` script that supports two deployment modes for
different cluster environments.

**Deployment Modes:**
- **route mode** (default): LoadBalancer Service with cluster router TLS
- best for ROSA, OSD, cloud clusters
- **clusterip mode**: ClusterIP Service + OpenShift Route with
service-ca TLS - best for on-prem, disconnected, bare-metal clusters

**Features:**
- Auto-detects cluster domain and TLS certificate (four-level fallback)
- Validates gateway spec matches requested mode before early exit
(prevents mode mismatch issues)
- Supports `DISCONNECTED=true` flag for air-gapped clusters (no GitHub
fallback)
- Idempotent with comprehensive annotation and spec validation
- Environment variable overrides: `INGRESS_MODE`, `CLUSTER_DOMAIN`,
`CERT_NAME`, `DISCONNECTED`, `DRY_RUN`

- **New:** `scripts/setup-gateway.sh` - Standalone gateway setup script
(547 lines)
- **Modified:** `scripts/deploy.sh` - Removed deprecated inline
functions, calls new script
- **Modified:** `scripts/README.md` - Added comprehensive documentation
for `setup-gateway.sh` and `setup-database.sh`
- **Modified:** `docs/content/install/maas-setup.md` - Updated to
script-based approach with tested environments

Validated on 3 cluster types across different cloud providers and
network environments:

- **Route mode:** Gateway Programmed, TLS from IngressController
(primary detection method)
- **ClusterIP mode:** Gateway Programmed, service-ca provisioned TLS
(~10s), Route Admitted
- **Idempotency:** Clean re-runs on existing resources

- **Route mode:** Gateway Programmed, TLS from router deployment
(fallback 1)
- **ClusterIP mode:** Gateway Programmed, service-ca provisioned TLS
(~12s), Route Admitted
- **Mode switching:** Validated spec validation prevents clusterip mode
from skipping on route-mode gateway

- **ClusterIP mode:** Gateway Programmed using local manifests
- **DISCONNECTED=true:** Confirmed GitHub fallback is blocked, fails
fast on missing local manifests
- **TLS detection:** Used router deployment certificate (fallback 1)

- ✅ TLS auto-detection: All 4 fallback levels validated
(IngressController → router deployment → known secrets → self-signed)
- ✅ Idempotency: 6 scenarios tested (existing GatewayClass, Gateway,
ConfigMap, Route, annotations, spec)
- ✅ Mode validation: Prevents mode mismatch by checking
`infrastructure.parametersRef`
- ✅ Error handling: Validated failure paths (missing tools, bad mode,
network issues)

**Risk rating:** 2

**Why:**
- New script extraction reduces complexity in `deploy.sh` (positive)
- Tested on 3 cluster types with comprehensive validation (reduces risk)
- Changes gateway setup flow that is part of deploy path but not all
edge cases covered by Prow smoke test
- Mode selection (`INGRESS_MODE=clusterip`) and DISCONNECTED flag paths
are new, not in current CI
- Impact limited to gateway setup phase; does not affect existing
gateways or running workloads

- Implements:
[RHOAIENG-63963](https://issues.redhat.com/browse/RHOAIENG-63963)
- Pattern: Follows `setup-database.sh` standalone script pattern
- Documentation: Comprehensive usage in `scripts/README.md` and
`docs/content/install/maas-setup.md`

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Documentation**
* Simplified Gateway setup guide with a script-driven workflow,
mode-specific commands, TLS guidance, and explicit verification steps;
README documents mode options and environment variables (DRY_RUN,
DISCONNECTED, overrides).
* Added follow-up step to run an Authorino TLS setup with namespace
guidance.

* **New Features**
* Automated gateway provisioning supporting route vs clusterip modes,
automatic TLS resolution with fallbacks, and verification/waiting for
Gateway readiness.

* **Refactor**
* Deployment flow now delegates Gateway provisioning to the centralized
setup script.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@somya-bhatnagar
somya-bhatnagar force-pushed the cherry-pick-gateway-script-to-rhoai-3.4 branch from b6083e4 to a745c16 Compare May 27, 2026 20:13
@somya-bhatnagar
somya-bhatnagar marked this pull request as draft August 20, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant