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