github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    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_pool` - (Optional) List of node pools associated with this cluster.
    89  
    90  * `node_version` - (Optional) The Kubernetes version on the nodes. Also affects
    91      the initial master version on cluster creation. Updates affect nodes only.
    92      Defaults to the default version set by GKE which is not necessarily the latest
    93      version.
    94  
    95  * `project` - (Optional) The project in which the resource belongs. If it
    96      is not provided, the provider project is used.
    97  
    98  * `subnetwork` - (Optional) The name of the Google Compute Engine subnetwork in
    99  which the cluster's instances are launched
   100  
   101  **Master Auth** supports the following arguments:
   102  
   103  * `password` - The password to use for HTTP basic authentication when accessing
   104      the Kubernetes master endpoint
   105  
   106  * `username` - The username to use for HTTP basic authentication when accessing
   107      the Kubernetes master endpoint
   108  
   109  **Node Config** supports the following arguments:
   110  
   111  * `machine_type` - (Optional) The name of a Google Compute Engine machine type.
   112      Defaults to `n1-standard-1`.
   113  
   114  * `disk_size_gb` - (Optional) Size of the disk attached to each node, specified
   115      in GB. The smallest allowed disk size is 10GB. Defaults to 100GB.
   116  
   117  * `local_ssd_count` - (Optional) The amount of local SSD disks that will be
   118      attached to each cluster node. Defaults to 0.
   119  
   120  * `oauth_scopes` - (Optional) The set of Google API scopes to be made available
   121      on all of the node VMs under the "default" service account. These can be
   122      either FQDNs, or scope aliases. The following scopes are necessary to ensure
   123      the correct functioning of the cluster:
   124  
   125    * `compute-rw` (`https://www.googleapis.com/auth/compute`)
   126    * `storage-ro` (`https://www.googleapis.com/auth/devstorage.read_only`)
   127    * `logging-write` (`https://www.googleapis.com/auth/logging.write`),
   128      if `logging_service` points to Google
   129    * `monitoring` (`https://www.googleapis.com/auth/monitoring`),
   130      if `monitoring_service` points to Google
   131  
   132  * `service_account` - (Optional) The service account to be used by the Node VMs.
   133      If not specified, the "default" service account is used.
   134  
   135  * `metadata` - (Optional) The metadata key/value pairs assigned to instances in
   136      the cluster.
   137  
   138  * `image_type` - (Optional) The image type to use for this node.
   139  
   140  **Addons Config** supports the following addons:
   141  
   142  * `http_load_balancing` - (Optional) The status of the HTTP Load Balancing
   143      add-on. It is enabled by default; set `disabled = true` to disable.
   144  * `horizontal_pod_autoscaling` - (Optional) The status of the Horizontal Pod
   145      Autoscaling addon. It is enabled by default; set `disabled = true` to
   146      disable.
   147  
   148  This example `addons_config` disables both addons:
   149  
   150  ```
   151  addons_config {
   152    http_load_balancing {
   153      disabled = true
   154    }
   155    horizontal_pod_autoscaling {
   156      disabled = true
   157    }
   158  }
   159  ```
   160  
   161  **Node Pool** supports the following arguments:
   162  
   163  * `initial_node_count` - (Required) The initial node count for the pool.
   164  
   165  * `name` - (Optional) The name of the node pool. If left blank, Terraform will
   166      auto-generate a unique name.
   167  
   168  * `name_prefix` - (Optional) Creates a unique name for the node pool beginning
   169      with the specified prefix. Conflicts with `name`.
   170  
   171  ## Attributes Reference
   172  
   173  In addition to the arguments listed above, the following computed attributes are
   174  exported:
   175  
   176  * `endpoint` - The IP address of this cluster's Kubernetes master
   177  
   178  * `instance_group_urls` - List of instance group URLs which have been assigned
   179      to the cluster
   180  
   181  * `master_auth.client_certificate` - Base64 encoded public certificate
   182      used by clients to authenticate to the cluster endpoint.
   183  
   184  * `master_auth.client_key` - Base64 encoded private key used by clients
   185      to authenticate to the cluster endpoint
   186  
   187  * `master_auth.cluster_ca_certificate` - Base64 encoded public certificate
   188      that is the root of trust for the cluster