Creates a GKE test cluster on Google Cloud Compute, outputs kubectl config for access
https://cloud.google.com/sdk/docs/install
Run gcloud init and create a new gcp project
Your new gcp project ID will be needed later.
gcloud init
gcloud auth application-default login
The GCP proejct will also need billing enabled and a valid credit card. Ideally the base install provided by this module will be in the free tier but based upon your usage this may not be the case. Depending on what you deploy to the test cluster. https://cloud.google.com/billing/docs/how-to/modify-project
In order to operate you must activate the following APIs on your GCP project:
gcloud projects list
gcloud config set project YOUR_GPC_PROJECT_ID
gcloud services list --available
gcloud services enable container.googleapis.com
gcloud services enable compute.googleapis.com
Replace YOUR_GCP_PROJECT_ID in google-provider.tf Replace YOUR_GCP_PROJECT_ID in variables.tf
terraform init
terraform plan
terraform apply
Name | Version |
---|---|
terraform | >= 0.13 |
~> 4.0 |
Name | Version |
---|---|
4.25.0 | |
kubernetes | 2.11.0 |
Name | Source | Version |
---|---|---|
gcp-network | terraform-google-modules/network/google | >= 4.0.1, < 5.0.0 |
gke | terraform-google-modules/kubernetes-engine/google | n/a |
gke_auth | terraform-google-modules/kubernetes-engine/google//modules/auth | n/a |
Name | Type |
---|---|
kubernetes_pod.nginx-example | resource |
kubernetes_service.nginx-example | resource |
google_client_config.default | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
project_id | The project ID to host the cluster in | string |
"YOUR_GCP_PROJECT_ID" |
no |
region | The region the cluster in | string |
"us-central1" |
no |
Name | Description |
---|---|
cluster_name | Cluster name |
kubeconfig_raw | n/a |
location | n/a |
network_name | The name of the VPC being created |
project_id | The project ID the cluster is in |
region | The region in which the cluster resides |
service_account | The service account to default running nodes as if not overridden in node_pools . |
subnet_names | The names of the subnet being created |
zones | List of zones in which the cluster resides |
- Improve docs for quick and easy setup for new GCP user
- Validate free tier costs and document
- Add a LoadBalancer service entry point for nginx-demo app to test with (public facing)