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
Conversation
…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
force-pushed
the
cherry-pick-gateway-script-to-rhoai-3.4
branch
from
May 27, 2026 20:13
b6083e4 to
a745c16
Compare
somya-bhatnagar
marked this pull request as draft
August 20, 2026 18:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of a24c8c8 from main to rhoai-3.4.
Summary
scripts/setup-gateway.shscript formaas-default-gatewaysetupdestinationCACertificateconfigurationscripts/README.mdanddocs/content/install/maas-setup.mdChanges
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
🤖 Generated by Claude Code