Skip to content

Commit

Permalink
Merge pull request #1376 from barbacbd/enable_dual_stack
Browse files Browse the repository at this point in the history
Enable dual stack
  • Loading branch information
k8s-ci-robot authored Dec 16, 2024
2 parents e7b3cf5 + 98db7cb commit f24b413
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ type SubnetSpec struct {
// +kubebuilder:default=PRIVATE_RFC_1918
// +optional
Purpose *string `json:"purpose,omitempty"`

// StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
// the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
// the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
// IPV4_ONLY is used. This field can be both set at resource creation time and
// updated using patch.
//
// Possible values:
// "IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
// addresses.
// "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
// "IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
// +kubebuilder:validation:Enum=IPV4_ONLY;IPV4_IPV6;IPV6_ONLY
// +kubebuilder:default=IPV4_ONLY
// +optional
StackType string `json:"stackType,omitempty"`
}

// String returns a string representation of the subnet.
Expand Down
1 change: 1 addition & 0 deletions cloud/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func (s *ClusterScope) SubnetSpecs() []*compute.Subnetwork {
Network: s.NetworkLink(),
Purpose: ptr.Deref(subnetwork.Purpose, "PRIVATE_RFC_1918"),
Role: "ACTIVE",
StackType: subnetwork.StackType,
})
}

Expand Down
1 change: 1 addition & 0 deletions cloud/scope/managedcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func (s *ManagedClusterScope) SubnetSpecs() []*compute.Subnetwork {
Network: s.NetworkLink(),
Purpose: ptr.Deref(subnetwork.Purpose, "PRIVATE_RFC_1918"),
Role: "ACTIVE",
StackType: subnetwork.StackType,
})
}

Expand Down
19 changes: 19 additions & 0 deletions config/crd/bases/infrastructure.cluster.x-k8s.io_gcpclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,25 @@ spec:
SecondaryCidrBlocks defines secondary CIDR ranges,
from which secondary IP ranges of a VM may be allocated
type: object
stackType:
default: IPV4_ONLY
description: |-
StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
IPV4_ONLY is used. This field can be both set at resource creation time and
updated using patch.
Possible values:
"IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
addresses.
"IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
"IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
enum:
- IPV4_ONLY
- IPV4_IPV6
- IPV6_ONLY
type: string
type: object
type: array
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,25 @@ spec:
SecondaryCidrBlocks defines secondary CIDR ranges,
from which secondary IP ranges of a VM may be allocated
type: object
stackType:
default: IPV4_ONLY
description: |-
StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
IPV4_ONLY is used. This field can be both set at resource creation time and
updated using patch.
Possible values:
"IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
addresses.
"IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
"IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
enum:
- IPV4_ONLY
- IPV4_IPV6
- IPV6_ONLY
type: string
type: object
type: array
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,25 @@ spec:
SecondaryCidrBlocks defines secondary CIDR ranges,
from which secondary IP ranges of a VM may be allocated
type: object
stackType:
default: IPV4_ONLY
description: |-
StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
IPV4_ONLY is used. This field can be both set at resource creation time and
updated using patch.
Possible values:
"IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
addresses.
"IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
"IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
enum:
- IPV4_ONLY
- IPV4_IPV6
- IPV6_ONLY
type: string
type: object
type: array
type: object
Expand Down

0 comments on commit f24b413

Please sign in to comment.