This example illustrates how to deploy a service to the created cluster using the kubernetes provider.
It will:
- Create a cluster
- Configure authentication for the Kubernetes provider
- Create an Nginx Pod
- Create an Nginx Service
Name | Description | Type | Default | Required |
---|---|---|---|---|
cluster_name_suffix | A suffix to append to the default cluster name | string |
"" |
no |
compute_engine_service_account | Service account to associate to the nodes in the cluster | any |
n/a | yes |
ip_range_pods | The secondary ip range to use for pods | any |
n/a | yes |
ip_range_services | The secondary ip range to use for services | any |
n/a | yes |
network | The VPC network to host the cluster in | any |
n/a | yes |
project_id | The project ID to host the cluster in | any |
n/a | yes |
region | The region to host the cluster in | any |
n/a | yes |
subnetwork | The subnetwork to host the cluster in | any |
n/a | yes |
Name | Description |
---|---|
ca_certificate | n/a |
client_token | n/a |
cluster_name | Cluster name |
ip_range_pods | The secondary IP range used for pods |
ip_range_services | The secondary IP range used for services |
kubernetes_endpoint | n/a |
location | n/a |
master_kubernetes_version | The master Kubernetes version |
network | n/a |
project_id | n/a |
region | n/a |
service_account | The default service account used for running nodes. |
subnetwork | n/a |
zones | List of zones in which the cluster resides |
To provision this example, run the following from within this directory:
terraform init
to get the pluginsterraform plan
to see the infrastructure planterraform apply
to apply the infrastructure buildterraform destroy
to destroy the built infrastructure