Skip to content

Commit

Permalink
feat: [google-cloud-gke-multicloud] added support for optionally disa…
Browse files Browse the repository at this point in the history
…bling built-in GKE metrics (#13383)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: added support for optionally disabling built-in GKE metrics
feat: added tag bindings support for Attached Clusters
docs: updated comments of existing fields
END_COMMIT_OVERRIDE



PiperOrigin-RevId: 708397945

Source-Link:
googleapis/googleapis@09b3c83

Source-Link:
googleapis/googleapis-gen@822c2ac
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZS1tdWx0aWNsb3VkLy5Pd2xCb3QueWFtbCIsImgiOiI4MjJjMmFjYWY3YWYwN2RmYmI3Zjg2Y2UyZTJlMGYyZTc0NGI3MmU1In0=

---------

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] authored Dec 23, 2024
1 parent 37589f3 commit 57232b6
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
)
from google.cloud.gke_multicloud_v1.types.common_resources import (
BinaryAuthorization,
CloudMonitoringConfig,
Fleet,
Jwk,
LoggingComponentConfig,
Expand Down Expand Up @@ -308,6 +309,7 @@
"UpdateAzureClusterRequest",
"UpdateAzureNodePoolRequest",
"BinaryAuthorization",
"CloudMonitoringConfig",
"Fleet",
"Jwk",
"LoggingComponentConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.6.16" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
)
from .types.common_resources import (
BinaryAuthorization,
CloudMonitoringConfig,
Fleet,
Jwk,
LoggingComponentConfig,
Expand Down Expand Up @@ -235,6 +236,7 @@
"AzureServicesAuthentication",
"AzureSshConfig",
"BinaryAuthorization",
"CloudMonitoringConfig",
"CreateAttachedClusterRequest",
"CreateAwsClusterRequest",
"CreateAwsNodePoolRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.6.16" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ async def sample_update_attached_cluster():
- ``proxy_config.kubernetes_secret.name``.
- ``proxy_config.kubernetes_secret.namespace``.
- ``security_posture_config.vulnerability_mode``
- ``monitoring_config.cloud_monitoring_config.enabled``
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ def sample_update_attached_cluster():
- ``proxy_config.kubernetes_secret.name``.
- ``proxy_config.kubernetes_secret.namespace``.
- ``security_posture_config.vulnerability_mode``
- ``monitoring_config.cloud_monitoring_config.enabled``
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
)
from .common_resources import (
BinaryAuthorization,
CloudMonitoringConfig,
Fleet,
Jwk,
LoggingComponentConfig,
Expand Down Expand Up @@ -279,6 +280,7 @@
"UpdateAzureClusterRequest",
"UpdateAzureNodePoolRequest",
"BinaryAuthorization",
"CloudMonitoringConfig",
"Fleet",
"Jwk",
"LoggingComponentConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ class AttachedCluster(proto.Message):
security_posture_config (google.cloud.gke_multicloud_v1.types.SecurityPostureConfig):
Optional. Security Posture configuration for
this cluster.
tags (MutableMapping[str, str]):
Optional. Input only. Tag keys/values directly bound to this
resource.
Tag key must be specified in the format / where the tag
namespace is the ID of the organization or name of the
project that the tag key is defined in. The short name of a
tag key or value can have a maximum length of 256
characters. The permitted character set for the short name
includes UTF-8 encoded Unicode characters except single
quotes ('), double quotes ("), backslashes (), and forward
slashes (/).
See
`Tags <http://cloud/resource-manager/docs/tags/tags-overview>`__
for more details on Google Cloud Platform tags.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -280,6 +296,11 @@ class State(proto.Enum):
number=26,
message=common_resources.SecurityPostureConfig,
)
tags: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=27,
)


class AttachedClustersAuthorization(proto.Message):
Expand Down Expand Up @@ -449,6 +470,10 @@ class AttachedProxyConfig(proto.Message):
the HTTP(S) proxy configuration. The secret must
be a JSON encoded proxy configuration as
described in
https://cloud.google.com/kubernetes-engine/multi-cloud/docs/attached/eks/how-to/use-a-proxy#configure-proxy-support
for EKS clusters and
https://cloud.google.com/kubernetes-engine/multi-cloud/docs/attached/aks/how-to/use-a-proxy#configure-proxy-support
for AKS clusters.
"""

kubernetes_secret: "KubernetesSecret" = proto.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class UpdateAttachedClusterRequest(proto.Message):
- ``proxy_config.kubernetes_secret.name``.
- ``proxy_config.kubernetes_secret.namespace``.
- ``security_posture_config.vulnerability_mode``
- ``monitoring_config.cloud_monitoring_config.enabled``
"""

