Skip to content

feat(clusters): add GCP static egress configuration for NAT gateway#2690

Open
pggb25 wants to merge 4 commits into
stagingfrom
feat/gcp-nat-gw
Open

feat(clusters): add GCP static egress configuration for NAT gateway#2690
pggb25 wants to merge 4 commits into
stagingfrom
feat/gcp-nat-gw

Conversation

@pggb25
Copy link
Copy Markdown
Collaborator

@pggb25 pggb25 commented May 18, 2026

Summary

https://qovery.atlassian.net/browse/QOV-1901

for GCP add new option to configure nat gateway
https://p80-z1d5ada7b-zbfc30c89-gtw.zc531a994.rustrocks.cloud/organization/21bd04fb-7b93-45c5-9957-4325d833a05a/cluster/47e795a1-ffc9-4db3-929c-70d8fabe12fa/settings/network

Screenshot 2026-05-19 at 11 37 53

Screenshots / Recordings

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@pggb25 pggb25 force-pushed the feat/gcp-nat-gw branch 3 times, most recently from df5e32c to 9639164 Compare May 18, 2026 13:17
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 75.29412% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.59%. Comparing base (73c0d81) to head (bbf0e9b).
⚠️ Report is 3 commits behind head on staging.

Files with missing lines Patch % Lines
...rs/feature/src/lib/gcp-static-ip/gcp-static-ip.tsx 70.96% 10 Missing and 8 partials ⚠️
...ster-network-settings/cluster-network-settings.tsx 77.35% 4 Missing and 8 partials ⚠️
...luster-creation-flow/step-summary/step-summary.tsx 53.84% 2 Missing and 4 partials ⚠️
...ster-creation-flow/step-features/step-features.tsx 70.00% 1 Missing and 2 partials ⚠️
.../src/lib/scaleway-static-ip/scaleway-static-ip.tsx 71.42% 0 Missing and 2 partials ⚠️
.../lib/cluster-card-feature/cluster-card-feature.tsx 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2690      +/-   ##
===========================================
- Coverage    46.19%   45.59%   -0.60%     
===========================================
  Files         1150     1155       +5     
  Lines        23966    24261     +295     
  Branches      6976     7092     +116     
===========================================
- Hits         11070    11061       -9     
- Misses       10952    11263     +311     
+ Partials      1944     1937       -7     
Flag Coverage Δ
unittests 45.59% <75.29%> (-0.60%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pggb25 pggb25 force-pushed the feat/gcp-nat-gw branch 10 times, most recently from 79bdad7 to a381118 Compare May 18, 2026 18:33
@pggb25 pggb25 force-pushed the feat/gcp-nat-gw branch from a381118 to 2d42275 Compare May 19, 2026 07:58
@pggb25 pggb25 marked this pull request as ready for review May 19, 2026 09:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in the Console cluster UX to configure GCP NAT Gateway static egress IPs (enable/disable + count), wiring the settings through both cluster creation flow and existing cluster network settings, alongside updated API client types.

Changes:

  • Introduces GCP NAT gateway “static egress IPs” settings UI and serialization to nat_gateway_type payload format.
  • Updates cluster network settings to read/write GCP/Scaleway NAT gateway feature shapes (including legacy Scaleway shapes) and handle missing GCP NAT_GATEWAY feature on older clusters.
  • Bumps qovery-typescript-axios (and axios) to pick up the new NAT gateway types.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Updates lockfile for axios + qovery API client bump.
package.json Bumps axios and qovery-typescript-axios versions.
libs/shared/interfaces/src/lib/domain/cluster-creation-flow.interface.ts Extends extendedValue typing to support object settings (GCP NAT static egress config).
libs/domains/clusters/feature/src/lib/utils/has-gpu-instance.ts Minor refactor for readability when reading Karpenter feature value.
libs/domains/clusters/feature/src/lib/utils/get-gcp-nat-gateway-settings.ts Adds helper to extract GCP NAT settings from feature response.
libs/domains/clusters/feature/src/lib/utils/get-gcp-nat-gateway-settings.spec.ts Unit tests for the new GCP NAT settings extractor.
libs/domains/clusters/feature/src/lib/scaleway-static-ip/scaleway-static-ip.tsx Layout tweak + makes NAT gateway select resilient to extendedValue no longer being string-only.
libs/domains/clusters/feature/src/lib/gcp-static-ip/gcp-static-ip.tsx New GCP UI block to configure static egress IPs + count, writing to NAT_GATEWAY extendedValue.
libs/domains/clusters/feature/src/lib/gcp-static-ip/gcp-static-ip.spec.tsx Component tests for GCP static egress UI behavior.
libs/domains/clusters/feature/src/lib/cluster-network-settings/cluster-network-settings.tsx Adds GCP support to network settings page: parsing, fallback NAT feature, payload building, save CTA rules.
libs/domains/clusters/feature/src/lib/cluster-network-settings/cluster-network-settings.spec.tsx Tests for SCW legacy shapes + GCP missing NAT feature handling and submit payload behavior.
libs/domains/clusters/feature/src/lib/cluster-creation-flow/step-summary/step-summary.tsx Serializes GCP NAT_GATEWAY using nat_gateway_type format; aligns SCW NAT serialization typing.
libs/domains/clusters/feature/src/lib/cluster-creation-flow/step-summary/step-summary.spec.tsx Adds tests for GCP NAT payload formatting and SCW NAT formatting.
libs/domains/clusters/feature/src/lib/cluster-creation-flow/step-summary/step-summary-presentation.tsx Improves summary display formatting for object extendedValue (GCP settings).
libs/domains/clusters/feature/src/lib/cluster-creation-flow/step-features/step-features.tsx Merges STATIC_IP + NAT_GATEWAY display into a single GCP block during creation.
libs/domains/clusters/feature/src/lib/cluster-creation-flow/step-features/step-features.spec.tsx Updates creation-flow test to reflect merged GCP static IP/NAT UI.
libs/domains/clusters/feature/src/lib/cluster-card-feature/cluster-card-feature.tsx Adjusts read-only toggle display for GCP NAT_GATEWAY using parsed settings.
libs/domains/clusters/feature/src/lib/cluster-card-feature/cluster-card-feature.spec.tsx Adds tests for the updated GCP NAT_GATEWAY toggle display logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (feature.id === 'NAT_GATEWAY' && cloudProvider === 'GCP') {
const gcpNatGatewaySettings = getGcpNatGatewaySettings(feature)
if (gcpNatGatewaySettings) {
return gcpNatGatewaySettings.static_ips_enabled
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case is legacy-only (NAT_GATEWAY without STATIC_IP). In the normal flow we merge both into GcpStaticIp, where static_ips_enabled is already represented by the sub-toggle, so changing this fallback toggle to always true would be misleading.

Comment on lines +267 to +272
NAT_GATEWAY: {
id: 'NAT_GATEWAY',
title: 'NAT Gateway',
value: true,
extendedValue: 'sbn',
},
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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.

3 participants