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