github.com/bpineau/terraform@v0.8.0-rc1.0.20161126184705-a8886012d185/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. Only valid
    77      for upgrading of existing cluster. Defaults to latest version supported by
    78      the server.
    79  
    80  * `project` - (Optional) The project in which the resource belongs. If it
    81      is not provided, the provider project is used.
    82  
    83  * `subnetwork` - (Optional) The name of the Google Compute Engine subnetwork in
    84  which the cluster's instances are launched
    85  
    86  **Master Auth** supports the following arguments:
    87  
    88  * `password` - The password to use for HTTP basic authentication when accessing
    89      the Kubernetes master endpoint
    90  
    91  * `username` - The username to use for HTTP basic authentication when accessing
    92      the Kubernetes master endpoint
    93  
    94  **Node Config** supports the following arguments:
    95  
    96  * `machine_type` - (Optional) The name of a Google Compute Engine machine type.
    97      Defaults to `n1-standard-1`.
    98  
    99  * `disk_size_gb` - (Optional) Size of the disk attached to each node, specified
   100      in GB. The smallest allowed disk size is 10GB. Defaults to 100GB.
   101  
   102  * `oauth_scopes` - (Optional) The set of Google API scopes to be made available
   103      on all of the node VMs under the "default" service account. These can be
   104      either FQDNs, or scope aliases. The following scopes are necessary to ensure
   105      the correct functioning of the cluster:
   106  
   107    * `compute-rw` (`https://www.googleapis.com/auth/compute`)
   108    * `storage-ro` (`https://www.googleapis.com/auth/devstorage.read_only`)
   109    * `logging-write` (`https://www.googleapis.com/auth/logging.write`),
   110      if `logging_service` points to Google
   111    * `monitoring` (`https://www.googleapis.com/auth/monitoring`),
   112      if `monitoring_service` points to Google
   113  
   114  **Addons Config** supports the following addons:
   115  
   116  * `http_load_balancing` - (Optional) The status of the HTTP Load Balancing
   117      add-on. It is enabled by default; set `disabled = true` to disable.
   118  * `horizontal_pod_autoscaling` - (Optional) The status of the Horizontal Pod
   119      Autoscaling addon. It is enabled by default; set `disabled = true` to
   120      disable.
   121  
   122  This example `addons_config` disables both addons:
   123  
   124  ```
   125  addons_config {
   126    http_load_balancing {
   127      disabled = true
   128    }
   129    horizontal_pod_autoscaling {
   130      disabled = true
   131    }
   132  }
   133  ```
   134  
   135  ## Attributes Reference
   136  
   137  In addition to the arguments listed above, the following computed attributes are
   138  exported:
   139  
   140  * `endpoint` - The IP address of this cluster's Kubernetes master
   141  
   142  * `instance_group_urls` - List of instance group URLs which have been assigned
   143      to the cluster
   144  
   145  * `master_auth.client_certificate` - Base64 encoded public certificate
   146      used by clients to authenticate to the cluster endpoint.
   147  
   148  * `master_auth.client_key` - Base64 encoded private key used by clients
   149      to authenticate to the cluster endpoint
   150  
   151  * `master_auth.cluster_ca_certificate` - Base64 encoded public certificate
   152      that is the root of trust for the cluster