|
| 1 | +// Copyright 2022 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.gkemulticloud.v1; |
| 18 | + |
| 19 | +import "google/api/field_behavior.proto"; |
| 20 | +import "google/api/resource.proto"; |
| 21 | +import "google/cloud/gkemulticloud/v1/common_resources.proto"; |
| 22 | +import "google/protobuf/timestamp.proto"; |
| 23 | + |
| 24 | +option csharp_namespace = "Google.Cloud.GkeMultiCloud.V1"; |
| 25 | +option go_package = "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1;gkemulticloud"; |
| 26 | +option java_multiple_files = true; |
| 27 | +option java_outer_classname = "AttachedResourcesProto"; |
| 28 | +option java_package = "com.google.cloud.gkemulticloud.v1"; |
| 29 | +option php_namespace = "Google\\Cloud\\GkeMultiCloud\\V1"; |
| 30 | +option ruby_package = "Google::Cloud::GkeMultiCloud::V1"; |
| 31 | + |
| 32 | +// An Anthos cluster running on customer own infrastructure. |
| 33 | +message AttachedCluster { |
| 34 | + option (google.api.resource) = { |
| 35 | + type: "gkemulticloud.googleapis.com/AttachedCluster" |
| 36 | + pattern: "projects/{project}/locations/{location}/attachedClusters/{attached_cluster}" |
| 37 | + }; |
| 38 | + |
| 39 | + // The lifecycle state of the cluster. |
| 40 | + enum State { |
| 41 | + // Not set. |
| 42 | + STATE_UNSPECIFIED = 0; |
| 43 | + |
| 44 | + // The PROVISIONING state indicates the cluster is being registered. |
| 45 | + PROVISIONING = 1; |
| 46 | + |
| 47 | + // The RUNNING state indicates the cluster has been register and is fully |
| 48 | + // usable. |
| 49 | + RUNNING = 2; |
| 50 | + |
| 51 | + // The RECONCILING state indicates that some work is actively being done on |
| 52 | + // the cluster, such as upgrading software components. |
| 53 | + RECONCILING = 3; |
| 54 | + |
| 55 | + // The STOPPING state indicates the cluster is being de-registered. |
| 56 | + STOPPING = 4; |
| 57 | + |
| 58 | + // The ERROR state indicates the cluster is in a broken unrecoverable |
| 59 | + // state. |
| 60 | + ERROR = 5; |
| 61 | + |
| 62 | + // The DEGRADED state indicates the cluster requires user action to |
| 63 | + // restore full functionality. |
| 64 | + DEGRADED = 6; |
| 65 | + } |
| 66 | + |
| 67 | + // The name of this resource. |
| 68 | + // |
| 69 | + // Cluster names are formatted as |
| 70 | + // `projects/<project-number>/locations/<region>/attachedClusters/<cluster-id>`. |
| 71 | + // |
| 72 | + // See [Resource Names](https://cloud.google.com/apis/design/resource_names) |
| 73 | + // for more details on GCP resource names. |
| 74 | + string name = 1; |
| 75 | + |
| 76 | + // Optional. A human readable description of this cluster. |
| 77 | + // Cannot be longer than 255 UTF-8 encoded bytes. |
| 78 | + string description = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 79 | + |
| 80 | + // Required. OpenID Connect (OIDC) configuration for the cluster. |
| 81 | + AttachedOidcConfig oidc_config = 3 [(google.api.field_behavior) = REQUIRED]; |
| 82 | + |
| 83 | + // Required. The platform version for the cluster (e.g. `1.19.0-gke.1000`). |
| 84 | + // |
| 85 | + // You can list all supported versions on a given Google Cloud region by |
| 86 | + // calling |
| 87 | + // [GetAttachedServerConfig][google.cloud.gkemulticloud.v1.AttachedClusters.GetAttachedServerConfig]. |
| 88 | + string platform_version = 4 [(google.api.field_behavior) = REQUIRED]; |
| 89 | + |
| 90 | + // Required. The Kubernetes distribution of the underlying attached cluster. |
| 91 | + // |
| 92 | + // Supported values: ["eks", "aks"]. |
| 93 | + string distribution = 16 [(google.api.field_behavior) = REQUIRED]; |
| 94 | + |
| 95 | + // Output only. The region where this cluster runs. |
| 96 | + // |
| 97 | + // For EKS clusters, this is a AWS region. For AKS clusters, |
| 98 | + // this is an Azure region. |
| 99 | + string cluster_region = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 100 | + |
| 101 | + // Required. Fleet configuration. |
| 102 | + Fleet fleet = 5 [(google.api.field_behavior) = REQUIRED]; |
| 103 | + |
| 104 | + // Output only. The current state of the cluster. |
| 105 | + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 106 | + |
| 107 | + // Output only. A globally unique identifier for the cluster. |
| 108 | + string uid = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 109 | + |
| 110 | + // Output only. If set, there are currently changes in flight to the cluster. |
| 111 | + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 112 | + |
| 113 | + // Output only. The time at which this cluster was registered. |
| 114 | + google.protobuf.Timestamp create_time = 9 |
| 115 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 116 | + |
| 117 | + // Output only. The time at which this cluster was last updated. |
| 118 | + google.protobuf.Timestamp update_time = 10 |
| 119 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 120 | + |
| 121 | + // Allows clients to perform consistent read-modify-writes |
| 122 | + // through optimistic concurrency control. |
| 123 | + // |
| 124 | + // Can be sent on update and delete requests to ensure the |
| 125 | + // client has an up-to-date value before proceeding. |
| 126 | + string etag = 11; |
| 127 | + |
| 128 | + // Output only. The Kubernetes version of the cluster. |
| 129 | + string kubernetes_version = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 130 | + |
| 131 | + // Optional. Annotations on the cluster. |
| 132 | + // |
| 133 | + // This field has the same restrictions as Kubernetes annotations. |
| 134 | + // The total size of all keys and values combined is limited to 256k. |
| 135 | + // Key can have 2 segments: prefix (optional) and name (required), |
| 136 | + // separated by a slash (/). |
| 137 | + // Prefix must be a DNS subdomain. |
| 138 | + // Name must be 63 characters or less, begin and end with alphanumerics, |
| 139 | + // with dashes (-), underscores (_), dots (.), and alphanumerics between. |
| 140 | + map<string, string> annotations = 13 [(google.api.field_behavior) = OPTIONAL]; |
| 141 | + |
| 142 | + // Output only. Workload Identity settings. |
| 143 | + WorkloadIdentityConfig workload_identity_config = 14 |
| 144 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 145 | + |
| 146 | + // Optional. Logging configuration for this cluster. |
| 147 | + LoggingConfig logging_config = 15 [(google.api.field_behavior) = OPTIONAL]; |
| 148 | + |
| 149 | + // Output only. A set of errors found in the cluster. |
| 150 | + repeated AttachedClusterError errors = 20 |
| 151 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 152 | + |
| 153 | + // Optional. Configuration related to the cluster RBAC settings. |
| 154 | + AttachedClustersAuthorization authorization = 21 |
| 155 | + [(google.api.field_behavior) = OPTIONAL]; |
| 156 | + |
| 157 | + // Optional. Monitoring configuration for this cluster. |
| 158 | + MonitoringConfig monitoring_config = 23 |
| 159 | + [(google.api.field_behavior) = OPTIONAL]; |
| 160 | +} |
| 161 | + |
| 162 | +// Configuration related to the cluster RBAC settings. |
| 163 | +message AttachedClustersAuthorization { |
| 164 | + // Required. Users that can perform operations as a cluster admin. A managed |
| 165 | + // ClusterRoleBinding will be created to grant the `cluster-admin` ClusterRole |
| 166 | + // to the users. Up to ten admin users can be provided. |
| 167 | + // |
| 168 | + // For more info on RBAC, see |
| 169 | + // https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles |
| 170 | + repeated AttachedClusterUser admin_users = 1 |
| 171 | + [(google.api.field_behavior) = REQUIRED]; |
| 172 | +} |
| 173 | + |
| 174 | +// Identities of a user-type subject for Attached clusters. |
| 175 | +message AttachedClusterUser { |
| 176 | + // Required. The name of the user, e.g. `my-gcp-id@gmail.com`. |
| 177 | + string username = 1 [(google.api.field_behavior) = REQUIRED]; |
| 178 | +} |
| 179 | + |
| 180 | +// OIDC discovery information of the target cluster. |
| 181 | +// |
| 182 | +// Kubernetes Service Account (KSA) tokens are JWT tokens signed by the cluster |
| 183 | +// API server. This fields indicates how GCP services |
| 184 | +// validate KSA tokens in order to allow system workloads (such as GKE Connect |
| 185 | +// and telemetry agents) to authenticate back to GCP. |
| 186 | +// |
| 187 | +// Both clusters with public and private issuer URLs are supported. |
| 188 | +// Clusters with public issuers only need to specify the `issuer_url` field |
| 189 | +// while clusters with private issuers need to provide both |
| 190 | +// `issuer_url` and `oidc_jwks`. |
| 191 | +message AttachedOidcConfig { |
| 192 | + // A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://`. |
| 193 | + string issuer_url = 1; |
| 194 | + |
| 195 | + // Optional. OIDC verification keys in JWKS format (RFC 7517). |
| 196 | + // It contains a list of OIDC verification keys that can be used to verify |
| 197 | + // OIDC JWTs. |
| 198 | + // |
| 199 | + // This field is required for cluster that doesn't have a publicly available |
| 200 | + // discovery endpoint. When provided, it will be directly used |
| 201 | + // to verify the OIDC JWT asserted by the IDP. |
| 202 | + bytes jwks = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 203 | +} |
| 204 | + |
| 205 | +// AttachedServerConfig provides information about supported |
| 206 | +// Kubernetes versions |
| 207 | +message AttachedServerConfig { |
| 208 | + option (google.api.resource) = { |
| 209 | + type: "gkemulticloud.googleapis.com/AttachedServerConfig" |
| 210 | + pattern: "projects/{project}/locations/{location}/attachedServerConfig" |
| 211 | + }; |
| 212 | + |
| 213 | + // The resource name of the config. |
| 214 | + string name = 1; |
| 215 | + |
| 216 | + // List of valid platform versions. |
| 217 | + repeated AttachedPlatformVersionInfo valid_versions = 2; |
| 218 | +} |
| 219 | + |
| 220 | +// Information about a supported Attached Clusters platform version. |
| 221 | +message AttachedPlatformVersionInfo { |
| 222 | + // Platform version name. |
| 223 | + string version = 1; |
| 224 | +} |
| 225 | + |
| 226 | +// AttachedClusterError describes errors found on attached clusters. |
| 227 | +message AttachedClusterError { |
| 228 | + // Human-friendly description of the error. |
| 229 | + string message = 1; |
| 230 | +} |
0 commit comments