Improve this page

gke-clusterBack to Google Cloud Platform index <–

gke-cluster

under review

gke-cluster

Template Locations

module "gke_cluster" {
  source         = "./modules/gke-cluster"
  cluster_create = var.cluster_creation

  cluster_name = format("%s-%s", var.project, var.cluster_name)

  project  = var.project
  location = var.region


  # In production, we highly recommend restricting access to only within the network boundary, requiring your users to use a bastion host or VPN.
  disable_public_endpoint = "false"

  # add resource labels to the cluster
  resource_labels = {
    environment = var.environment
  }

  # Cluster master node
  node_master_count = 1

  # container node pool
  node_count = 1

  # SA
  google_service_account_email = module.gke_service_account.email
}
}

Requirements

No requirements.

Providers

Name Version
google n/a

Modules

No modules.

Resources

Name Type
google_container_cluster.cluster resource
google_container_node_pool.primary_preemptible_nodes resource
google_container_engine_versions.location data source

Inputs

Name Description Type Default Required
cluster_create cluster creation string true no
cluster_name The name of the cluster string n/a yes
description The description of the cluster string "" no
disable_public_endpoint Control whether the master’s internal IP address is used as the cluster endpoint. If set to ‘true’, the master can only be accessed from internal IP addresses. bool false no
enable_private_nodes Control whether nodes have internal IP addresses only. If enabled, all nodes are given only RFC 1918 private addresses and communicate with the master via private networking. bool false no
enable_vertical_pod_autoscaling Whether to enable Vertical Pod Autoscaling string false no
google_service_account_email Service account string n/a yes
horizontal_pod_autoscaling Whether to enable the horizontal pod autoscaling addon bool true no
http_load_balancing Whether to enable the http (L7) load balancing addon bool true no
kubernetes_version The Kubernetes version of the masters. If set to ‘latest’ it will pull latest available version in the selected region. string "latest" no
location The location (region or zone) to host the cluster in string n/a yes
logging_service The logging service that the cluster should write logs to. Available options include logging.googleapis.com/kubernetes, logging.googleapis.com (legacy), and none string "logging.googleapis.com/kubernetes" no
monitoring_service The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Stackdriver Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting. Available options include monitoring.googleapis.com/kubernetes, monitoring.googleapis.com (legacy), and none string "monitoring.googleapis.com/kubernetes" no
node_count Number of secondary node number 1 no
node_master_count Number of master node number 1 no
project The project ID to host the cluster in string n/a yes
resource_labels The GCE resource labels (a map of key/value pairs) to be applied to the cluster. map(any) {} no

Outputs

| Name | Description | |——|————-| | client_certificate | Public certificate used by clients to authenticate to the cluster endpoint. | | client_key | Private key used by clients to authenticate to the cluster endpoint. | | cluster_ca_certificate | The public certificate that is the root of trust for the cluster. | | endpoint | The IP address of the cluster master. | | master_version | The Kubernetes master version. | | name | The name of the cluster master. This output is used for interpolation with node pools, other modules. |