// Copyright (c) 2015, Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.container.v1; import "google/api/annotations.proto"; option java_multiple_files = true; option java_outer_classname = "ClusterServiceProto"; option java_package = "com.google.container.v1"; // Google Container Engine Cluster Manager v1 service ClusterManager { // Lists all clusters owned by a project in either the specified zone or all zones. rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { option (google.api.http) = { get: "/v1/projects/{project_id}/zones/{zone}/clusters" }; } // Gets the details of a specific cluster. rpc GetCluster(GetClusterRequest) returns (Cluster) { option (google.api.http) = { get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" }; } // Creates a cluster, consisting of the specified number and type of Google // Compute Engine instances. // // By default, the cluster is created in the project's // [default network](/compute/docs/networks-and-firewalls#networks). // // One firewall is added for the cluster. After cluster creation, // the cluster creates routes for each node to allow the containers // on that node to communicate with all other instances in the // cluster. // // Finally, an entry is added to the project's global metadata indicating // which CIDR range is being used by the cluster. rpc CreateCluster(CreateClusterRequest) returns (Operation) { option (google.api.http) = { post: "/v1/projects/{project_id}/zones/{zone}/clusters" body: "*" }; } // Updates the settings of a specific cluster. rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { option (google.api.http) = { put: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" body: "*" }; } // Deletes the cluster, including the Kubernetes endpoint and all worker // nodes. // // Firewalls and routes that were configured during cluster creation // are also deleted. // // Other Google Compute Engine resources that might be in use by the cluster // (e.g. load balancer resources) will not be deleted if they weren't present // at the initial create time. rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { option (google.api.http) = { delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" }; } // Lists all operations in a project in a specific zone or all zones. rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { option (google.api.http) = { get: "/v1/projects/{project_id}/zones/{zone}/operations" }; } // Gets the specified operation. rpc GetOperation(GetOperationRequest) returns (Operation) { option (google.api.http) = { get: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}" }; } // Returns configuration info about the Container Engine service. rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { option (google.api.http) = { get: "/v1/projects/{project_id}/zones/{zone}/serverconfig" }; } } // Parameters that describe the nodes in a cluster. message NodeConfig { // The name of a Google Compute Engine [machine type](/compute/docs/machine-types) (e.g. // `n1-standard-1`). // // If unspecified, the default machine type is // `n1-standard-1`. string machine_type = 1; // Size of the disk attached to each node, specified in GB. // The smallest allowed disk size is 10GB. // // If unspecified, the default disk size is 100GB. int32 disk_size_gb = 2; // The set of Google API scopes to be made available on all of the // node VMs under the "default" service account. // // The following scopes are recommended, but not required, and by default are // not included: // // * `https://www.googleapis.com/auth/compute` is required for mounting // persistent storage on your nodes. // * `https://www.googleapis.com/auth/devstorage.read_only` is required for // communicating with **gcr.io** // (the [Google Container Registry](/container-registry/)). // // If unspecified, no scopes are added, unless Cloud Logging or Cloud // Monitoring are enabled, in which case their required scopes will be added. repeated string oauth_scopes = 3; // The metadata key/value pairs assigned to instances in the cluster. // // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes // in length. These are reflected as part of a URL in the metadata server. // Additionally, to avoid ambiguity, keys must not conflict with any other // metadata keys for the project or be one of the four reserved keys: // "instance-template", "kube-env", "startup-script", and "user-data" // // Values are free-form strings, and only have meaning as interpreted by // the image running in the instance. The only restriction placed on them is // that each value's size must be less than or equal to 32 KB. // // The total size of all keys and values must be less than 512 KB. map metadata = 4; } // The authentication information for accessing the master endpoint. // Authentication can be done using HTTP basic auth or using client // certificates. message MasterAuth { // The username to use for HTTP basic authentication to the master endpoint. string username = 1; // The password to use for HTTP basic authentication to the master endpoint. // Because the master endpoint is open to the Internet, you should create a // strong password. string password = 2; // [Output only] Base64-encoded public certificate that is the root of // trust for the cluster. string cluster_ca_certificate = 100; // [Output only] Base64-encoded public certificate used by clients to // authenticate to the cluster endpoint. string client_certificate = 101; // [Output only] Base64-encoded private key used by clients to authenticate // to the cluster endpoint. string client_key = 102; } // Configuration for the addons that can be automatically spun up in the // cluster, enabling additional functionality. message AddonsConfig { // Configuration for the HTTP (L7) load balancing controller addon, which // makes it easy to set up HTTP load balancers for services in a cluster. HttpLoadBalancing http_load_balancing = 1; // Configuration for the horizontal pod autoscaling feature, which // increases or decreases the number of replica pods a replication controller // has based on the resource usage of the existing pods. HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; } // Configuration options for the HTTP (L7) load balancing controller addon, // which makes it easy to set up HTTP load balancers for services in a cluster. message HttpLoadBalancing { // Whether the HTTP Load Balancing controller is enabled in the cluster. // When enabled, it runs a small pod in the cluster that manages the load // balancers. bool disabled = 1; } // Configuration options for the horizontal pod autoscaling feature, which // increases or decreases the number of replica pods a replication controller // has based on the resource usage of the existing pods. message HorizontalPodAutoscaling { // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. // When enabled, it ensures that a Heapster pod is running in the cluster, // which is also used by the Cloud Monitoring service. bool disabled = 1; } // A Google Container Engine cluster. message Cluster { // The current status of the cluster. enum Status { // Not set. STATUS_UNSPECIFIED = 0; // The PROVISIONING state indicates the cluster is being created. PROVISIONING = 1; // The RUNNING state indicates the cluster has been created and is fully usable. RUNNING = 2; // The RECONCILING state indicates that some work is actively being done on // the cluster, such as upgrading the master or node software. Details can // be found in the `statusMessage` field. RECONCILING = 3; // The STOPPING state indicates the cluster is being deleted. STOPPING = 4; // The ERROR state indicates the cluster may be unusable. Details // can be found in the `statusMessage` field. ERROR = 5; } // The name of this cluster. The name must be unique within this project // and zone, and can be up to 40 characters with the following restrictions: // // * Lowercase letters, numbers, and hyphens only. // * Must start with a letter. // * Must end with a number or a letter. string name = 1; // An optional description of this cluster. string description = 2; // The number of nodes to create in this cluster. You must ensure that your // Compute Engine resource quota // is sufficient for this number of instances. You must also have available // firewall and routes quota. // For requests, this field should only be used in lieu of a // "node_pool" object, since this configuration (along with the // "node_config") will be used to create a "NodePool" object with an // auto-generated name. Do not use this and a node_pool at the same time. int32 initial_node_count = 3; // Parameters used in creating the cluster's nodes. // See `nodeConfig` for the description of its properties. // For requests, this field should only be used in lieu of a // "node_pool" object, since this configuration (along with the // "initial_node_count") will be used to create a "NodePool" object with an // auto-generated name. Do not use this and a node_pool at the same time. // For responses, this field will be populated with the node configuration of // the first node pool. // // If unspecified, the defaults are used. NodeConfig node_config = 4; // The authentication information for accessing the master endpoint. MasterAuth master_auth = 5; // The logging service the cluster should use to write logs. // Currently available options: // // * `logging.googleapis.com` - the Google Cloud Logging service. // * `none` - no logs will be exported from the cluster. // * if left as an empty string,`logging.googleapis.com` will be used. string logging_service = 6; // The monitoring service the cluster should use to write metrics. // Currently available options: // // * `monitoring.googleapis.com` - the Google Cloud Monitoring service. // * `none` - no metrics will be exported from the cluster. // * if left as an empty string, `monitoring.googleapis.com` will be used. string monitoring_service = 7; // The name of the Google Compute Engine // [network](/compute/docs/networks-and-firewalls#networks) to which the // cluster is connected. If left unspecified, the `default` network // will be used. string network = 8; // The IP address range of the container pods in this cluster, in // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // notation (e.g. `10.96.0.0/14`). Leave blank to have // one automatically chosen or specify a `/14` block in `10.0.0.0/8`. string cluster_ipv4_cidr = 9; // Configurations for the various addons available to run in the cluster. AddonsConfig addons_config = 10; // The name of the Google Compute Engine // [subnetwork](/compute/docs/subnetworks) to which the // cluster is connected. Specification of subnetworks is an alpha feature, // and require that the Google Compute Engine alpha API be enabled. string subnetwork = 11; // [Output only] Server-defined URL for the resource. string self_link = 100; // [Output only] The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides. string zone = 101; // [Output only] The IP address of this cluster's master endpoint. // The endpoint can be accessed from the internet at // `https://username:password@endpoint/`. // // See the `masterAuth` property of this resource for username and // password information. string endpoint = 102; // [Output only] The software version of the master endpoint and kubelets used // in the cluster when it was first created. The version can be upgraded over // time. // string initial_cluster_version = 103; // [Output only] The current software version of the master endpoint. string current_master_version = 104; // [Output only] The current version of the node software components. // If they are currently at multiple versions because they're in the process // of being upgraded, this reflects the minimum version of all nodes. string current_node_version = 105; // [Output only] The time the cluster was created, in // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. string create_time = 106; // [Output only] The current status of this cluster. Status status = 107; // [Output only] Additional information about the current status of this // cluster, if available. string status_message = 108; // [Output only] The size of the address space on each node for hosting // containers. This is provisioned from within the `container_ipv4_cidr` range. int32 node_ipv4_cidr_size = 109; // [Output only] The IP address range of the Kubernetes services in // this cluster, in // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // notation (e.g. `1.2.3.4/29`). Service addresses are // typically put in the last `/16` from the container CIDR. string services_ipv4_cidr = 110; // [Output only] The resource URLs of [instance // groups](/compute/docs/instance-groups/) associated with this // cluster. repeated string instance_group_urls = 111; // [Output only] The number of nodes currently in the cluster. int32 current_node_count = 112; } // ClusterUpdate describes an update to the cluster. Exactly one update can // be applied to a cluster with each request, so at most one field can be // provided. message ClusterUpdate { // The Kubernetes version to change the nodes to (typically an // upgrade). Use `-` to upgrade to the latest version supported by // the server. string desired_node_version = 4; // The monitoring service the cluster should use to write metrics. // Currently available options: // // * "monitoring.googleapis.com" - the Google Cloud Monitoring service // * "none" - no metrics will be exported from the cluster string desired_monitoring_service = 5; // Configurations for the various addons available to run in the cluster. AddonsConfig desired_addons_config = 6; // The Kubernetes version to change the master to. The only valid value is the // latest supported version. Use "-" to have the server automatically select // the latest version. string desired_master_version = 100; } // This operation resource represents operations that may have happened or are // happening on the cluster. All fields are output only. message Operation { // Current status of the operation. enum Status { // Not set. STATUS_UNSPECIFIED = 0; // The operation has been created. PENDING = 1; // The operation is currently running. RUNNING = 2; // The operation is done, either cancelled or completed. DONE = 3; } // Operation type. enum Type { // Not set. TYPE_UNSPECIFIED = 0; // Cluster create. CREATE_CLUSTER = 1; // Cluster delete. DELETE_CLUSTER = 2; // A master upgrade. UPGRADE_MASTER = 3; // A node upgrade. UPGRADE_NODES = 4; // Cluster repair. REPAIR_CLUSTER = 5; // Cluster update. UPDATE_CLUSTER = 6; // Node pool create. CREATE_NODE_POOL = 7; // Node pool delete. DELETE_NODE_POOL = 8; } // The server-assigned ID for the operation. string name = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the operation // is taking place. string zone = 2; // The operation type. Type operation_type = 3; // The current status of the operation. Status status = 4; // Detailed operation progress, if available. string detail = 8; // If an error has occurred, a textual description of the error. string status_message = 5; // Server-defined URL for the resource. string self_link = 6; // Server-defined URL for the target of the operation. string target_link = 7; } // CreateClusterRequest creates a cluster. message CreateClusterRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides. string zone = 2; // A [cluster resource](/container-engine/reference/rest/v1/projects.zones.clusters) Cluster cluster = 3; } // GetClusterRequest gets the settings of a cluster. message GetClusterRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides. string zone = 2; // The name of the cluster to retrieve. string cluster_id = 3; } // UpdateClusterRequest updates the settings of a cluster. message UpdateClusterRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides. string zone = 2; // The name of the cluster to upgrade. string cluster_id = 3; // A description of the update. ClusterUpdate update = 4; } // DeleteClusterRequest deletes a cluster. message DeleteClusterRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides. string zone = 2; // The name of the cluster to delete. string cluster_id = 3; } // ListClustersRequest lists clusters. message ListClustersRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides, or "-" for all zones. string zone = 2; } // ListClustersResponse is the result of ListClustersRequest. message ListClustersResponse { // A list of clusters in the project in the specified zone, or // across all ones. repeated Cluster clusters = 1; // If any zones are listed here, the list of clusters returned // may be missing those zones. repeated string missing_zones = 2; } // GetOperationRequest gets a single operation. message GetOperationRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine // [zone](/compute/docs/zones#available) in which the cluster // resides. string zone = 2; // The server-assigned `name` of the operation. string operation_id = 3; } // ListOperationsRequest lists operations. message ListOperationsRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine [zone](/compute/docs/zones#available) // to return operations for, or `-` for all zones. string zone = 2; } // ListOperationsResponse is the result of ListOperationsRequest. message ListOperationsResponse { // A list of operations in the project in the specified zone. repeated Operation operations = 1; // If any zones are listed here, the list of operations returned // may be missing the operations from those zones. repeated string missing_zones = 2; } // Gets the current Container Engine service configuration. message GetServerConfigRequest { // The Google Developers Console [project ID or project // number](https://support.google.com/cloud/answer/6158840). string project_id = 1; // The name of the Google Compute Engine [zone](/compute/docs/zones#available) // to return operations for. string zone = 2; } // Container Engine service configuration. message ServerConfig { // Version of Kubernetes the service deploys by default. string default_cluster_version = 1; // List of valid node upgrade target versions. repeated string valid_node_versions = 3; }