-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
314 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
# terraform-google-ctrlplane | ||
# terraform-google-ctrlplane | ||
|
||
This module creates a reslient and fault tolerant Ctrlplane installation using | ||
Google Kubernetes Engine (GKE) as the computing environment and the following | ||
services for storing data: | ||
|
||
- CloudSQL for PostgreSQL | ||
- Memorystore for Redis | ||
- Cloud Storage | ||
|
||
## Compatibility | ||
|
||
This module is meant for use with Terraform 1.0+ and tested using Terraform | ||
1.6. | ||
|
||
## Usage | ||
|
||
There are examples included in the examples folder but simple usage is as | ||
follows: | ||
|
||
```hcl | ||
module "ctrlplane" { | ||
source = "sizzldev/ctrlplane/google" | ||
namespace = "ctrlplane" | ||
} | ||
``` | ||
|
||
Then perform the following commands on the root folder: | ||
|
||
1. `terraform init` to get the plugins | ||
2. `terraform plan` to see the infrastructure plan | ||
3. `terraform apply` to apply the infrastructure build | ||
4. `terraform destroy` to destroy the built infrastructure | ||
|
||
## Install | ||
|
||
**Terraform** | ||
|
||
Be sure you have the correct Terraform version, you can choose the binary here: | ||
|
||
- https://releases.hashicorp.com/terraform/ | ||
|
||
## File structure | ||
|
||
The project has the following folders and files: | ||
|
||
- `/`: root folder | ||
- `/examples`: examples for using this module | ||
- `/helpers`: Helper scripts | ||
- `/test`: Folders with files for testing the module (see Testing section on | ||
this file) | ||
- `/main.tf`: main file for this module, contains all the resources to create | ||
- `/variables.tf`: all the variables for the module | ||
- `/output.tf`: the outputs of the module | ||
- `/README.md`: this file |
20 changes: 20 additions & 0 deletions
20
example/.terraform.lock.hcl → examples/basic/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
resource "helm_release" "this" { | ||
name = "ctrlplane" | ||
chart = "ctrlplane" | ||
repository = "https://charts.ctrlplane.dev/" | ||
|
||
|
||
set { | ||
name = "global" | ||
value = yamlencode({ | ||
"postgres" = { | ||
"user" = var.postgres_user | ||
"password" = var.postgres_password | ||
"host" = var.postgres_host | ||
"port" = var.postgres_port | ||
"database" = var.postgres_database | ||
} | ||
|
||
"reds" = { | ||
"host" = var.redis_host | ||
"port" = var.redis_port | ||
"password" = var.redis_password | ||
} | ||
}) | ||
} | ||
|
||
set { | ||
name = "ingress" | ||
value = yamlencode({ | ||
"enabled" = true | ||
"annotations" = { | ||
"kubernetes.io/ingress.class" = "gce" | ||
"kubernetes.io/ingress.global-static-ip-name" = var.global_static_ip_name | ||
"ingress.gcp.kubernetes.io/pre-shared-cert" = var.pre_shared_cert | ||
"kubernetes.io/ingress.allow-http" = "false" | ||
} | ||
}) | ||
} | ||
|
||
set { | ||
name = "webservice" | ||
value = yamlencode({ | ||
"serviceAccount" = { | ||
"create" = true | ||
"annotations" = { | ||
"iam.gke.io/gcp-service-account" = var.service_account_email | ||
} | ||
} | ||
}) | ||
} | ||
|
||
set { | ||
name = "job-policy-checker" | ||
value = yamlencode({ | ||
"serviceAccount" = { | ||
"create" = true | ||
"annotations" = { | ||
"iam.gke.io/gcp-service-account" = var.service_account_email | ||
} | ||
} | ||
}) | ||
} | ||
|
||
set { | ||
name = "migrations" | ||
value = yamlencode({ | ||
"serviceAccount" = { | ||
"create" = true | ||
"annotations" = { | ||
"iam.gke.io/gcp-service-account" = var.service_account_email | ||
} | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
variable "redis_host" { | ||
type = string | ||
description = "The host for the Redis instance." | ||
} | ||
|
||
variable "redis_port" { | ||
type = number | ||
description = "The port for the Redis instance." | ||
} | ||
|
||
variable "redis_password" { | ||
type = string | ||
description = "The password for the Redis instance." | ||
} | ||
|
||
variable "postgres_user" { | ||
type = string | ||
description = "The user for the Postgres instance." | ||
} | ||
|
||
variable "postgres_password" { | ||
type = string | ||
description = "The password for the Postgres instance." | ||
} | ||
|
||
variable "postgres_host" { | ||
type = string | ||
description = "The host for the Postgres instance." | ||
} | ||
|
||
variable "postgres_port" { | ||
type = number | ||
description = "The port for the Postgres instance." | ||
} | ||
|
||
variable "postgres_database" { | ||
type = string | ||
description = "The database for the Postgres instance." | ||
} | ||
|
||
variable "service_account_email" { | ||
type = string | ||
description = "The service account email." | ||
} | ||
|
||
variable "global_static_ip_name" { | ||
type = string | ||
} | ||
|
||
variable "pre_shared_cert" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters