How to use
- Create *.tfvars file with a few variables
 
project          = "gcp-project"
region           = "europe-west1"
environment_name = "demo"
- Create cluster
 
terraform init
terraform apply
- Configure kubeconfig for new cluster
 
gcloud container clusters get-credentials $(terraform output -raw kubernetes_cluster_name) --region $(terraform output -raw region) --project $(terraform output -raw project)
- Destroy all resources
 
terraform destroy -target 'kubernetes_namespace.flux-system'
terraform destroy -target 'google_container_node_pool.primary_nodes'
terraform destroy -target 'google_container_cluster.primary'
terraform destroy -target 'google_compute_subnetwork.subnet'
terraform destroy -target 'google_compute_network.vpc'
terraform destroy -target 'data.google_client_config.primary'
Requirements
Providers
Modules
No modules.
Resources
Inputs
| Name | 
Description | 
Type | 
Default | 
Required | 
|  environment_name | 
n/a | 
string | 
"demo" | 
no | 
|  gke_num_nodes | 
number of gke nodes | 
number | 
1 | 
no | 
|  project | 
Google Project to create resources in | 
string | 
"demo" | 
no | 
|  region | 
The region to host the cluster in | 
string | 
"us-central1" | 
no | 
|  vpc_host_project | 
Host Project where virtual network exists | 
string | 
"demo" | 
no | 
Outputs