attached_cluster: attached_resources.AttachedCluster = proto.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"LoggingComponentConfig",
"MonitoringConfig",
"ManagedPrometheusConfig",
"CloudMonitoringConfig",
"BinaryAuthorization",
"SecurityPostureConfig",
},
Expand Down Expand Up @@ -172,9 +173,11 @@ class OperationMetadata(proto.Message):
requested_cancellation (bool):
Output only. Identifies whether it has been requested
cancellation for the operation. Operations that have
successfully been cancelled have [Operation.error][] value
with a [google.rpc.Status.code][google.rpc.Status.code] of
1, corresponding to ``Code.CANCELLED``.
successfully been cancelled have
[google.longrunning.Operation.error][google.longrunning.Operation.error]
value with a
[google.rpc.Status.code][google.rpc.Status.code] of 1,
corresponding to ``Code.CANCELLED``.
"""

create_time: timestamp_pb2.Timestamp = proto.Field(
Expand Down Expand Up @@ -448,13 +451,21 @@ class MonitoringConfig(proto.Message):
managed_prometheus_config (google.cloud.gke_multicloud_v1.types.ManagedPrometheusConfig):
Enable Google Cloud Managed Service for
Prometheus in the cluster.
cloud_monitoring_config (google.cloud.gke_multicloud_v1.types.CloudMonitoringConfig):
Optionally enable GKE metrics.
Only for Attached Clusters.
"""

managed_prometheus_config: "ManagedPrometheusConfig" = proto.Field(
proto.MESSAGE,
number=2,
message="ManagedPrometheusConfig",
)
cloud_monitoring_config: "CloudMonitoringConfig" = proto.Field(
proto.MESSAGE,
number=4,
message="CloudMonitoringConfig",
)


class ManagedPrometheusConfig(proto.Message):
Expand All @@ -472,6 +483,29 @@ class ManagedPrometheusConfig(proto.Message):
)


class CloudMonitoringConfig(proto.Message):
r"""CloudMonitoringConfig defines the configuration for
built-in Cloud Logging and Monitoring.
Only for Attached Clusters.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
enabled (bool):
Enable GKE-native logging and metrics.
Only for Attached Clusters.
This field is a member of `oneof`_ ``_enabled``.
"""

enabled: bool = proto.Field(
proto.BOOL,
number=1,
optional=True,
)


class BinaryAuthorization(proto.Message):
r"""Configuration for Binary Authorization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-gke-multicloud",
"version": "0.6.16"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7006,12 +7006,16 @@ def test_create_attached_cluster_rest_call_success(request_type):
"admin_users": [{"username": "username_value"}],
"admin_groups": [{"group": "group_value"}],
},
"monitoring_config": {"managed_prometheus_config": {"enabled": True}},
"monitoring_config": {
"managed_prometheus_config": {"enabled": True},
"cloud_monitoring_config": {"enabled": True},
},
"proxy_config": {
"kubernetes_secret": {"name": "name_value", "namespace": "namespace_value"}
},
"binary_authorization": {"evaluation_mode": 1},
"security_posture_config": {"vulnerability_mode": 1},
"tags": {},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -7235,12 +7239,16 @@ def test_update_attached_cluster_rest_call_success(request_type):
"admin_users": [{"username": "username_value"}],
"admin_groups": [{"group": "group_value"}],
},
"monitoring_config": {"managed_prometheus_config": {"enabled": True}},
"monitoring_config": {
"managed_prometheus_config": {"enabled": True},
"cloud_monitoring_config": {"enabled": True},
},
"proxy_config": {
"kubernetes_secret": {"name": "name_value", "namespace": "namespace_value"}
},
"binary_authorization": {"evaluation_mode": 1},
"security_posture_config": {"vulnerability_mode": 1},
"tags": {},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10849,7 +10849,10 @@ def test_create_aws_cluster_rest_call_success(request_type):
"fleet": {"project": "project_value", "membership": "membership_value"},
"logging_config": {"component_config": {"enable_components": [1]}},
"errors": [{"message": "message_value"}],
"monitoring_config": {"managed_prometheus_config": {"enabled": True}},
"monitoring_config": {
"managed_prometheus_config": {"enabled": True},
"cloud_monitoring_config": {"enabled": True},
},
"binary_authorization": {"evaluation_mode": 1},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
Expand Down Expand Up @@ -11113,7 +11116,10 @@ def test_update_aws_cluster_rest_call_success(request_type):
"fleet": {"project": "project_value", "membership": "membership_value"},
"logging_config": {"component_config": {"enable_components": [1]}},
"errors": [{"message": "message_value"}],
"monitoring_config": {"managed_prometheus_config": {"enabled": True}},
"monitoring_config": {
"managed_prometheus_config": {"enabled": True},
"cloud_monitoring_config": {"enabled": True},
},
"binary_authorization": {"evaluation_mode": 1},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13899,7 +13899,10 @@ def test_create_azure_cluster_rest_call_success(request_type):
},
"logging_config": {"component_config": {"enable_components": [1]}},
"errors": [{"message": "message_value"}],
"monitoring_config": {"managed_prometheus_config": {"enabled": True}},
"monitoring_config": {
"managed_prometheus_config": {"enabled": True},
"cloud_monitoring_config": {"enabled": True},
},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -14166,7 +14169,10 @@ def test_update_azure_cluster_rest_call_success(request_type):
},
"logging_config": {"component_config": {"enable_components": [1]}},
"errors": [{"message": "message_value"}],
"monitoring_config": {"managed_prometheus_config": {"enabled": True}},
"monitoring_config": {
"managed_prometheus_config": {"enabled": True},
"cloud_monitoring_config": {"enabled": True},
},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down

0 comments on commit 57232b6

Please sign in to comment.