Skip to content

Commit 56f65fa

Browse files
feat: add support for disabling pod IP cidr overprovision (googleapis#363)
* feat: add update support for accelerator config feat: add support for disabling pod IP cidr overprovision. This feature requires special allowlisting for the projects. PiperOrigin-RevId: 522103275 Source-Link: googleapis/googleapis@9f6f02b Source-Link: https://github.com/googleapis/googleapis-gen/commit/47ee16c105ade610b68bffc28b0c2243eba08a44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDdlZTE2YzEwNWFkZTYxMGI2OGJmZmMyOGIwYzIyNDNlYmEwOGE0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add support for disabling pod IP cidr overprovision This feature requires special allowlisting for the projects. PiperOrigin-RevId: 522103451 Source-Link: googleapis/googleapis@013b597 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2fe6962f9c8e770396dcfc88e104e5d713c2e66e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZlNjk2MmY5YzhlNzcwMzk2ZGNmYzg4ZTEwNGU1ZDcxM2MyZTY2ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 781da50 commit 56f65fa

File tree

9 files changed

+122
-2
lines changed

9 files changed

+122
-2
lines changed

google/cloud/container/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
NotificationConfig,
127127
Operation,
128128
OperationProgress,
129+
PodCIDROverprovisionConfig,
129130
PrivateClusterConfig,
130131
PrivateClusterMasterGlobalAccessConfig,
131132
PrivateIPv6GoogleAccess,
@@ -274,6 +275,7 @@
274275
"NotificationConfig",
275276
"Operation",
276277
"OperationProgress",
278+
"PodCIDROverprovisionConfig",
277279
"PrivateClusterConfig",
278280
"PrivateClusterMasterGlobalAccessConfig",
279281
"RecurringTimeWindow",

google/cloud/container_v1/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
NotificationConfig,
122122
Operation,
123123
OperationProgress,
124+
PodCIDROverprovisionConfig,
124125
PrivateClusterConfig,
125126
PrivateClusterMasterGlobalAccessConfig,
126127
PrivateIPv6GoogleAccess,
@@ -272,6 +273,7 @@
272273
"NotificationConfig",
273274
"Operation",
274275
"OperationProgress",
276+
"PodCIDROverprovisionConfig",
275277
"PrivateClusterConfig",
276278
"PrivateClusterMasterGlobalAccessConfig",
277279
"PrivateIPv6GoogleAccess",

google/cloud/container_v1/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
NotificationConfig,
116116
Operation,
117117
OperationProgress,
118+
PodCIDROverprovisionConfig,
118119
PrivateClusterConfig,
119120
PrivateClusterMasterGlobalAccessConfig,
120121
PrivateIPv6GoogleAccess,
@@ -261,6 +262,7 @@
261262
"NotificationConfig",
262263
"Operation",
263264
"OperationProgress",
265+
"PodCIDROverprovisionConfig",
264266
"PrivateClusterConfig",
265267
"PrivateClusterMasterGlobalAccessConfig",
266268
"RecurringTimeWindow",

google/cloud/container_v1/types/cluster_service.py

+55
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"LegacyAbac",
6969
"NetworkPolicy",
7070
"BinaryAuthorization",
71+
"PodCIDROverprovisionConfig",
7172
"IPAllocationPolicy",
7273
"Cluster",
7374
"NodePoolAutoConfig",
@@ -896,6 +897,20 @@ class NodeNetworkConfig(proto.Message):
896897
Network bandwidth tier configuration.
897898
898899
This field is a member of `oneof`_ ``_network_performance_config``.
900+
pod_cidr_overprovision_config (google.cloud.container_v1.types.PodCIDROverprovisionConfig):
901+
[PRIVATE FIELD] Pod CIDR size overprovisioning config for
902+
the nodepool.
903+
904+
Pod CIDR size per node depends on max_pods_per_node. By
905+
default, the value of max_pods_per_node is rounded off to
906+
next power of 2 and we then double that to get the size of
907+
pod CIDR block per node. Example: max_pods_per_node of 30
908+
would result in 64 IPs (/26).
909+
910+
This config can disable the doubling of IPs (we still round
911+
off to next power of 2) Example: max_pods_per_node of 30
912+
will result in 32 IPs (/27) when overprovisioning is
913+
disabled.
899914
"""
900915

901916
class NetworkPerformanceConfig(proto.Message):
@@ -954,6 +969,11 @@ class Tier(proto.Enum):
954969
optional=True,
955970
message=NetworkPerformanceConfig,
956971
)
972+
pod_cidr_overprovision_config: "PodCIDROverprovisionConfig" = proto.Field(
973+
proto.MESSAGE,
974+
number=13,
975+
message="PodCIDROverprovisionConfig",
976+
)
957977

958978

959979
class ShieldedInstanceConfig(proto.Message):
@@ -1847,6 +1867,22 @@ class EvaluationMode(proto.Enum):
18471867
)
18481868

18491869

1870+
class PodCIDROverprovisionConfig(proto.Message):
1871+
r"""[PRIVATE FIELD] Config for pod CIDR size overprovisioning.
1872+
1873+
Attributes:
1874+
disable (bool):
1875+
Whether Pod CIDR overprovisioning is
1876+
disabled. Note: Pod CIDR overprovisioning is
1877+
enabled by default.
1878+
"""
1879+
1880+
disable: bool = proto.Field(
1881+
proto.BOOL,
1882+
number=1,
1883+
)
1884+
1885+
18501886
class IPAllocationPolicy(proto.Message):
18511887
r"""Configuration for controlling how IPs are allocated in the
18521888
cluster.
@@ -1970,6 +2006,20 @@ class IPAllocationPolicy(proto.Message):
19702006
ipv6_access_type (google.cloud.container_v1.types.IPv6AccessType):
19712007
The ipv6 access type (internal or external) when
19722008
create_subnetwork is true
2009+
pod_cidr_overprovision_config (google.cloud.container_v1.types.PodCIDROverprovisionConfig):
2010+
[PRIVATE FIELD] Pod CIDR size overprovisioning config for
2011+
the cluster.
2012+
2013+
Pod CIDR size per node depends on max_pods_per_node. By
2014+
default, the value of max_pods_per_node is doubled and then
2015+
rounded off to next power of 2 to get the size of pod CIDR
2016+
block per node. Example: max_pods_per_node of 30 would
2017+
result in 64 IPs (/26).
2018+
2019+
This config can disable the doubling of IPs (we still round
2020+
off to next power of 2) Example: max_pods_per_node of 30
2021+
will result in 32 IPs (/27) when overprovisioning is
2022+
disabled.
19732023
subnet_ipv6_cidr_block (str):
19742024
Output only. [Output only] The subnet's IPv6 CIDR block used
19752025
by nodes and pods.
@@ -2040,6 +2090,11 @@ class IPAllocationPolicy(proto.Message):
20402090
number=17,
20412091
enum="IPv6AccessType",
20422092
)
2093+
pod_cidr_overprovision_config: "PodCIDROverprovisionConfig" = proto.Field(
2094+
proto.MESSAGE,
2095+
number=21,
2096+
message="PodCIDROverprovisionConfig",
2097+
)
20432098
subnet_ipv6_cidr_block: str = proto.Field(
20442099
proto.STRING,
20452100
number=22,

google/cloud/container_v1beta1/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
NotificationConfig,
129129
Operation,
130130
OperationProgress,
131+
PodCIDROverprovisionConfig,
131132
PodSecurityPolicyConfig,
132133
PrivateClusterConfig,
133134
PrivateClusterMasterGlobalAccessConfig,
@@ -293,6 +294,7 @@
293294
"NotificationConfig",
294295
"Operation",
295296
"OperationProgress",
297+
"PodCIDROverprovisionConfig",
296298
"PodSecurityPolicyConfig",
297299
"PrivateClusterConfig",
298300
"PrivateClusterMasterGlobalAccessConfig",

google/cloud/container_v1beta1/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
NotificationConfig,
123123
Operation,
124124
OperationProgress,
125+
PodCIDROverprovisionConfig,
125126
PodSecurityPolicyConfig,
126127
PrivateClusterConfig,
127128
PrivateClusterMasterGlobalAccessConfig,
@@ -283,6 +284,7 @@
283284
"NotificationConfig",
284285
"Operation",
285286
"OperationProgress",
287+
"PodCIDROverprovisionConfig",
286288
"PodSecurityPolicyConfig",
287289
"PrivateClusterConfig",
288290
"PrivateClusterMasterGlobalAccessConfig",

google/cloud/container_v1beta1/types/cluster_service.py

+55
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"MasterAuthorizedNetworksConfig",
7272
"LegacyAbac",
7373
"NetworkPolicy",
74+
"PodCIDROverprovisionConfig",
7475
"IPAllocationPolicy",
7576
"BinaryAuthorization",
7677
"PodSecurityPolicyConfig",
@@ -902,6 +903,20 @@ class NodeNetworkConfig(proto.Message):
902903
Network bandwidth tier configuration.
903904
904905
This field is a member of `oneof`_ ``_network_performance_config``.
906+
pod_cidr_overprovision_config (google.cloud.container_v1beta1.types.PodCIDROverprovisionConfig):
907+
[PRIVATE FIELD] Pod CIDR size overprovisioning config for
908+
the nodepool.
909+
910+
Pod CIDR size per node depends on max_pods_per_node. By
911+
default, the value of max_pods_per_node is rounded off to
912+
next power of 2 and we then double that to get the size of
913+
pod CIDR block per node. Example: max_pods_per_node of 30
914+
would result in 64 IPs (/26).
915+
916+
This config can disable the doubling of IPs (we still round
917+
off to next power of 2) Example: max_pods_per_node of 30
918+
will result in 32 IPs (/27) when overprovisioning is
919+
disabled.
905920
"""
906921

907922
class NetworkPerformanceConfig(proto.Message):
@@ -972,6 +987,11 @@ class Tier(proto.Enum):
972987
optional=True,
973988
message=NetworkPerformanceConfig,
974989
)
990+
pod_cidr_overprovision_config: "PodCIDROverprovisionConfig" = proto.Field(
991+
proto.MESSAGE,
992+
number=13,
993+
message="PodCIDROverprovisionConfig",
994+
)
975995

976996

977997
class ShieldedInstanceConfig(proto.Message):
@@ -1933,6 +1953,22 @@ class Provider(proto.Enum):
19331953
)
19341954

19351955

1956+
class PodCIDROverprovisionConfig(proto.Message):
1957+
r"""[PRIVATE FIELD] Config for pod CIDR size overprovisioning.
1958+
1959+
Attributes:
1960+
disable (bool):
1961+
Whether Pod CIDR overprovisioning is
1962+
disabled. Note: Pod CIDR overprovisioning is
1963+
enabled by default.
1964+
"""
1965+
1966+
disable: bool = proto.Field(
1967+
proto.BOOL,
1968+
number=1,
1969+
)
1970+
1971+
19361972
class IPAllocationPolicy(proto.Message):
19371973
r"""Configuration for controlling how IPs are allocated in the
19381974
cluster.
@@ -2075,6 +2111,20 @@ class IPAllocationPolicy(proto.Message):
20752111
ipv6_access_type (google.cloud.container_v1beta1.types.IPAllocationPolicy.IPv6AccessType):
20762112
The ipv6 access type (internal or external) when
20772113
create_subnetwork is true
2114+
pod_cidr_overprovision_config (google.cloud.container_v1beta1.types.PodCIDROverprovisionConfig):
2115+
[PRIVATE FIELD] Pod CIDR size overprovisioning config for
2116+
the cluster.
2117+
2118+
Pod CIDR size per node depends on max_pods_per_node. By
2119+
default, the value of max_pods_per_node is doubled and then
2120+
rounded off to next power of 2 to get the size of pod CIDR
2121+
block per node. Example: max_pods_per_node of 30 would
2122+
result in 64 IPs (/26).
2123+
2124+
This config can disable the doubling of IPs (we still round
2125+
off to next power of 2) Example: max_pods_per_node of 30
2126+
will result in 32 IPs (/27) when overprovisioning is
2127+
disabled.
20782128
subnet_ipv6_cidr_block (str):
20792129
Output only. [Output only] The subnet's IPv6 CIDR block used
20802130
by nodes and pods.
@@ -2183,6 +2233,11 @@ class IPv6AccessType(proto.Enum):
21832233
number=17,
21842234
enum=IPv6AccessType,
21852235
)
2236+
pod_cidr_overprovision_config: "PodCIDROverprovisionConfig" = proto.Field(
2237+
proto.MESSAGE,
2238+
number=21,
2239+
message="PodCIDROverprovisionConfig",
2240+
)
21862241
subnet_ipv6_cidr_block: str = proto.Field(
21872242
proto.STRING,
21882243
number=22,

samples/generated_samples/snippet_metadata_google.container.v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-container",
11-
"version": "2.18.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.container.v1beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-container",
11-
"version": "2.18.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)