Skip to content

Commit 80a8799

Browse files
Add IPAMMode to Network Object
1 parent 58ec6ae commit 80a8799

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

crd/apis/network/v1/network_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ const (
4949
GKE ProviderType = "GKE"
5050
)
5151

52+
// IPAMModeType defines the IPAM mode for the network. Can be 'internal' or 'external'.
53+
// +kubebuilder:validation:Enum=Internal;External
54+
type IPAMModeType string
55+
56+
const (
57+
// Pod IPs will be allocated internally by ipam-controller based on ClusterCIDRConfig.
58+
InternalMode IPAMModeType = "Internal"
59+
// Pod IPs will be allocated by the external DHCP server.
60+
ExternalMode IPAMModeType = "External"
61+
)
62+
5263
// +genclient
5364
// +genclient:nonNamespaced
5465
// +kubebuilder:object:root=true
@@ -117,6 +128,11 @@ type NetworkSpec struct {
117128
// configurations for the network.
118129
// +optional
119130
ParametersRef *NetworkParametersReference `json:"parametersRef,omitempty"`
131+
132+
// IPAMMode specifies the IPAM mode for the network.
133+
// Valid options include: internal, external
134+
// +optional
135+
IPAMMode *IPAMModeType `json:"IPAMMode,omitempty"`
120136
}
121137

122138
// NetworkParametersReference identifies an API object containing additional parameters for the network.

crd/apis/network/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ spec:
3535
spec:
3636
description: NetworkSpec contains the specifications for network object
3737
properties:
38+
IPAMMode:
39+
description: 'IPAMMode specifies the IPAM mode for the network. Valid
40+
options include: internal, external'
41+
enum:
42+
- Internal
43+
- External
44+
type: string
3845
dnsConfig:
3946
description: Specifies the DNS configuration of the network. Required
4047
if ExternalDHCP4 is false or not set on L2 type network.

0 commit comments

Comments
 (0)