https://github.com/kameshsampath/rp-dev-gke
Terraform scripts to setup Redpanda dev cluster setup on GKE
https://github.com/kameshsampath/rp-dev-gke
development-environment gke-cluster redpanda terraform
Last synced: about 1 year ago
JSON representation
Terraform scripts to setup Redpanda dev cluster setup on GKE
- Host: GitHub
- URL: https://github.com/kameshsampath/rp-dev-gke
- Owner: kameshsampath
- License: apache-2.0
- Created: 2023-12-08T16:14:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-09T17:08:40.000Z (over 2 years ago)
- Last Synced: 2024-12-22T20:03:14.571Z (over 1 year ago)
- Topics: development-environment, gke-cluster, redpanda, terraform
- Language: HCL
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GKE Terraform Template
A GitHub template that could be used to get started with [Google Kubernetes Engine(GKE)](https://cloud.google.com/kubernetes-engine) using [terraform](https://terraform.build).
## Pre-requisites
- [Google Cloud Account](https://cloud.google.com)
- With a Service Account with roles
- `Kubernetes Engine Admin` - to create GKE cluster
- `Service Account User` - to use other needed service accounts
- `Compute Network Admin` - to create the VPC networks
- [Google Cloud SDK](https://cloud.google.com/sdk)
- [terraform](https://terraform.build)
- [helm](https://helm.sh)(Optional)
- [kustomize](https://kustomize.io)(Optional)
- [direnv](https://direnv.net)(Optional)
## Using this Template
On browser navigate to the repo and click **Use Template**, follow the wizard to create your repository based on the template.
Using [github cli](https://cli.github.com/)
```shell
gh repo create --public --description="My GKE Demos and Examples" --template https://github.com/kameshsampath/gke-tf my-gke-demos
gh repo clone my-gke-demos
```
## Environment Variables
When working with Google Cloud the following environment variables helps in setting the right Google Cloud context like Service Account Key file, project etc., You can use [direnv](https://direnv.net) or set the following variables on your shell,
```shell
export GOOGLE_APPLICATION_CREDENTIALS="the google cloud service account key json file to use"
export CLOUDSDK_ACTIVE_CONFIG_NAME="the google cloud cli profile to use"
```
You can find more information about gcloud cli configurations at .
As you may need to override few terraform variables that you don't want to check in to VCS, add them to a file called `.local.tfvars` and set the following environment variable to be picked up by terraform runs,
```shell
export TFVARS_FILE=.local.tfvars
```
>**NOTE**: All `.local.tfvars` file are git ignored by this template.
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [cluster\_name](#input\_cluster\_name) | the gke cluster name | `string` | `"my-demos"` | no |
| [gke\_num\_nodes](#input\_gke\_num\_nodes) | number of gke nodes | `number` | `2` | no |
| [kubernetes\_version](#input\_kubernetes\_version) | the kubernetes versions of the GKE clusters | `string` | `"1.24."` | no |
| [machine\_type](#input\_machine\_type) | the google cloud machine types for each cluster node | `string` | `"e2-standard-4"` | no |
| [project\_id](#input\_project\_id) | project id | `any` | n/a | yes |
| [region](#input\_region) | the region or zone where the cluster will be created | `string` | `"asia-south1"` | no |
| [release\_channel](#input\_release\_channel) | the GKE release channel to use | `string` | `"stable"` | no |
## Outputs
| Name | Description |
|------|-------------|
| [kubeconfig\_path](#output\_kubeconfig\_path) | Kubeconfig file |
| [kubernetes\_cluster\_host](#output\_kubernetes\_cluster\_host) | GKE Cluster Host |
| [kubernetes\_cluster\_name](#output\_kubernetes\_cluster\_name) | GKE Cluster Name |
| [project\_id](#output\_project\_id) | GCloud Project ID |
| [region](#output\_region) | GCloud Region |
| [zone](#output\_zone) | GCloud Zone |
## Providers
| Name | Version |
|------|---------|
| [google](#provider\_google) | 4.47.0 |
| [local](#provider\_local) | 2.2.3 |
| [random](#provider\_random) | 3.4.3 |
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.14 |
| [google](#requirement\_google) | >= 4.47.0 |
| [helm](#requirement\_helm) | 2.8.0 |
| [kubernetes](#requirement\_kubernetes) | 2.16.1 |
| [local](#requirement\_local) | 2.2.3 |
| [random](#requirement\_random) | 3.4.3 |
## Resources
| Name | Type |
|------|------|
| [google_compute_network.vpc](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_network) | resource |
| [google_compute_subnetwork.subnet](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_subnetwork) | resource |
| [google_container_cluster.primary](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster) | resource |
| [google_container_node_pool.primary_nodes](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool) | resource |
| [local_file.kubeconfig](https://registry.terraform.io/providers/hashicorp/local/2.2.3/docs/resources/file) | resource |
| [random_shuffle.az](https://registry.terraform.io/providers/hashicorp/random/3.4.3/docs/resources/shuffle) | resource |
| [google_compute_zones.available](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_zones) | data source |
| [google_container_engine_versions.supported](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/container_engine_versions) | data source |
## References
-
-
## License
[Apache License](./../LICENSE)