{"id":20768143,"url":"https://github.com/softwaremill/terraform-gke-bootstrap","last_synced_at":"2025-10-28T00:13:11.448Z","repository":{"id":37780919,"uuid":"489314509","full_name":"softwaremill/terraform-gke-bootstrap","owner":"softwaremill","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-15T19:43:59.000Z","size":258,"stargazers_count":3,"open_issues_count":7,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-15T21:23:43.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softwaremill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-06T10:37:43.000Z","updated_at":"2025-01-15T19:44:00.000Z","dependencies_parsed_at":"2024-02-28T09:45:50.465Z","dependency_job_id":"4881db8c-1d3c-4e5c-8b3e-be55bb8b89c4","html_url":"https://github.com/softwaremill/terraform-gke-bootstrap","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fterraform-gke-bootstrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fterraform-gke-bootstrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fterraform-gke-bootstrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Fterraform-gke-bootstrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwaremill","download_url":"https://codeload.github.com/softwaremill/terraform-gke-bootstrap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243098009,"owners_count":20235941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T11:35:53.842Z","updated_at":"2025-10-28T00:13:11.441Z","avatar_url":"https://github.com/softwaremill.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform GKE module\nThis module creates the GKE cluster with all dependencies: project, network (VPC), subnet etc.\nIt can also use existing project - in such case set the `create_project` to `false` and provide the existing `project_id`.\n\n# Prerequisite\n\n- Before you create GCP project make sure you have right permission to attach billing accounts to created project. \nThat means have at least one of IAM roles attached:\n  - roles/billing.creator\n  - roles/billing.admin\n  - roles/billing.user\n  - roles/billing.projectManager\n\n## Usage\n\nThe simplest way to use this module:\n\n```terraform\nmodule \"gke\" {\n  source = \"../../\"\n  create_project = false\n  k8s_network_base = \"10.100.0.0/16\"\n  project_id = \"gke-test-project\"\n  region = \"europe-central2\"\n  subnet_network = \"10.1.0.0/20\"\n  regional = false\n  zones = [\"europe-central2-a\"]\n  node_pools = {\n    default-pool = {\n      disk_size_gb = 50\n      max_count = 3\n      preemptible = true\n    }\n  }\n}\n```\n\nBy default, it creates a \"private\" GKE cluster, but this can be changed setting `enable_private_nodes` to `false`.\nThis module is based on opinionated google modules, but combines several modules into \"one module to rule them all\".\nIt uses the `private-cluster-update-variant` submodule of GKE - the version which can creates private cluster and - in case of node pool changes - creates new pool before deleting the old one, which minimizes the downtime of the live system.\n\n## Node pools variable\nThe `node_pools` is a map of objects, where the node pool name is a key. Possible values:\n\n| Name | Description                                                                                                                                                                                                                                                                                                                                                                 | Default |\n|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| image_type | The image type used to create the nodes. The possible values are COS_CONTAINERD, COS, UBUNTU_CONTAINERD, UBUNTU. NOTE : COS AND UBUNTU are deprecated as of GKE 1.24                                                                                                                                                                                                        | COS_CONTAINERD |\n| machine_type | The name of a Google Compute Engine machine type.                                                                                                                                                                                                                                                                                                                           | e2-medium |\n| min_cpu_platform | Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell. See the [official documentation](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) for more information.                                  | \"\" |\n| local_ssd_count | Number of local SSDs to use to back ephemeral storage. Uses NVMe interfaces. Each local SSD is 375 GB in size. If zero, it means to disable using local SSDs as ephemeral storage.                                                                                                                                                                                          | 0 |\n| disk_size_gb | Size of the disk attached to each node, specified in GB.                                                                                                                                                                                                                                                                                                                    | 100 |\n| disk_type | Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced').                                                                                                                                                                                                                                                                                                                                                                            | pd-standard |\n| preemptible | A boolean that represents whether or not the underlying node VMs are preemptible                                                                                                                                                                                                                                                                                            | false |\n| spot | A boolean that represents whether the underlying node VMs are spot.                                                                                                                                                                                                                                                                                                         | false |\n| labels | The Kubernetes labels (key/value pairs) to be applied to each node. The kubernetes.io/ and k8s.io/ prefixes are reserved by Kubernetes Core components and cannot be specified.                                                                                                                                                                                             | {} |\n| oauth_scopes | The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. Use the \"https://www.googleapis.com/auth/cloud-platform\" scope to grant access to all APIs. It is recommended that you set service_account to a non-default service account and grant IAM roles to that service account for only the resources that it needs. | var.default_node_pools_oauth_scopes |\n| service_account | The service account to be used by the Node VMs. If not specified, the \"default\" service account is used.                                                                                                                                                                                                                                                                                                                                                                            | null |\n| taint | A list of Kubernetes taints to apply to nodes. Each taint consist of `key`, `value` and the effect, which must be one of NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE.                                                                                                                                                                                                   | [] | \n\n\n\n\n## Autopilot support\nThis module supports the autopilot GKE cluster. To create the autopilot cluster:\n- set the `enable_autopilot` to `true`\n- set the `node_pools` variable to empty list `[]`\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\nNo requirements.\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_google\"\u003e\u003c/a\u003e [google](#provider\\_google) | 5.45.2 |\n| \u003ca name=\"provider_google-beta\"\u003e\u003c/a\u003e [google-beta](#provider\\_google-beta) | 5.45.2 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_cloud_nat\"\u003e\u003c/a\u003e [cloud\\_nat](#module\\_cloud\\_nat) | registry.terraform.io/terraform-google-modules/cloud-nat/google | 5.1.0 |\n| \u003ca name=\"module_network\"\u003e\u003c/a\u003e [network](#module\\_network) | registry.terraform.io/terraform-google-modules/network/google | 9.1.0 |\n| \u003ca name=\"module_project\"\u003e\u003c/a\u003e [project](#module\\_project) | registry.terraform.io/terraform-google-modules/project-factory/google | 15.0.1 |\n| \u003ca name=\"module_project_services\"\u003e\u003c/a\u003e [project\\_services](#module\\_project\\_services) | terraform-google-modules/project-factory/google//modules/project_services | 15.0.1 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [google-beta_google_container_node_pool.pools](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/google_container_node_pool) | resource |\n| [google_artifact_registry_repository.my-repo](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/artifact_registry_repository) | resource |\n| [google_compute_address.cloud_nat_address](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_address) | resource |\n| [google_container_cluster.gke](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_activate_apis\"\u003e\u003c/a\u003e [activate\\_apis](#input\\_activate\\_apis) | List of Google APIs activated in new or existing project. | `list(string)` | \u003cpre\u003e[\u003cbr/\u003e  \"compute.googleapis.com\",\u003cbr/\u003e  \"container.googleapis.com\"\u003cbr/\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_artifact_registry_name\"\u003e\u003c/a\u003e [artifact\\_registry\\_name](#input\\_artifact\\_registry\\_name) | The name of the artifact registry repository | `string` | `\"my-repository\"` | no |\n| \u003ca name=\"input_billing_account\"\u003e\u003c/a\u003e [billing\\_account](#input\\_billing\\_account) | YOU NEED TO HAVE PERMISSION TO BILLING ACCOUNT, The billing account to witch the new project should be connected. Required if `create_project` set to `true`. | `string` | `\"\"` | no |\n| \u003ca name=\"input_cluster_deletion_protection\"\u003e\u003c/a\u003e [cluster\\_deletion\\_protection](#input\\_cluster\\_deletion\\_protection) | Whether or not to allow Terraform to destroy the cluster. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the cluster will fail. | `bool` | `true` | no |\n| \u003ca name=\"input_create_artifact_registry\"\u003e\u003c/a\u003e [create\\_artifact\\_registry](#input\\_create\\_artifact\\_registry) | Whether to create Artifact Registry for docker images | `bool` | `false` | no |\n| \u003ca name=\"input_create_project\"\u003e\u003c/a\u003e [create\\_project](#input\\_create\\_project) | Defines if create the project. All resources are created this project. If `false` - the project\\_id is required. | `bool` | `false` | no |\n| \u003ca name=\"input_default_node_pools_oauth_scopes\"\u003e\u003c/a\u003e [default\\_node\\_pools\\_oauth\\_scopes](#input\\_default\\_node\\_pools\\_oauth\\_scopes) | Default node pool oauth scopes added to all node pools | `list(string)` | \u003cpre\u003e[\u003cbr/\u003e  \"https://www.googleapis.com/auth/cloud-platform\"\u003cbr/\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_default_pool_machine_type\"\u003e\u003c/a\u003e [default\\_pool\\_machine\\_type](#input\\_default\\_pool\\_machine\\_type) | In some cases the GKE won't be created unless the default pool uses specific machine type (for example confidential nodes) so we have to set the type even if the default pool is removed. | `string` | `\"e2-small\"` | no |\n| \u003ca name=\"input_disable_services_on_destroy\"\u003e\u003c/a\u003e [disable\\_services\\_on\\_destroy](#input\\_disable\\_services\\_on\\_destroy) | Whether project services will be disabled when the resources are destroyed. | `bool` | `true` | no |\n| \u003ca name=\"input_enable_autopilot\"\u003e\u003c/a\u003e [enable\\_autopilot](#input\\_enable\\_autopilot) | Whether to enable Autopilot feature | `bool` | `null` | no |\n| \u003ca name=\"input_enable_confidential_nodes\"\u003e\u003c/a\u003e [enable\\_confidential\\_nodes](#input\\_enable\\_confidential\\_nodes) | Whether to enable confidential nodes. | `bool` | `false` | no |\n| \u003ca name=\"input_enable_private_endpoint\"\u003e\u003c/a\u003e [enable\\_private\\_endpoint](#input\\_enable\\_private\\_endpoint) | Defines if create private endpoint. It disables the public endpoint so the cluster is accessible only from VPC. | `bool` | `false` | no |\n| \u003ca name=\"input_enable_private_nodes\"\u003e\u003c/a\u003e [enable\\_private\\_nodes](#input\\_enable\\_private\\_nodes) | Defines if use private nodes. Implies creation of cloud NAT service so nodes and pods can access public internet. | `bool` | `true` | no |\n| \u003ca name=\"input_gcr_location\"\u003e\u003c/a\u003e [gcr\\_location](#input\\_gcr\\_location) | Location of the GCR bucket. | `string` | `\"EU\"` | no |\n| \u003ca name=\"input_k8s_network_base\"\u003e\u003c/a\u003e [k8s\\_network\\_base](#input\\_k8s\\_network\\_base) | The IP CIDR base for pods and services secondary networks. Must not overlap with `subnet_network`. Must be a `/16` network. | `string` | n/a | yes |\n| \u003ca name=\"input_master_authorized_networks\"\u003e\u003c/a\u003e [master\\_authorized\\_networks](#input\\_master\\_authorized\\_networks) | Allows accessing masters only from defined networks. If `enable_private_endpoint` is `true` it must not be any public CIDR block. | `list(map(string))` | \u003cpre\u003e[\u003cbr/\u003e  {\u003cbr/\u003e    \"cidr_block\": \"0.0.0.0/0\",\u003cbr/\u003e    \"display_name\": \"ALL\"\u003cbr/\u003e  }\u003cbr/\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_master_ipv4_cidr_block\"\u003e\u003c/a\u003e [master\\_ipv4\\_cidr\\_block](#input\\_master\\_ipv4\\_cidr\\_block) | The /28 CIDR block for masters when using private cluster. | `string` | `\"172.16.0.0/28\"` | no |\n| \u003ca name=\"input_node_pools\"\u003e\u003c/a\u003e [node\\_pools](#input\\_node\\_pools) | The object which describes the node pools. The structure is described in the README file. | `any` | `{}` | no |\n| \u003ca name=\"input_org_id\"\u003e\u003c/a\u003e [org\\_id](#input\\_org\\_id) | GCP organization id. Required if `create_project` is `true`. | `string` | `\"\"` | no |\n| \u003ca name=\"input_platform_name\"\u003e\u003c/a\u003e [platform\\_name](#input\\_platform\\_name) | The name of the platform. Many resource names are based on this (VPC, subnet, GKE cluster etc). | `string` | n/a | yes |\n| \u003ca name=\"input_project_id\"\u003e\u003c/a\u003e [project\\_id](#input\\_project\\_id) | Existing project id. Required if `create_project` set to `false` | `string` | `null` | no |\n| \u003ca name=\"input_project_name\"\u003e\u003c/a\u003e [project\\_name](#input\\_project\\_name) | The name of the created project. Defaults to `platform_name` if not set. | `string` | `null` | no |\n| \u003ca name=\"input_region\"\u003e\u003c/a\u003e [region](#input\\_region) | Region where to create resources. | `string` | n/a | yes |\n| \u003ca name=\"input_regional\"\u003e\u003c/a\u003e [regional](#input\\_regional) | Defines the type of the GKE cluster. If `true` - the cluster is created as `regional`. Otherwise - as `zonal`. | `bool` | `true` | no |\n| \u003ca name=\"input_release_channel\"\u003e\u003c/a\u003e [release\\_channel](#input\\_release\\_channel) | The GKE release channel. | `string` | `\"UNSPECIFIED\"` | no |\n| \u003ca name=\"input_subnet_network\"\u003e\u003c/a\u003e [subnet\\_network](#input\\_subnet\\_network) | The IP CIDR of the network for the GKE nodes. Must not overlap with `k8s_network_base`. | `string` | n/a | yes |\n| \u003ca name=\"input_subnet_private_access\"\u003e\u003c/a\u003e [subnet\\_private\\_access](#input\\_subnet\\_private\\_access) | Whether to enable google private IP access for the subnet | `bool` | `true` | no |\n| \u003ca name=\"input_zones\"\u003e\u003c/a\u003e [zones](#input\\_zones) | List of zones for `zonal` cluster. Required if `regional` set to `false`. | `list(string)` | `[]` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_gke_ca_certificate\"\u003e\u003c/a\u003e [gke\\_ca\\_certificate](#output\\_gke\\_ca\\_certificate) | The kubernetes CA certificate |\n| \u003ca name=\"output_gke_cluster_id\"\u003e\u003c/a\u003e [gke\\_cluster\\_id](#output\\_gke\\_cluster\\_id) | Cluster name |\n| \u003ca name=\"output_gke_cluster_name\"\u003e\u003c/a\u003e [gke\\_cluster\\_name](#output\\_gke\\_cluster\\_name) | Cluster name |\n| \u003ca name=\"output_gke_endpoint\"\u003e\u003c/a\u003e [gke\\_endpoint](#output\\_gke\\_endpoint) | The kubernetes endpoint |\n| \u003ca name=\"output_gke_location\"\u003e\u003c/a\u003e [gke\\_location](#output\\_gke\\_location) | Location of the GKE cluster. Region if cluster is regional, zone if zonal |\n| \u003ca name=\"output_gke_zones\"\u003e\u003c/a\u003e [gke\\_zones](#output\\_gke\\_zones) | List of zones where the cluster lives |\n| \u003ca name=\"output_nat_ip\"\u003e\u003c/a\u003e [nat\\_ip](#output\\_nat\\_ip) | The IP address allocated for NAT |\n| \u003ca name=\"output_project_id\"\u003e\u003c/a\u003e [project\\_id](#output\\_project\\_id) | ID of the project containing the cluster |\n| \u003ca name=\"output_subnetwork_name\"\u003e\u003c/a\u003e [subnetwork\\_name](#output\\_subnetwork\\_name) | Name of the subnetwork |\n| \u003ca name=\"output_vpc_id\"\u003e\u003c/a\u003e [vpc\\_id](#output\\_vpc\\_id) | VPC (network) ID |\n| \u003ca name=\"output_vpc_name\"\u003e\u003c/a\u003e [vpc\\_name](#output\\_vpc\\_name) | Name of the created VPC (network) |\n| \u003ca name=\"output_vpc_self_link\"\u003e\u003c/a\u003e [vpc\\_self\\_link](#output\\_vpc\\_self\\_link) | VPC (network) self link |\n\u003c!-- END_TF_DOCS --\u003e\n\n## node_pools variable\nThe node_pools variable takes the following parameters:\n\n| Name                                                                            | Description                                                                                                                                                                                                                                | Default          | Requirement |\n|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------| --- |\n| \u003ca name=\"autoscaling\"\u003e\u003c/a\u003e [autoscaling](#autoscaling)                          | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage                                                                                                                              | `true`           | Optional |\n| \u003ca name=\"node_locations\"\u003e\u003c/a\u003e [node\\_locations](#node\\_locations)               | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | `\"\"`             | Optional |\n| \u003ca name=\"node_count\"\u003e\u003c/a\u003e [node\\_count](#node\\_count)                           | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters                                                                                                            | `1`              | Required |\n| \u003ca name=\"min_count\"\u003e\u003c/a\u003e [min\\_count](#min\\_count)                              | Minimum number of nodes in the NodePool. Must be \u003e=0 and \u003c= max_count. Should be used when autoscaling is true                                                                                                                             | `1`              | Optional |\n| \u003ca name=\"max_count\"\u003e\u003c/a\u003e [max\\_count](#max\\_count)                              | Maximum number of nodes in the NodePool. Must be \u003e= min_count                                                                                                                                                                              | `100`            | Optional |\n| \u003ca name=\"image_type\"\u003e\u003c/a\u003e [image\\_type](#image\\_type)                           | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool                                                                                                                 | `COS_CONTAINERD` | Optional |\n| \u003ca name=\"machine_type\"\u003e\u003c/a\u003e [machine\\_type](#machine\\_type)                     | The name of a Google Compute Engine machine type                                                                                                                                                                                           | `e2-medium`      | Optional |\n| \u003ca name=\"min_cpu_platform\"\u003e\u003c/a\u003e [min\\_cpu\\_platform](#min\\_cpu\\_platform)       | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform.                                                                                                               | `\"\"`             | Optional |\n| \u003ca name=\"local_ssd_count\"\u003e\u003c/a\u003e [local\\_ssd\\_count](#local\\_ssd\\_count)          | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume.                                                                                             | `0`              | Optional |\n| \u003ca name=\"disk_size_gb\"\u003e\u003c/a\u003e [disk\\_size\\_gb](#disk\\_size\\_gb)                   | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB                                                                                                                                            | `100`            | Optional |\n| \u003ca name=\"preemptible\"\u003e\u003c/a\u003e [preemptible](#preemptible)                          | A boolean that represents whether or not the underlying node VMs are preemptible. See the [official documentation](https://cloud.google.com/container-engine/docs/preemptible-vm)\u003c/a\u003e for more information.)                               | `false`          | Optional |\n| \u003ca name=\"spot\"\u003e\u003c/a\u003e [spot](#spot)                                               | A boolean that represents whether the underlying node VMs are spot. See the [official documentation](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms) for more information.                                              | `false`          | Optional |\n| \u003ca name=\"compact_placement_policy\"\u003e\u003c/a\u003e [compact\\_placement\\_policy](#compact\\_placement\\_policy) | Compact placement policy enabled places node pool's nodes in a closer physical proximity in order to reduce network latency between nodes.                                                                                                 | `false`          | Optional |\n| \u003ca name=\"taints\"\u003e\u003c/a\u003e [taints](#taints)                                         | List of objects, each object needs a `key`, `value`, and `effect` fields.                                                                                                  | `[]`             | Optional |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaremill%2Fterraform-gke-bootstrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwaremill%2Fterraform-gke-bootstrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaremill%2Fterraform-gke-bootstrap/lists"}