Skip to content

Commit 9400b6e

Browse files
authored
Merge pull request #724 from synth-beat/master
Add NetworkAttachment to GKENetworkParamSet CRD
2 parents c12bdf0 + 7077f96 commit 9400b6e

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

crd/apis/network/v1/gkenetworkparamset_types.go

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,33 @@ type SecondaryRanges struct {
4040

4141
// GKENetworkParamSetSpec contains the specifications for network object
4242
type GKENetworkParamSetSpec struct {
43-
// VPC speficies the VPC to which the network belongs.
44-
// +required
45-
VPC string `json:"vpc"`
43+
// VPC specifies the VPC to which the network belongs. Mutually exclusive with NetworkAttachment.
44+
// This field is required when not connecting across a network attachment
45+
// +optional
46+
VPC string `json:"vpc,omitempty"`
4647

47-
// VPCSubnet is the path of the VPC subnet
48-
// +required
49-
VPCSubnet string `json:"vpcSubnet"`
48+
// VPCSubnet is the path of the VPC subnet. Must be set if specifying VPC. Mutually exclusive with
49+
// NetworkAttachment. This field is required when not connecting across a network attachment
50+
// +optional
51+
VPCSubnet string `json:"vpcSubnet,omitempty"`
5052

5153
// DeviceMode indicates the mode in which the devices will be used by the Pod.
52-
// This field is required and valid only for "Device" typed network
54+
// This field is required and valid only for "Device" typed network. Mutually exclusive with
55+
// NetworkAttachment
5356
// +optional
5457
DeviceMode DeviceModeType `json:"deviceMode,omitempty"`
5558

5659
// PodIPv4Ranges specify the names of the secondary ranges of the VPC subnet
5760
// used to allocate pod IPs for the network.
58-
// This field is required and valid only for L3 typed network
61+
// This field is required and valid only for L3 typed network. Mutually exclusive with
62+
// NetworkAttachment
5963
// +optional
6064
PodIPv4Ranges *SecondaryRanges `json:"podIPv4Ranges,omitempty"`
65+
66+
// NetworkAttachment specifies the network attachment to connect to. Mutually exclusive with VPC,
67+
// VPCSubnet, DeviceMode, and PodIPv4Ranges
68+
// +optional
69+
NetworkAttachment string `json:"networkAttachment,omitempty"`
6170
}
6271

6372
// NetworkRanges represents ranges of network addresses.

crd/config/crds/networking.gke.io_gkenetworkparamsets.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,24 @@ spec:
4444
deviceMode:
4545
description: |-
4646
DeviceMode indicates the mode in which the devices will be used by the Pod.
47-
This field is required and valid only for "Device" typed network
47+
This field is required and valid only for "Device" typed network. Mutually exclusive with
48+
NetworkAttachment
4849
enum:
4950
- DPDK-VFIO
5051
- NetDevice
5152
- RDMA
5253
type: string
54+
networkAttachment:
55+
description: |-
56+
NetworkAttachment specifies the network attachment to connect to. Mutually exclusive with VPC,
57+
VPCSubnet, DeviceMode, and PodIPv4Ranges
58+
type: string
5359
podIPv4Ranges:
5460
description: |-
5561
PodIPv4Ranges specify the names of the secondary ranges of the VPC subnet
5662
used to allocate pod IPs for the network.
57-
This field is required and valid only for L3 typed network
63+
This field is required and valid only for L3 typed network. Mutually exclusive with
64+
NetworkAttachment
5865
properties:
5966
rangeNames:
6067
items:
@@ -65,14 +72,15 @@ spec:
6572
- rangeNames
6673
type: object
6774
vpc:
68-
description: VPC speficies the VPC to which the network belongs.
75+
description: |-
76+
VPC specifies the VPC to which the network belongs. Mutually exclusive with NetworkAttachment.
77+
This field is required when not connecting across a network attachment
6978
type: string
7079
vpcSubnet:
71-
description: VPCSubnet is the path of the VPC subnet
80+
description: |-
81+
VPCSubnet is the path of the VPC subnet. Must be set if specifying VPC. Mutually exclusive with
82+
NetworkAttachment. This field is required when not connecting across a network attachment
7283
type: string
73-
required:
74-
- vpc
75-
- vpcSubnet
7684
type: object
7785
status:
7886
description: GKENetworkParamSetStatus contains the status information

0 commit comments

Comments
 (0)