github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/google/r/container_cluster.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_container_cluster" 4 sidebar_current: "docs-google-container-cluster" 5 description: |- 6 Creates a GKE cluster. 7 --- 8 9 # google\_container\_cluster 10 11 !> **Warning:** Due to limitations of the API, all arguments except 12 `node_version` are non-updateable. Changing any will cause recreation of the 13 whole cluster! 14 15 ## Example usage 16 17 ```js 18 resource "google_container_cluster" "primary" { 19 name = "marcellus-wallace" 20 zone = "us-central1-a" 21 initial_node_count = 3 22 23 additional_zones = [ 24 "us-central1-b", 25 "us-central1-c", 26 ] 27 28 master_auth { 29 username = "mr.yoda" 30 password = "adoy.rm" 31 } 32 33 node_config { 34 oauth_scopes = [ 35 "https://www.googleapis.com/auth/compute", 36 "https://www.googleapis.com/auth/devstorage.read_only", 37 "https://www.googleapis.com/auth/logging.write", 38 "https://www.googleapis.com/auth/monitoring", 39 ] 40 } 41 } 42 ``` 43 44 ## Argument Reference 45 46 * `initial_node_count` - (Required) The number of nodes to create in this 47 cluster (not including the Kubernetes master). 48 49 * `master_auth` - (Required) The authentication information for accessing the 50 Kubernetes master. 51 52 * `name` - (Required) The name of the cluster, unique within the project and 53 zone. 54 55 * `zone` - (Required) The zone that the master and the number of nodes specified 56 in `initial_node_count` should be created in. 57 58 - - - 59 * `additional_zones` - (Optional) If additional zones are configured, the number 60 of nodes specified in `initial_node_count` is created in all specified zones. 61 62 * `addons_config` - (Optional) The configuration for addons supported by Google 63 Container Engine 64 65 * `cluster_ipv4_cidr` - (Optional) The IP address range of the container pods in 66 this cluster. Default is an automatically assigned CIDR. 67 68 * `description` - (Optional) Description of the cluster. 69 70 * `logging_service` - (Optional) The logging service that the cluster should 71 write logs to. Available options include `logging.googleapis.com` and 72 `none`. Defaults to `logging.googleapis.com` 73 74 * `monitoring_service` - (Optional) The monitoring service that the cluster 75 should write metrics to. Available options include 76 `monitoring.googleapis.com` and `none`. Defaults to 77 `monitoring.googleapis.com` 78 79 * `network` - (Optional) The name or self_link of the Google Compute Engine 80 network to which the cluster is connected 81 82 * `node_config` - (Optional) The machine type and image to use for all nodes in 83 this cluster 84 85 * `node_version` - (Optional) The Kubernetes version on the nodes. Also affects 86 the initial master version on cluster creation. Updates affect nodes only. 87 Defaults to the default version set by GKE which is not necessarily the latest 88 version. 89 90 * `project` - (Optional) The project in which the resource belongs. If it 91 is not provided, the provider project is used. 92 93 * `subnetwork` - (Optional) The name of the Google Compute Engine subnetwork in 94 which the cluster's instances are launched 95 96 **Master Auth** supports the following arguments: 97 98 * `password` - The password to use for HTTP basic authentication when accessing 99 the Kubernetes master endpoint 100 101 * `username` - The username to use for HTTP basic authentication when accessing 102 the Kubernetes master endpoint 103 104 **Node Config** supports the following arguments: 105 106 * `machine_type` - (Optional) The name of a Google Compute Engine machine type. 107 Defaults to `n1-standard-1`. 108 109 * `disk_size_gb` - (Optional) Size of the disk attached to each node, specified 110 in GB. The smallest allowed disk size is 10GB. Defaults to 100GB. 111 112 * `oauth_scopes` - (Optional) The set of Google API scopes to be made available 113 on all of the node VMs under the "default" service account. These can be 114 either FQDNs, or scope aliases. The following scopes are necessary to ensure 115 the correct functioning of the cluster: 116 117 * `compute-rw` (`https://www.googleapis.com/auth/compute`) 118 * `storage-ro` (`https://www.googleapis.com/auth/devstorage.read_only`) 119 * `logging-write` (`https://www.googleapis.com/auth/logging.write`), 120 if `logging_service` points to Google 121 * `monitoring` (`https://www.googleapis.com/auth/monitoring`), 122 if `monitoring_service` points to Google 123 124 **Addons Config** supports the following addons: 125 126 * `http_load_balancing` - (Optional) The status of the HTTP Load Balancing 127 add-on. It is enabled by default; set `disabled = true` to disable. 128 * `horizontal_pod_autoscaling` - (Optional) The status of the Horizontal Pod 129 Autoscaling addon. It is enabled by default; set `disabled = true` to 130 disable. 131 132 This example `addons_config` disables both addons: 133 134 ``` 135 addons_config { 136 http_load_balancing { 137 disabled = true 138 } 139 horizontal_pod_autoscaling { 140 disabled = true 141 } 142 } 143 ``` 144 145 ## Attributes Reference 146 147 In addition to the arguments listed above, the following computed attributes are 148 exported: 149 150 * `endpoint` - The IP address of this cluster's Kubernetes master 151 152 * `instance_group_urls` - List of instance group URLs which have been assigned 153 to the cluster 154 155 * `master_auth.client_certificate` - Base64 encoded public certificate 156 used by clients to authenticate to the cluster endpoint. 157 158 * `master_auth.client_key` - Base64 encoded private key used by clients 159 to authenticate to the cluster endpoint 160 161 * `master_auth.cluster_ca_certificate` - Base64 encoded public certificate 162 that is the root of trust for the cluster