1- // Copyright 2021 Google LLC
1+ // Copyright 2023 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -41,8 +41,9 @@ message Membership {
4141 MembershipEndpoint endpoint = 4 [(google.api.field_behavior ) = OPTIONAL ];
4242 }
4343
44- // Output only. The full, unique name of this Membership resource in the format
45- // `projects/*/locations/*/memberships/{membership_id}`, set during creation.
44+ // Output only. The full, unique name of this Membership resource in the
45+ // format `projects/*/locations/*/memberships/{membership_id}`, set during
46+ // creation.
4647 //
4748 // `membership_id` must be a valid RFC 1123 compliant DNS label:
4849 //
@@ -54,7 +55,7 @@ message Membership {
5455 // with a maximum length of 63 characters.
5556 string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
5657
57- // Optional. GCP labels for this membership.
58+ // Optional. Labels for this membership.
5859 map <string , string > labels = 2 [(google.api.field_behavior ) = OPTIONAL ];
5960
6061 // Output only. Description of this membership, limited to 63 characters.
@@ -67,82 +68,98 @@ message Membership {
6768 MembershipState state = 5 [(google.api.field_behavior ) = OUTPUT_ONLY ];
6869
6970 // Output only. When the Membership was created.
70- google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior ) = OUTPUT_ONLY ];
71+ google.protobuf.Timestamp create_time = 6
72+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
7173
7274 // Output only. When the Membership was last updated.
73- google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior ) = OUTPUT_ONLY ];
75+ google.protobuf.Timestamp update_time = 7
76+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
7477
7578 // Output only. When the Membership was deleted.
76- google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior ) = OUTPUT_ONLY ];
79+ google.protobuf.Timestamp delete_time = 8
80+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
7781
78- // Optional. An externally-generated and managed ID for this Membership. This ID may
79- // be modified after creation, but this is not recommended.
82+ // Optional. An externally-generated and managed ID for this Membership. This
83+ // ID may be modified after creation, but this is not recommended.
8084 //
8185 // The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
8286 //
8387 // If this Membership represents a Kubernetes cluster, this value should be
8488 // set to the UID of the `kube-system` namespace object.
8589 string external_id = 9 [(google.api.field_behavior ) = OPTIONAL ];
8690
87- // Output only. For clusters using Connect, the timestamp of the most recent connection
88- // established with Google Cloud. This time is updated every several minutes,
89- // not continuously. For clusters that do not use GKE Connect, or that have
90- // never connected successfully, this field will be unset.
91- google.protobuf.Timestamp last_connection_time = 10 [(google.api.field_behavior ) = OUTPUT_ONLY ];
91+ // Output only. For clusters using Connect, the timestamp of the most recent
92+ // connection established with Google Cloud. This time is updated every
93+ // several minutes, not continuously. For clusters that do not use GKE
94+ // Connect, or that have never connected successfully, this field will be
95+ // unset.
96+ google.protobuf.Timestamp last_connection_time = 10
97+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
9298
93- // Output only. Google-generated UUID for this resource. This is unique across all
94- // Membership resources. If a Membership resource is deleted and another
99+ // Output only. Google-generated UUID for this resource. This is unique across
100+ // all Membership resources. If a Membership resource is deleted and another
95101 // resource with the same name is created, it gets a different unique_id.
96102 string unique_id = 11 [(google.api.field_behavior ) = OUTPUT_ONLY ];
97103
98104 // Optional. How to identify workloads from this Membership.
99105 // See the documentation on Workload Identity for more details:
100106 // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
101107 Authority authority = 12 [(google.api.field_behavior ) = OPTIONAL ];
108+
109+ // Optional. The monitoring config information for this membership.
110+ MonitoringConfig monitoring_config = 14
111+ [(google.api.field_behavior ) = OPTIONAL ];
102112}
103113
104114// MembershipEndpoint contains information needed to contact a Kubernetes API,
105115// endpoint and any additional Kubernetes metadata.
106116message MembershipEndpoint {
107117 // Optional. GKE-specific information. Only present if this Membership is a GKE cluster.
108- GkeCluster gke_cluster = 1 [(google.api.field_behavior ) = OPTIONAL ];
118+ GkeCluster gke_cluster = 1 [(google.api.field_behavior ) = OPTIONAL ];
109119
110120 // Output only. Useful Kubernetes-specific metadata.
111- KubernetesMetadata kubernetes_metadata = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
121+ KubernetesMetadata kubernetes_metadata = 2
122+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
112123
113- // Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
114- // registered cluster, in the steady state. These resources:
124+ // Optional. The in-cluster Kubernetes Resources that should be applied for a
125+ // correctly registered cluster, in the steady state. These resources:
115126 //
116127 // * Ensure that the cluster is exclusively registered to one and only one
117128 // Hub Membership.
118129 // * Propagate Workload Pool Information available in the Membership
119130 // Authority field.
120131 // * Ensure proper initial configuration of default Hub Features.
121- KubernetesResource kubernetes_resource = 3 [(google.api.field_behavior ) = OPTIONAL ];
132+ KubernetesResource kubernetes_resource = 3
133+ [(google.api.field_behavior ) = OPTIONAL ];
134+
135+ // Output only. Whether the lifecycle of this membership is managed by a
136+ // google cluster platform service.
137+ bool google_managed = 8 [(google.api.field_behavior ) = OUTPUT_ONLY ];
122138}
123139
124140// KubernetesResource contains the YAML manifests and configuration for
125141// Membership Kubernetes resources in the cluster. After CreateMembership or
126142// UpdateMembership, these resources should be re-applied in the cluster.
127143message KubernetesResource {
128- // Input only. The YAML representation of the Membership CR. This field is ignored for GKE
129- // clusters where Hub can read the CR directly.
144+ // Input only. The YAML representation of the Membership CR. This field is
145+ // ignored for GKE clusters where Hub can read the CR directly.
130146 //
131147 // Callers should provide the CR that is currently present in the cluster
132148 // during CreateMembership or UpdateMembership, or leave this field empty if
133149 // none exists. The CR manifest is used to validate the cluster has not been
134150 // registered with another Membership.
135151 string membership_cr_manifest = 1 [(google.api.field_behavior ) = INPUT_ONLY ];
136152
137- // Output only. Additional Kubernetes resources that need to be applied to the cluster
138- // after Membership creation, and after every update.
153+ // Output only. Additional Kubernetes resources that need to be applied to the
154+ // cluster after Membership creation, and after every update.
139155 //
140156 // This field is only populated in the Membership returned from a successful
141157 // long-running operation from CreateMembership or UpdateMembership. It is not
142158 // populated during normal GetMembership or ListMemberships requests. To get
143159 // the resource manifest after the initial registration, the caller should
144160 // make a UpdateMembership call with an empty field mask.
145- repeated ResourceManifest membership_resources = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
161+ repeated ResourceManifest membership_resources = 2
162+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
146163
147164 // Output only. The Kubernetes resources for installing the GKE Connect agent
148165 //
@@ -151,17 +168,18 @@ message KubernetesResource {
151168 // populated during normal GetMembership or ListMemberships requests. To get
152169 // the resource manifest after the initial registration, the caller should
153170 // make a UpdateMembership call with an empty field mask.
154- repeated ResourceManifest connect_resources = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
171+ repeated ResourceManifest connect_resources = 3
172+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
155173
156174 // Optional. Options for Kubernetes resource generation.
157175 ResourceOptions resource_options = 4 [(google.api.field_behavior ) = OPTIONAL ];
158176}
159177
160178// ResourceOptions represent options for Kubernetes resource generation.
161179message ResourceOptions {
162- // Optional. The Connect agent version to use for connect_resources. Defaults to the
163- // latest GKE Connect version. The version must be a currently supported
164- // version, obsolete versions will be rejected.
180+ // Optional. The Connect agent version to use for connect_resources. Defaults
181+ // to the latest GKE Connect version. The version must be a currently
182+ // supported version, obsolete versions will be rejected.
165183 string connect_version = 1 [(google.api.field_behavior ) = OPTIONAL ];
166184
167185 // Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
@@ -170,8 +188,8 @@ message ResourceOptions {
170188 // <1.16.
171189 bool v1beta1_crd = 2 [(google.api.field_behavior ) = OPTIONAL ];
172190
173- // Optional. Major version of the Kubernetes cluster. This is only used to determine
174- // which version to use for the CustomResourceDefinition resources,
191+ // Optional. Major version of the Kubernetes cluster. This is only used to
192+ // determine which version to use for the CustomResourceDefinition resources,
175193 // `apiextensions/v1beta1` or`apiextensions/v1`.
176194 string k8s_version = 3 [(google.api.field_behavior ) = OPTIONAL ];
177195}
@@ -192,23 +210,30 @@ message ResourceManifest {
192210
193211// GkeCluster contains information specific to GKE clusters.
194212message GkeCluster {
195- // Immutable. Self-link of the GCP resource for the GKE cluster. For example:
213+ // Immutable. Self-link of the Google Cloud resource for the GKE cluster. For
214+ // example:
196215 //
197216 // //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
198217 //
199218 // Zonal clusters are also supported.
200219 string resource_link = 1 [(google.api.field_behavior ) = IMMUTABLE ];
220+
221+ // Output only. If cluster_missing is set then it denotes that the GKE cluster
222+ // no longer exists in the GKE Control Plane.
223+ bool cluster_missing = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
201224}
202225
203226// KubernetesMetadata provides informational metadata for Memberships
204227// representing Kubernetes clusters.
205228message KubernetesMetadata {
206- // Output only. Kubernetes API server version string as reported by `/version`.
207- string kubernetes_api_server_version = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
208-
209- // Output only. Node providerID as reported by the first node in the list of nodes on
210- // the Kubernetes endpoint. On Kubernetes platforms that support zero-node
211- // clusters (like GKE-on-GCP), the node_count will be zero and the
229+ // Output only. Kubernetes API server version string as reported by
230+ // `/version`.
231+ string kubernetes_api_server_version = 1
232+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
233+
234+ // Output only. Node providerID as reported by the first node in the list of
235+ // nodes on the Kubernetes endpoint. On Kubernetes platforms that support
236+ // zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
212237 // node_provider_id will be empty.
213238 string node_provider_id = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
214239
@@ -218,14 +243,44 @@ message KubernetesMetadata {
218243 // Output only. vCPU count as reported by Kubernetes nodes resources.
219244 int32 vcpu_count = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
220245
221- // Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
222- // resources, defined in MB.
246+ // Output only. The total memory capacity as reported by the sum of all
247+ // Kubernetes nodes resources, defined in MB.
223248 int32 memory_mb = 5 [(google.api.field_behavior ) = OUTPUT_ONLY ];
224249
225- // Output only. The time at which these details were last updated. This update_time is
226- // different from the Membership-level update_time since EndpointDetails are
227- // updated internally for API consumers.
228- google.protobuf.Timestamp update_time = 100 [(google.api.field_behavior ) = OUTPUT_ONLY ];
250+ // Output only. The time at which these details were last updated. This
251+ // update_time is different from the Membership-level update_time since
252+ // EndpointDetails are updated internally for API consumers.
253+ google.protobuf.Timestamp update_time = 100
254+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
255+ }
256+
257+ // This field informs Fleet-based applications/services/UIs with the necessary
258+ // information for where each underlying Cluster reports its metrics.
259+ message MonitoringConfig {
260+ // Immutable. Project used to report Metrics
261+ string project_id = 1 [(google.api.field_behavior ) = IMMUTABLE ];
262+
263+ // Immutable. Location used to report Metrics
264+ string location = 2 [(google.api.field_behavior ) = IMMUTABLE ];
265+
266+ // Immutable. Cluster name used to report metrics.
267+ // For Anthos on VMWare/Baremetal, it would be in format
268+ // `memberClusters/cluster_name`; And for Anthos on MultiCloud, it would be in
269+ // format
270+ // `{azureClusters, awsClusters}/cluster_name`.
271+ string cluster = 3 [(google.api.field_behavior ) = IMMUTABLE ];
272+
273+ // Kubernetes system metrics, if available, are written to this prefix.
274+ // This defaults to kubernetes.io for GKE, and kubernetes.io/anthos for Anthos
275+ // eventually. Noted: Anthos MultiCloud will have kubernetes.io prefix today
276+ // but will migration to be under kubernetes.io/anthos
277+ string kubernetes_metrics_prefix = 4 ;
278+
279+ // Immutable. Cluster hash, this is a unique string generated by google code,
280+ // which does not contain any PII, which we can use to reference the cluster.
281+ // This is expected to be created by the monitoring stack and persisted into
282+ // the Cluster object as well as to GKE-Hub.
283+ string cluster_hash = 5 [(google.api.field_behavior ) = IMMUTABLE ];
229284}
230285
231286// MembershipState describes the state of a Membership resource.
@@ -259,8 +314,8 @@ message MembershipState {
259314// See the workload identity documentation for more details:
260315// https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
261316message Authority {
262- // Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
263- // be a valid URL with length <2000 characters.
317+ // Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
318+ // `https://` and be a valid URL with length <2000 characters.
264319 //
265320 // If set, then Google will allow valid OIDC tokens from this issuer to
266321 // authenticate within the workload_identity_pool. OIDC discovery will be
@@ -271,20 +326,21 @@ message Authority {
271326 // a new issuer (and re-enabling Workload Identity).
272327 string issuer = 1 [(google.api.field_behavior ) = OPTIONAL ];
273328
274- // Output only. The name of the workload identity pool in which `issuer` will be
275- // recognized.
329+ // Output only. The name of the workload identity pool in which `issuer` will
330+ // be recognized.
276331 //
277332 // There is a single Workload Identity Pool per Hub that is shared
278333 // between all Memberships that belong to that Hub. For a Hub hosted in
279334 // {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
280335 // although this is subject to change in newer versions of this API.
281336 string workload_identity_pool = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
282337
283- // Output only. An identity provider that reflects the `issuer` in the workload identity
284- // pool.
338+ // Output only. An identity provider that reflects the `issuer` in the
339+ // workload identity pool.
285340 string identity_provider = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
286341
287- // Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
342+ // Optional. OIDC verification keys for this Membership in JWKS format (RFC
343+ // 7517).
288344 //
289345 // When this field is set, OIDC discovery will NOT be performed on `issuer`,
290346 // and instead OIDC tokens will be validated using this field.
0 commit comments