From 045a7b841aecdd04131a4a04438720b6e7df284a Mon Sep 17 00:00:00 2001 From: Masaki Yatsu Date: Thu, 18 Sep 2025 10:28:46 +0900 Subject: [PATCH] feat(postgres): customize storage size --- postgres/.gitignore | 1 + postgres/justfile | 2 ++ ...ster-values.yaml => postgres-cluster-values.gomplate.yaml} | 4 ++++ 3 files changed, 7 insertions(+) rename postgres/{postgres-cluster-values.yaml => postgres-cluster-values.gomplate.yaml} (69%) diff --git a/postgres/.gitignore b/postgres/.gitignore index cec533e..00c1166 100644 --- a/postgres/.gitignore +++ b/postgres/.gitignore @@ -1,2 +1,3 @@ +postgres-cluster-values.yaml create-database.yaml delete-database.yaml diff --git a/postgres/justfile b/postgres/justfile index 139b1b9..53fe921 100644 --- a/postgres/justfile +++ b/postgres/justfile @@ -3,6 +3,7 @@ set fallback := true export CNPG_NAMESPACE := env("CNPG_NAMESPACE", "postgres") export CNPG_CHART_VERSION := env("CNPG_CHART_VERSION", "0.26.0") export CNPG_CLUSTER_CHART_VERSION := env("CNPG_CLUSTER_CHART_VERSION", "0.3.1") +export POSTGRES_STORAGE_SIZE := env("POSTGRES_STORAGE_SIZE", "20Gi") export K8S_VAULT_NAMESPACE := env("K8S_VAULT_NAMESPACE", "vault") export EXTERNAL_SECRETS_NAMESPACE := env("EXTERNAL_SECRETS_NAMESPACE", "external-secrets") @@ -69,6 +70,7 @@ create-cluster: fi fi + gomplate -f postgres-cluster-values.gomplate.yaml -o postgres-cluster-values.yaml helm upgrade --install postgres-cluster cnpg/cluster \ --version ${CNPG_CLUSTER_CHART_VERSION} \ -n ${CNPG_NAMESPACE} --wait -f postgres-cluster-values.yaml diff --git a/postgres/postgres-cluster-values.yaml b/postgres/postgres-cluster-values.gomplate.yaml similarity index 69% rename from postgres/postgres-cluster-values.yaml rename to postgres/postgres-cluster-values.gomplate.yaml index 45660e7..1d0eb40 100644 --- a/postgres/postgres-cluster-values.yaml +++ b/postgres/postgres-cluster-values.gomplate.yaml @@ -1,6 +1,10 @@ cluster: instances: 1 + # Storage configuration + storage: + size: {{ .Env.POSTGRES_STORAGE_SIZE }} + initdb: postInitTemplateSQL: - CREATE EXTENSION IF NOT EXISTS vector;