twenty/packages/twenty-docker/k8s/terraform
Félix Malfait 736635a94b
Begin moving to postgres spilo + adding pgvector (#8309)
We will remove the `twenty-postgres` image that was used for local
development and only use `twenty-postgres-pilo` (which we use in prod),
bringing the development environment closer to prod and avoiding having
to maintain 2 images.


Instead of provisioning the super user after the db initialization, we
directly rely on the superuser provided by Spilo for simplicity. We also
introduce a change that tries to create the right database (`default` or
`test`) based on the context.
  

How to test:
```
docker build -t twentycrm/twenty-postgres-spilo:latest -f ./packages/twenty-docker/twenty-postgres-spilo/Dockerfile .
docker images --no-trunc | grep twenty-postgres-spilo
postgres-on-docker:
	docker run \
	--name twenty_pg \
	-e PGUSER_SUPERUSER=twenty \
	-e PGPASSWORD_SUPERUSER=twenty \
	-e ALLOW_NOSSL=true \
	-v twenty_db_data:/home/postgres/pgdata \
	-p 5432:5432 \
	REPLACE_WITH_IMAGE_ID
```
2024-11-15 09:38:30 +01:00
..
.terraform-docs.yml Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
deployment-db.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
deployment-redis.tf Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
deployment-server.tf feat: generate secret function and replaced few instances (#7810) 2024-10-30 12:07:11 +01:00
deployment-worker.tf feat: generate secret function and replaced few instances (#7810) 2024-10-30 12:07:11 +01:00
ingress.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
main.tf Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
namespace.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
pv-db.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
pv-docker-data.tf Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
pv-server.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
pvc-db.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
pvc-docker-data.tf Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
pvc-server.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
README.md Begin moving to postgres spilo + adding pgvector (#8309) 2024-11-15 09:38:30 +01:00
secret.tf Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
service-db.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
service-redis.tf Updating terraform and k8s files adding redis... (#7425) 2024-10-07 10:23:42 +02:00
service-server.tf Lumosviridi v20 kubernetes updates (#6356) 2024-08-08 13:55:45 +02:00
variables.tf Begin moving to postgres spilo + adding pgvector (#8309) 2024-11-15 09:38:30 +01:00

TwentyCRM Terraform Docs

This file was generated by terraform-docs, for more information on how to install, configure, and use visit their website.

To update this README.md after changes to the Terraform code in this folder, run: terraform-docs -c ./.terraform-docs.yml .`

To make configuration changes to how this doc is generated, see ./.terraform-docs.yml

Requirements

Name Version
terraform >= 1.9.2
kubernetes >= 2.32.0
random >= 3.6.3

Providers

Name Version
kubernetes >= 2.32.0
random >= 3.6.3

Resources

Name Type
kubernetes_deployment.twentycrm_db resource
kubernetes_deployment.twentycrm_redis resource
kubernetes_deployment.twentycrm_server resource
kubernetes_deployment.twentycrm_worker resource
kubernetes_ingress.twentycrm resource
kubernetes_namespace.twentycrm resource
kubernetes_persistent_volume.db resource
kubernetes_persistent_volume.docker_data resource
kubernetes_persistent_volume.server resource
kubernetes_persistent_volume_claim.db resource
kubernetes_persistent_volume_claim.docker_data resource
kubernetes_persistent_volume_claim.server resource
kubernetes_secret.twentycrm_tokens resource
kubernetes_service.twentycrm_db resource
kubernetes_service.twentycrm_redis resource
kubernetes_service.twentycrm_server resource
random_bytes.this resource

Inputs

Name Description Type Default Required
twentycrm_app_hostname The protocol, DNS fully qualified hostname, and port used to access TwentyCRM in your environment. Ex: https://crm.example.com:443 string n/a yes
twentycrm_pgdb_admin_password TwentyCRM password for postgres database. string n/a yes
twentycrm_app_name A friendly name prefix to use for every component deployed. string "twentycrm" no
twentycrm_db_image TwentyCRM image for database deployment. This defaults to latest. string "twentycrm/twenty-postgres-spilo:latest" no
twentycrm_db_pv_capacity Storage capacity provisioned for database persistent volume. string "10Gi" no
twentycrm_db_pv_path Local path to use to store the physical volume if using local storage on nodes. string "" no
twentycrm_db_pvc_requests Storage capacity reservation for database persistent volume claim. string "10Gi" no
twentycrm_db_replicas Number of replicas for the TwentyCRM database deployment. This defaults to 1. number 1 no
twentycrm_docker_data_mount_path TwentyCRM mount path for servers application data. Defaults to '/app/docker-data'. string "/app/docker-data" no
twentycrm_docker_data_pv_capacity Storage capacity provisioned for server persistent volume. string "10Gi" no
twentycrm_docker_data_pv_path Local path to use to store the physical volume if using local storage on nodes. string "" no
twentycrm_docker_data_pvc_requests Storage capacity reservation for server persistent volume claim. string "10Gi" no
twentycrm_namespace Namespace for all TwentyCRM resources string "twentycrm" no
twentycrm_redis_image TwentyCRM image for Redis deployment. This defaults to latest. string "redis/redis-stack-server:latest" no
twentycrm_redis_replicas Number of replicas for the TwentyCRM Redis deployment. This defaults to 1. number 1 no
twentycrm_server_data_mount_path TwentyCRM mount path for servers application data. Defaults to '/app/packages/twenty-server/.local-storage'. string "/app/packages/twenty-server/.local-storage" no
twentycrm_server_image TwentyCRM server image for the server deployment. This defaults to latest. This value is also used for the workers image. string "twentycrm/twenty:latest" no
twentycrm_server_pv_capacity Storage capacity provisioned for server persistent volume. string "10Gi" no
twentycrm_server_pv_path Local path to use to store the physical volume if using local storage on nodes. string "" no
twentycrm_server_pvc_requests Storage capacity reservation for server persistent volume claim. string "10Gi" no
twentycrm_server_replicas Number of replicas for the TwentyCRM server deployment. This defaults to 1. number 1 no
twentycrm_worker_replicas Number of replicas for the TwentyCRM worker deployment. This defaults to 1. number 1 no