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

Commit

Permalink
feat: Add Multi-networking API (#391)
Browse files Browse the repository at this point in the history
* 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: googleapis/googleapis-gen@cc7294a
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jul 19, 2023
1 parent 06b2f8d commit 5c5cc4f
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
4 changes: 4 additions & 0 deletions google/cloud/container/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
)
from google.cloud.container_v1.types.cluster_service import (
AcceleratorConfig,
AdditionalNodeNetworkConfig,
AdditionalPodNetworkConfig,
AdditionalPodRangesConfig,
AddonsConfig,
AdvancedDatapathObservabilityConfig,
Expand Down Expand Up @@ -191,6 +193,8 @@
"ClusterManagerClient",
"ClusterManagerAsyncClient",
"AcceleratorConfig",
"AdditionalNodeNetworkConfig",
"AdditionalPodNetworkConfig",
"AdditionalPodRangesConfig",
"AddonsConfig",
"AdvancedDatapathObservabilityConfig",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/container_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from .services.cluster_manager import ClusterManagerAsyncClient, ClusterManagerClient
from .types.cluster_service import (
AcceleratorConfig,
AdditionalNodeNetworkConfig,
AdditionalPodNetworkConfig,
AdditionalPodRangesConfig,
AddonsConfig,
AdvancedDatapathObservabilityConfig,
Expand Down Expand Up @@ -185,6 +187,8 @@
__all__ = (
"ClusterManagerAsyncClient",
"AcceleratorConfig",
"AdditionalNodeNetworkConfig",
"AdditionalPodNetworkConfig",
"AdditionalPodRangesConfig",
"AddonsConfig",
"AdvancedDatapathObservabilityConfig",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/container_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
from .cluster_service import (
AcceleratorConfig,
AdditionalNodeNetworkConfig,
AdditionalPodNetworkConfig,
AdditionalPodRangesConfig,
AddonsConfig,
AdvancedDatapathObservabilityConfig,
Expand Down Expand Up @@ -178,6 +180,8 @@

__all__ = (
"AcceleratorConfig",
"AdditionalNodeNetworkConfig",
"AdditionalPodNetworkConfig",
"AdditionalPodRangesConfig",
"AddonsConfig",
"AdvancedDatapathObservabilityConfig",
Expand Down
102 changes: 102 additions & 0 deletions google/cloud/container_v1/types/cluster_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"NodeConfig",
"AdvancedMachineFeatures",
"NodeNetworkConfig",
"AdditionalNodeNetworkConfig",
"AdditionalPodNetworkConfig",
"ShieldedInstanceConfig",
"SandboxConfig",
"GcfsConfig",
Expand Down Expand Up @@ -947,6 +949,15 @@ class NodeNetworkConfig(proto.Message):
off to next power of 2) Example: max_pods_per_node of 30
will result in 32 IPs (/27) when overprovisioning is
disabled.
additional_node_network_configs (MutableSequence[google.cloud.container_v1.types.AdditionalNodeNetworkConfig]):
We specify the additional node networks for
this node pool using this list. Each node
network corresponds to an additional interface
additional_pod_network_configs (MutableSequence[google.cloud.container_v1.types.AdditionalPodNetworkConfig]):
We specify the additional pod networks for
this node pool using this list. Each pod network
corresponds to an additional alias IP range for
the node
pod_ipv4_range_utilization (float):
Output only. [Output only] The utilization of the IPv4 range
for the pod. The ratio is Usage/[Total number of IPs in the
Expand Down Expand Up @@ -1014,12 +1025,86 @@ class Tier(proto.Enum):
number=13,
message="PodCIDROverprovisionConfig",
)
additional_node_network_configs: MutableSequence[
"AdditionalNodeNetworkConfig"
] = proto.RepeatedField(
proto.MESSAGE,
number=14,
message="AdditionalNodeNetworkConfig",
)
additional_pod_network_configs: MutableSequence[
"AdditionalPodNetworkConfig"
] = proto.RepeatedField(
proto.MESSAGE,
number=15,
message="AdditionalPodNetworkConfig",
)
pod_ipv4_range_utilization: float = proto.Field(
proto.DOUBLE,
number=16,
)


class AdditionalNodeNetworkConfig(proto.Message):
r"""AdditionalNodeNetworkConfig is the configuration for
additional node networks within the NodeNetworkConfig message
Attributes:
network (str):
Name of the VPC where the additional
interface belongs
subnetwork (str):
Name of the subnetwork where the additional
interface belongs
"""

network: str = proto.Field(
proto.STRING,
number=1,
)
subnetwork: str = proto.Field(
proto.STRING,
number=2,
)


class AdditionalPodNetworkConfig(proto.Message):
r"""AdditionalPodNetworkConfig is the configuration for
additional pod networks within the NodeNetworkConfig message
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
subnetwork (str):
Name of the subnetwork where the additional
pod network belongs
secondary_pod_range (str):
The name of the secondary range on the subnet
which provides IP address for this pod range
max_pods_per_node (google.cloud.container_v1.types.MaxPodsConstraint):
The maximum number of pods per node which use
this pod network
This field is a member of `oneof`_ ``_max_pods_per_node``.
"""

subnetwork: str = proto.Field(
proto.STRING,
number=1,
)
secondary_pod_range: str = proto.Field(
proto.STRING,
number=2,
)
max_pods_per_node: "MaxPodsConstraint" = proto.Field(
proto.MESSAGE,
number=3,
optional=True,
message="MaxPodsConstraint",
)


class ShieldedInstanceConfig(proto.Message):
r"""A set of Shielded Instance options.
Expand Down Expand Up @@ -5702,6 +5787,12 @@ class PlacementPolicy(proto.Message):
Attributes:
type_ (google.cloud.container_v1.types.NodePool.PlacementPolicy.Type):
The type of placement.
policy_name (str):
If set, refers to the name of a custom
resource policy supplied by the user. The
resource policy must be in the same project and
region as the node pool. If not found,
InvalidArgument error is returned.
"""

class Type(proto.Enum):
Expand All @@ -5724,6 +5815,10 @@ class Type(proto.Enum):
number=1,
enum="NodePool.PlacementPolicy.Type",
)
policy_name: str = proto.Field(
proto.STRING,
number=3,
)

name: str = proto.Field(
proto.STRING,
Expand Down Expand Up @@ -7251,6 +7346,9 @@ class NetworkConfig(proto.Message):
gateway_api_config (google.cloud.container_v1.types.GatewayAPIConfig):
GatewayAPIConfig contains the desired config
of Gateway API on this cluster.
enable_multi_networking (bool):
Whether multi-networking is enabled for this
cluster.
network_performance_config (google.cloud.container_v1.types.NetworkConfig.ClusterNetworkPerformanceConfig):
Network bandwidth tier configuration.
enable_fqdn_network_policy (bool):
Expand Down Expand Up @@ -7339,6 +7437,10 @@ class Tier(proto.Enum):
number=16,
message="GatewayAPIConfig",
)
enable_multi_networking: bool = proto.Field(
proto.BOOL,
number=17,
)
network_performance_config: ClusterNetworkPerformanceConfig = proto.Field(
proto.MESSAGE,
number=18,
Expand Down

0 comments on commit 5c5cc4f

Please sign in to comment.