Skip to content

Commit f24b413

Browse files
authored
Merge pull request #1376 from barbacbd/enable_dual_stack
Enable dual stack
2 parents e7b3cf5 + 98db7cb commit f24b413

6 files changed

+75
-0
lines changed

api/v1beta1/types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,22 @@ type SubnetSpec struct {
240240
// +kubebuilder:default=PRIVATE_RFC_1918
241241
// +optional
242242
Purpose *string `json:"purpose,omitempty"`
243+
244+
// StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
245+
// the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
246+
// the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
247+
// IPV4_ONLY is used. This field can be both set at resource creation time and
248+
// updated using patch.
249+
//
250+
// Possible values:
251+
// "IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
252+
// addresses.
253+
// "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
254+
// "IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
255+
// +kubebuilder:validation:Enum=IPV4_ONLY;IPV4_IPV6;IPV6_ONLY
256+
// +kubebuilder:default=IPV4_ONLY
257+
// +optional
258+
StackType string `json:"stackType,omitempty"`
243259
}
244260

245261
// String returns a string representation of the subnet.

cloud/scope/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ func (s *ClusterScope) SubnetSpecs() []*compute.Subnetwork {
263263
Network: s.NetworkLink(),
264264
Purpose: ptr.Deref(subnetwork.Purpose, "PRIVATE_RFC_1918"),
265265
Role: "ACTIVE",
266+
StackType: subnetwork.StackType,
266267
})
267268
}
268269

cloud/scope/managedcluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ func (s *ManagedClusterScope) SubnetSpecs() []*compute.Subnetwork {
247247
Network: s.NetworkLink(),
248248
Purpose: ptr.Deref(subnetwork.Purpose, "PRIVATE_RFC_1918"),
249249
Role: "ACTIVE",
250+
StackType: subnetwork.StackType,
250251
})
251252
}
252253

config/crd/bases/infrastructure.cluster.x-k8s.io_gcpclusters.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,25 @@ spec:
248248
SecondaryCidrBlocks defines secondary CIDR ranges,
249249
from which secondary IP ranges of a VM may be allocated
250250
type: object
251+
stackType:
252+
default: IPV4_ONLY
253+
description: |-
254+
StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
255+
the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
256+
the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
257+
IPV4_ONLY is used. This field can be both set at resource creation time and
258+
updated using patch.
259+
260+
Possible values:
261+
"IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
262+
addresses.
263+
"IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
264+
"IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
265+
enum:
266+
- IPV4_ONLY
267+
- IPV4_IPV6
268+
- IPV6_ONLY
269+
type: string
251270
type: object
252271
type: array
253272
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_gcpclustertemplates.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,25 @@ spec:
265265
SecondaryCidrBlocks defines secondary CIDR ranges,
266266
from which secondary IP ranges of a VM may be allocated
267267
type: object
268+
stackType:
269+
default: IPV4_ONLY
270+
description: |-
271+
StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
272+
the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
273+
the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
274+
IPV4_ONLY is used. This field can be both set at resource creation time and
275+
updated using patch.
276+
277+
Possible values:
278+
"IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
279+
addresses.
280+
"IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
281+
"IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
282+
enum:
283+
- IPV4_ONLY
284+
- IPV4_IPV6
285+
- IPV6_ONLY
286+
type: string
268287
type: object
269288
type: array
270289
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_gcpmanagedclusters.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,25 @@ spec:
244244
SecondaryCidrBlocks defines secondary CIDR ranges,
245245
from which secondary IP ranges of a VM may be allocated
246246
type: object
247+
stackType:
248+
default: IPV4_ONLY
249+
description: |-
250+
StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
251+
the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
252+
the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
253+
IPV4_ONLY is used. This field can be both set at resource creation time and
254+
updated using patch.
255+
256+
Possible values:
257+
"IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
258+
addresses.
259+
"IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
260+
"IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
261+
enum:
262+
- IPV4_ONLY
263+
- IPV4_IPV6
264+
- IPV6_ONLY
265+
type: string
247266
type: object
248267
type: array
249268
type: object

0 commit comments

Comments
 (0)