Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 5c5cc4f

Browse files
feat: Add Multi-networking API (#391)
* feat: Add Multi-networking API feat: Add policy_name to PlacementPolicy message within a node pool PiperOrigin-RevId: 549032622 Source-Link: googleapis/googleapis@fded3ea Source-Link: https://github.com/googleapis/googleapis-gen/commit/cc7294ada305825117edfbe28366feb50e329410 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2M3Mjk0YWRhMzA1ODI1MTE3ZWRmYmUyODM2NmZlYjUwZTMyOTQxMCJ9 * 🦉 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 06b2f8d commit 5c5cc4f

File tree

4 files changed

+114
-0
lines changed

4 files changed

+114
-0
lines changed

google/cloud/container/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
)
2727
from google.cloud.container_v1.types.cluster_service import (
2828
AcceleratorConfig,
29+
AdditionalNodeNetworkConfig,
30+
AdditionalPodNetworkConfig,
2931
AdditionalPodRangesConfig,
3032
AddonsConfig,
3133
AdvancedDatapathObservabilityConfig,
@@ -191,6 +193,8 @@
191193
"ClusterManagerClient",
192194
"ClusterManagerAsyncClient",
193195
"AcceleratorConfig",
196+
"AdditionalNodeNetworkConfig",
197+
"AdditionalPodNetworkConfig",
194198
"AdditionalPodRangesConfig",
195199
"AddonsConfig",
196200
"AdvancedDatapathObservabilityConfig",

google/cloud/container_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
from .services.cluster_manager import ClusterManagerAsyncClient, ClusterManagerClient
2222
from .types.cluster_service import (
2323
AcceleratorConfig,
24+
AdditionalNodeNetworkConfig,
25+
AdditionalPodNetworkConfig,
2426
AdditionalPodRangesConfig,
2527
AddonsConfig,
2628
AdvancedDatapathObservabilityConfig,
@@ -185,6 +187,8 @@
185187
__all__ = (
186188
"ClusterManagerAsyncClient",
187189
"AcceleratorConfig",
190+
"AdditionalNodeNetworkConfig",
191+
"AdditionalPodNetworkConfig",
188192
"AdditionalPodRangesConfig",
189193
"AddonsConfig",
190194
"AdvancedDatapathObservabilityConfig",

google/cloud/container_v1/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#
1616
from .cluster_service import (
1717
AcceleratorConfig,
18+
AdditionalNodeNetworkConfig,
19+
AdditionalPodNetworkConfig,
1820
AdditionalPodRangesConfig,
1921
AddonsConfig,
2022
AdvancedDatapathObservabilityConfig,
@@ -178,6 +180,8 @@
178180

179181
__all__ = (
180182
"AcceleratorConfig",
183+
"AdditionalNodeNetworkConfig",
184+
"AdditionalPodNetworkConfig",
181185
"AdditionalPodRangesConfig",
182186
"AddonsConfig",
183187
"AdvancedDatapathObservabilityConfig",

google/cloud/container_v1/types/cluster_service.py

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"NodeConfig",
4040
"AdvancedMachineFeatures",
4141
"NodeNetworkConfig",
42+
"AdditionalNodeNetworkConfig",
43+
"AdditionalPodNetworkConfig",
4244
"ShieldedInstanceConfig",
4345
"SandboxConfig",
4446
"GcfsConfig",
@@ -947,6 +949,15 @@ class NodeNetworkConfig(proto.Message):
947949
off to next power of 2) Example: max_pods_per_node of 30
948950
will result in 32 IPs (/27) when overprovisioning is
949951
disabled.
952+
additional_node_network_configs (MutableSequence[google.cloud.container_v1.types.AdditionalNodeNetworkConfig]):
953+
We specify the additional node networks for
954+
this node pool using this list. Each node
955+
network corresponds to an additional interface
956+
additional_pod_network_configs (MutableSequence[google.cloud.container_v1.types.AdditionalPodNetworkConfig]):
957+
We specify the additional pod networks for
958+
this node pool using this list. Each pod network
959+
corresponds to an additional alias IP range for
960+
the node
950961
pod_ipv4_range_utilization (float):
951962
Output only. [Output only] The utilization of the IPv4 range
952963
for the pod. The ratio is Usage/[Total number of IPs in the
@@ -1014,12 +1025,86 @@ class Tier(proto.Enum):
10141025
number=13,
10151026
message="PodCIDROverprovisionConfig",
10161027
)
1028+
additional_node_network_configs: MutableSequence[
1029+
"AdditionalNodeNetworkConfig"
1030+
] = proto.RepeatedField(
1031+
proto.MESSAGE,
1032+
number=14,
1033+
message="AdditionalNodeNetworkConfig",
1034+
)
1035+
additional_pod_network_configs: MutableSequence[
1036+
"AdditionalPodNetworkConfig"
1037+
] = proto.RepeatedField(
1038+
proto.MESSAGE,
1039+
number=15,
1040+
message="AdditionalPodNetworkConfig",
1041+
)
10171042
pod_ipv4_range_utilization: float = proto.Field(
10181043
proto.DOUBLE,
10191044
number=16,
10201045
)
10211046

10221047

1048+
class AdditionalNodeNetworkConfig(proto.Message):
1049+
r"""AdditionalNodeNetworkConfig is the configuration for
1050+
additional node networks within the NodeNetworkConfig message
1051+
1052+
Attributes:
1053+
network (str):
1054+
Name of the VPC where the additional
1055+
interface belongs
1056+
subnetwork (str):
1057+
Name of the subnetwork where the additional
1058+
interface belongs
1059+
"""
1060+
1061+
network: str = proto.Field(
1062+
proto.STRING,
1063+
number=1,
1064+
)
1065+
subnetwork: str = proto.Field(
1066+
proto.STRING,
1067+
number=2,
1068+
)
1069+
1070+
1071+
class AdditionalPodNetworkConfig(proto.Message):
1072+
r"""AdditionalPodNetworkConfig is the configuration for
1073+
additional pod networks within the NodeNetworkConfig message
1074+
1075+
1076+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1077+
1078+
Attributes:
1079+
subnetwork (str):
1080+
Name of the subnetwork where the additional
1081+
pod network belongs
1082+
secondary_pod_range (str):
1083+
The name of the secondary range on the subnet
1084+
which provides IP address for this pod range
1085+
max_pods_per_node (google.cloud.container_v1.types.MaxPodsConstraint):
1086+
The maximum number of pods per node which use
1087+
this pod network
1088+
1089+
This field is a member of `oneof`_ ``_max_pods_per_node``.
1090+
"""
1091+
1092+
subnetwork: str = proto.Field(
1093+
proto.STRING,
1094+
number=1,
1095+
)
1096+
secondary_pod_range: str = proto.Field(
1097+
proto.STRING,
1098+
number=2,
1099+
)
1100+
max_pods_per_node: "MaxPodsConstraint" = proto.Field(
1101+
proto.MESSAGE,
1102+
number=3,
1103+
optional=True,
1104+
message="MaxPodsConstraint",
1105+
)
1106+
1107+
10231108
class ShieldedInstanceConfig(proto.Message):
10241109
r"""A set of Shielded Instance options.
10251110
@@ -5702,6 +5787,12 @@ class PlacementPolicy(proto.Message):
57025787
Attributes:
57035788
type_ (google.cloud.container_v1.types.NodePool.PlacementPolicy.Type):
57045789
The type of placement.
5790+
policy_name (str):
5791+
If set, refers to the name of a custom
5792+
resource policy supplied by the user. The
5793+
resource policy must be in the same project and
5794+
region as the node pool. If not found,
5795+
InvalidArgument error is returned.
57055796
"""
57065797

57075798
class Type(proto.Enum):
@@ -5724,6 +5815,10 @@ class Type(proto.Enum):
57245815
number=1,
57255816
enum="NodePool.PlacementPolicy.Type",
57265817
)
5818+
policy_name: str = proto.Field(
5819+
proto.STRING,
5820+
number=3,
5821+
)
57275822

57285823
name: str = proto.Field(
57295824
proto.STRING,
@@ -7251,6 +7346,9 @@ class NetworkConfig(proto.Message):
72517346
gateway_api_config (google.cloud.container_v1.types.GatewayAPIConfig):
72527347
GatewayAPIConfig contains the desired config
72537348
of Gateway API on this cluster.
7349+
enable_multi_networking (bool):
7350+
Whether multi-networking is enabled for this
7351+
cluster.
72547352
network_performance_config (google.cloud.container_v1.types.NetworkConfig.ClusterNetworkPerformanceConfig):
72557353
Network bandwidth tier configuration.
72567354
enable_fqdn_network_policy (bool):
@@ -7339,6 +7437,10 @@ class Tier(proto.Enum):
73397437
number=16,
73407438
message="GatewayAPIConfig",
73417439
)
7440+
enable_multi_networking: bool = proto.Field(
7441+
proto.BOOL,
7442+
number=17,
7443+
)
73427444
network_performance_config: ClusterNetworkPerformanceConfig = proto.Field(
73437445
proto.MESSAGE,
73447446
number=18,

0 commit comments

Comments
 (0)