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

Commit 02c497e

Browse files
feat: add policy_name to PlacementPolicy message within a node pool (#395)
* feat: add policy_name to PlacementPolicy message within a node pool feat: add support for HostMaintenancePolicy feat: add support for AdditionalPodNetworkConfig and AdditionalNodeNetworkConfig feat: add enable_multi_networking to NetworkConfig PiperOrigin-RevId: 550168784 Source-Link: googleapis/googleapis@b53aeac Source-Link: https://github.com/googleapis/googleapis-gen/commit/6e0edf48c9d991a2d02aa94e723bbd07e45e14d4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmUwZWRmNDhjOWQ5OTFhMmQwMmFhOTRlNzIzYmJkMDdlNDVlMTRkNCJ9 * 🦉 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 e656b42 commit 02c497e

File tree

5 files changed

+194
-2
lines changed

5 files changed

+194
-2
lines changed

google/cloud/container_v1beta1/__init__.py

Lines changed: 6 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,
@@ -78,6 +80,7 @@
7880
GPUDriverInstallationConfig,
7981
GPUSharingConfig,
8082
HorizontalPodAutoscaling,
83+
HostMaintenancePolicy,
8184
HttpLoadBalancing,
8285
IdentityServiceConfig,
8386
ILBSubsettingConfig,
@@ -199,6 +202,8 @@
199202
__all__ = (
200203
"ClusterManagerAsyncClient",
201204
"AcceleratorConfig",
205+
"AdditionalNodeNetworkConfig",
206+
"AdditionalPodNetworkConfig",
202207
"AdditionalPodRangesConfig",
203208
"AddonsConfig",
204209
"AdvancedDatapathObservabilityConfig",
@@ -257,6 +262,7 @@
257262
"GetServerConfigRequest",
258263
"GkeBackupAgentConfig",
259264
"HorizontalPodAutoscaling",
265+
"HostMaintenancePolicy",
260266
"HttpLoadBalancing",
261267
"ILBSubsettingConfig",
262268
"IPAllocationPolicy",

google/cloud/container_v1beta1/types/__init__.py

Lines changed: 6 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,
@@ -72,6 +74,7 @@
7274
GPUDriverInstallationConfig,
7375
GPUSharingConfig,
7476
HorizontalPodAutoscaling,
77+
HostMaintenancePolicy,
7578
HttpLoadBalancing,
7679
IdentityServiceConfig,
7780
ILBSubsettingConfig,
@@ -192,6 +195,8 @@
192195

193196
__all__ = (
194197
"AcceleratorConfig",
198+
"AdditionalNodeNetworkConfig",
199+
"AdditionalPodNetworkConfig",
195200
"AdditionalPodRangesConfig",
196201
"AddonsConfig",
197202
"AdvancedDatapathObservabilityConfig",
@@ -248,6 +253,7 @@
248253
"GPUDriverInstallationConfig",
249254
"GPUSharingConfig",
250255
"HorizontalPodAutoscaling",
256+
"HostMaintenancePolicy",
251257
"HttpLoadBalancing",
252258
"IdentityServiceConfig",
253259
"ILBSubsettingConfig",

google/cloud/container_v1beta1/types/cluster_service.py

Lines changed: 180 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
"EphemeralStorageConfig",
@@ -47,6 +49,7 @@
4749
"GcfsConfig",
4850
"ReservationAffinity",
4951
"SoleTenantConfig",
52+
"HostMaintenancePolicy",
5053
"NodeTaint",
5154
"NodeTaints",
5255
"NodeLabels",
@@ -687,6 +690,10 @@ class NodeConfig(proto.Message):
687690
sole_tenant_config (google.cloud.container_v1beta1.types.SoleTenantConfig):
688691
Parameters for node pools to be backed by
689692
shared sole tenant node groups.
693+
host_maintenance_policy (google.cloud.container_v1beta1.types.HostMaintenancePolicy):
694+
HostMaintenancePolicy contains the desired
695+
maintenance policy for the Google Compute Engine
696+
hosts.
690697
"""
691698

692699
machine_type: str = proto.Field(
@@ -852,6 +859,11 @@ class NodeConfig(proto.Message):
852859
number=42,
853860
message="SoleTenantConfig",
854861
)
862+
host_maintenance_policy: "HostMaintenancePolicy" = proto.Field(
863+
proto.MESSAGE,
864+
number=44,
865+
message="HostMaintenancePolicy",
866+
)
855867

856868

857869
class AdvancedMachineFeatures(proto.Message):
@@ -953,6 +965,15 @@ class NodeNetworkConfig(proto.Message):
953965
off to next power of 2) Example: max_pods_per_node of 30
954966
will result in 32 IPs (/27) when overprovisioning is
955967
disabled.
968+
additional_node_network_configs (MutableSequence[google.cloud.container_v1beta1.types.AdditionalNodeNetworkConfig]):
969+
We specify the additional node networks for
970+
this node pool using this list. Each node
971+
network corresponds to an additional interface
972+
additional_pod_network_configs (MutableSequence[google.cloud.container_v1beta1.types.AdditionalPodNetworkConfig]):
973+
We specify the additional pod networks for
974+
this node pool using this list. Each pod network
975+
corresponds to an additional alias IP range for
976+
the node
956977
pod_ipv4_range_utilization (float):
957978
Output only. [Output only] The utilization of the IPv4 range
958979
for the pod. The ratio is Usage/[Total number of IPs in the
@@ -1032,12 +1053,86 @@ class Tier(proto.Enum):
10321053
number=13,
10331054
message="PodCIDROverprovisionConfig",
10341055
)
1056+
additional_node_network_configs: MutableSequence[
1057+
"AdditionalNodeNetworkConfig"
1058+
] = proto.RepeatedField(
1059+
proto.MESSAGE,
1060+
number=14,
1061+
message="AdditionalNodeNetworkConfig",
1062+
)
1063+
additional_pod_network_configs: MutableSequence[
1064+
"AdditionalPodNetworkConfig"
1065+
] = proto.RepeatedField(
1066+
proto.MESSAGE,
1067+
number=15,
1068+
message="AdditionalPodNetworkConfig",
1069+
)
10351070
pod_ipv4_range_utilization: float = proto.Field(
10361071
proto.DOUBLE,
10371072
number=16,
10381073
)
10391074

10401075

1076+
class AdditionalNodeNetworkConfig(proto.Message):
1077+
r"""AdditionalNodeNetworkConfig is the configuration for
1078+
additional node networks within the NodeNetworkConfig message
1079+
1080+
Attributes:
1081+
network (str):
1082+
Name of the VPC where the additional
1083+
interface belongs
1084+
subnetwork (str):
1085+
Name of the subnetwork where the additional
1086+
interface belongs
1087+
"""
1088+
1089+
network: str = proto.Field(
1090+
proto.STRING,
1091+
number=1,
1092+
)
1093+
subnetwork: str = proto.Field(
1094+
proto.STRING,
1095+
number=2,
1096+
)
1097+
1098+
1099+
class AdditionalPodNetworkConfig(proto.Message):
1100+
r"""AdditionalPodNetworkConfig is the configuration for
1101+
additional pod networks within the NodeNetworkConfig message
1102+
1103+
1104+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1105+
1106+
Attributes:
1107+
subnetwork (str):
1108+
Name of the subnetwork where the additional
1109+
pod network belongs
1110+
secondary_pod_range (str):
1111+
The name of the secondary range on the subnet
1112+
which provides IP address for this pod range
1113+
max_pods_per_node (google.cloud.container_v1beta1.types.MaxPodsConstraint):
1114+
The maximum number of pods per node which use
1115+
this pod network
1116+
1117+
This field is a member of `oneof`_ ``_max_pods_per_node``.
1118+
"""
1119+
1120+
subnetwork: str = proto.Field(
1121+
proto.STRING,
1122+
number=1,
1123+
)
1124+
secondary_pod_range: str = proto.Field(
1125+
proto.STRING,
1126+
number=2,
1127+
)
1128+
max_pods_per_node: "MaxPodsConstraint" = proto.Field(
1129+
proto.MESSAGE,
1130+
number=3,
1131+
optional=True,
1132+
message="MaxPodsConstraint",
1133+
)
1134+
1135+
10411136
class ShieldedInstanceConfig(proto.Message):
10421137
r"""A set of Shielded Instance options.
10431138
@@ -1303,6 +1398,56 @@ class Operator(proto.Enum):
13031398
)
13041399

13051400

1401+
class HostMaintenancePolicy(proto.Message):
1402+
r"""HostMaintenancePolicy contains the maintenance policy for the
1403+
hosts on which the GKE VMs run on.
1404+
1405+
1406+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1407+
1408+
Attributes:
1409+
maintenance_interval (google.cloud.container_v1beta1.types.HostMaintenancePolicy.MaintenanceInterval):
1410+
Specifies the frequency of planned
1411+
maintenance events.
1412+
1413+
This field is a member of `oneof`_ ``_maintenance_interval``.
1414+
"""
1415+
1416+
class MaintenanceInterval(proto.Enum):
1417+
r"""Allows selecting how infrastructure upgrades should be
1418+
applied to the cluster or node pool.
1419+
1420+
Values:
1421+
MAINTENANCE_INTERVAL_UNSPECIFIED (0):
1422+
The maintenance interval is not explicitly
1423+
specified.
1424+
AS_NEEDED (1):
1425+
Nodes are eligible to receive infrastructure
1426+
and hypervisor updates as they become available.
1427+
This may result in more maintenance operations
1428+
(live migrations or terminations) for the node
1429+
than the PERIODIC option.
1430+
PERIODIC (2):
1431+
Nodes receive infrastructure and hypervisor updates on a
1432+
periodic basis, minimizing the number of maintenance
1433+
operations (live migrations or terminations) on an
1434+
individual VM. This may mean underlying VMs will take longer
1435+
to receive an update than if it was configured for
1436+
AS_NEEDED. Security updates will still be applied as soon as
1437+
they are available.
1438+
"""
1439+
MAINTENANCE_INTERVAL_UNSPECIFIED = 0
1440+
AS_NEEDED = 1
1441+
PERIODIC = 2
1442+
1443+
maintenance_interval: MaintenanceInterval = proto.Field(
1444+
proto.ENUM,
1445+
number=1,
1446+
optional=True,
1447+
enum=MaintenanceInterval,
1448+
)
1449+
1450+
13061451
class NodeTaint(proto.Message):
13071452
r"""Kubernetes taint is composed of three fields: key, value, and
13081453
effect. Effect can only be one of three types: NoSchedule,
@@ -3474,6 +3619,10 @@ class NodeConfigDefaults(proto.Message):
34743619
known as Riptide) options.
34753620
logging_config (google.cloud.container_v1beta1.types.NodePoolLoggingConfig):
34763621
Logging configuration for node pools.
3622+
host_maintenance_policy (google.cloud.container_v1beta1.types.HostMaintenancePolicy):
3623+
HostMaintenancePolicy contains the desired
3624+
maintenance policy for the Google Compute Engine
3625+
hosts.
34773626
"""
34783627

34793628
gcfs_config: "GcfsConfig" = proto.Field(
@@ -3486,6 +3635,11 @@ class NodeConfigDefaults(proto.Message):
34863635
number=3,
34873636
message="NodePoolLoggingConfig",
34883637
)
3638+
host_maintenance_policy: "HostMaintenancePolicy" = proto.Field(
3639+
proto.MESSAGE,
3640+
number=5,
3641+
message="HostMaintenancePolicy",
3642+
)
34893643

34903644

34913645
class NodePoolAutoConfig(proto.Message):
@@ -3751,6 +3905,10 @@ class ClusterUpdate(proto.Message):
37513905
the autopilot cluster.
37523906
desired_k8s_beta_apis (google.cloud.container_v1beta1.types.K8sBetaAPIConfig):
37533907
Beta APIs enabled for cluster.
3908+
desired_host_maintenance_policy (google.cloud.container_v1beta1.types.HostMaintenancePolicy):
3909+
HostMaintenancePolicy contains the desired
3910+
maintenance policy for the Google Compute Engine
3911+
hosts.
37543912
"""
37553913

37563914
desired_node_version: str = proto.Field(
@@ -4028,6 +4186,11 @@ class ClusterUpdate(proto.Message):
40284186
number=131,
40294187
message="K8sBetaAPIConfig",
40304188
)
4189+
desired_host_maintenance_policy: "HostMaintenancePolicy" = proto.Field(
4190+
proto.MESSAGE,
4191+
number=132,
4192+
message="HostMaintenancePolicy",
4193+
)
40314194

40324195

40334196
class AdditionalPodRangesConfig(proto.Message):
@@ -6314,6 +6477,12 @@ class PlacementPolicy(proto.Message):
63146477
tpu_topology (str):
63156478
TPU placement topology for pod slice node pool.
63166479
https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies
6480+
policy_name (str):
6481+
If set, refers to the name of a custom
6482+
resource policy supplied by the user. The
6483+
resource policy must be in the same project and
6484+
region as the node pool. If not found,
6485+
InvalidArgument error is returned.
63176486
"""
63186487

63196488
class Type(proto.Enum):
@@ -6340,6 +6509,10 @@ class Type(proto.Enum):
63406509
proto.STRING,
63416510
number=2,
63426511
)
6512+
policy_name: str = proto.Field(
6513+
proto.STRING,
6514+
number=3,
6515+
)
63436516

63446517
name: str = proto.Field(
63456518
proto.STRING,
@@ -8008,6 +8181,9 @@ class NetworkConfig(proto.Message):
80088181
gateway_api_config (google.cloud.container_v1beta1.types.GatewayAPIConfig):
80098182
GatewayAPIConfig contains the desired config
80108183
of Gateway API on this cluster.
8184+
enable_multi_networking (bool):
8185+
Whether multi-networking is enabled for this
8186+
cluster.
80118187
network_performance_config (google.cloud.container_v1beta1.types.NetworkConfig.ClusterNetworkPerformanceConfig):
80128188
Network bandwidth tier configuration.
80138189
enable_fqdn_network_policy (bool):
@@ -8096,6 +8272,10 @@ class Tier(proto.Enum):
80968272
number=16,
80978273
message="GatewayAPIConfig",
80988274
)
8275+
enable_multi_networking: bool = proto.Field(
8276+
proto.BOOL,
8277+
number=17,
8278+
)
80998279
network_performance_config: ClusterNetworkPerformanceConfig = proto.Field(
81008280
proto.MESSAGE,
81018281
number=18,

samples/generated_samples/snippet_metadata_google.container.v1.json

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

samples/generated_samples/snippet_metadata_google.container.v1beta1.json

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

0 commit comments

Comments
 (0)