Skip to content

Conversation

@barbacbd
Copy link
Contributor

@barbacbd barbacbd commented Jan 8, 2026

api/v1beta/types.go:

Adding support for machines and simple network changes for IPV6 or dual stack work.

  • InternalIpv6PrefixLength
  • IPv6Address
  • StackType

cloud/scope/machine.go:

Adding support for instances and networks to allow dual stack components.

  • InstanceNetworkInterfaceSpec

    • InternalIpv6PrefixLength
    • Ipv6AccessConfigs
      • ExternalIPv6
      • ExternalIpv6PrefixLength
      • Type (when present always set to DIRECT_IPV6)
      • Name (always set to External IPv6)
    • IPv6AccessType
    • Ipv6Address
    • StackType
  • InstanceSpec

    • PrivateIpv6GoogleAccess
  • InstanceNetworkInterfaceAliasIPRangesSpec ** This did not change. The AliasIPs appear to only support IPv4 CIDR or single address format.

cloud/interfaces.go:

Expose a couple of new functions to get StackType and IPvAddress information from the cluster specs. These are only getter functions for the Machine.go to access.

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

This PR will serve as a focal point for adding dual stack support to CAPG.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

#1486
#478

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:


@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Jan 8, 2026
@barbacbd
Copy link
Contributor Author

barbacbd commented Jan 8, 2026

/hold

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit a6fa61b
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/6973a25fc491130007f745f0
😎 Deploy Preview https://deploy-preview-1582--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: barbacbd
Once this PR has been reviewed and has the lgtm label, please assign dims for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2026
@k8s-ci-robot
Copy link
Contributor

Hi @barbacbd. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 8, 2026
@damdo
Copy link
Member

damdo commented Jan 9, 2026

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 9, 2026
Copy link
Contributor

@salasberryfin salasberryfin left a comment

Choose a reason for hiding this comment

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

Thanks @barbacbd, I left a couple of comments.

@barbacbd
Copy link
Contributor Author

Leaving this as a reference here. For RouterNat resources there are two variables to consider

  1. Nat64Subnetworks
  2. SourceSubnetworkIpRangesToNat64

from the sdk:
In dual stack subnets, NAT64 will only be enabled for IPv6-only VMs.
If this option is used, the nat64_subnetworks field must be specified.

We can fill this out but it may not make any changes since we will not have ipv6 only vms

Copy link
Contributor

@salasberryfin salasberryfin left a comment

Choose a reason for hiding this comment

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

A couple of "nice to haves" that could be added here:

  • E2E test case using a dual stack network configuration.
  • A brief entry in the CAPG book that documents the new feature (this can be a follow-up PR).

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 22, 2026
Comment on lines +213 to +224
// InternalIpv6PrefixLength: The prefix length of the primary internal IPv6 range.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=128
// +optional
InternalIpv6PrefixLength int `json:"internalIpv6PrefixLength,omitempty"`

// Ipv6Address: An IPv6 internal network address for this network interface.
// To use a static internal IP address, it must be unused and in the same
// region as the instance's zone. If not specified, Google Cloud will
// automatically assign an internal IPv6 address from the instance's subnetwork.
// +optional
Ipv6Address string `json:"ipv6Address,omitempty"`

Choose a reason for hiding this comment

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

If these are related, is it useful to have it as a combined CIDR string?

api/v1beta/types.go:

Adding support for machines and simple network changes for IPV6 or dual stack work.
- InternalIpv6PrefixLength
- IPv6Address
- StackType

cloud/scope/machine.go:

Adding support for instances and networks to allow dual stack components.

- InstanceNetworkInterfaceSpec
  - InternalIpv6PrefixLength
  - Ipv6AccessConfigs
    - ExternalIPv6
    - ExternalIpv6PrefixLength
    - Type (when present always set to DIRECT_IPV6)
    - Name (always set to External IPv6)
  - IPv6AccessType
  - Ipv6Address
  - StackType

- InstanceSpec
  - PrivateIpv6GoogleAccess

- InstanceNetworkInterfaceAliasIPRangesSpec
 ** This did not change. The AliasIPs appear to only support IPv4 CIDR or single address format.

cloud/interfaces.go:

Expose a couple of new functions to get StackType and IPvAddress information from the cluster specs. These are only
getter functions for the Machine.go to access.
api/v1beta1/types.go:
Add a constant for the IPV6/DualStack resource support.

cloud/*:
HealthChecks, Addresses, and Forwarding rules will all return lists. These lists
will contain the ipv4 resource and (during dual stack) the ipv6 resource.
@k8s-ci-robot
Copy link
Contributor

@barbacbd: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-gcp-apidiff a6fa61b link false /test pull-cluster-api-provider-gcp-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants