Skip to content

Commit 5ac9026

Browse files
committed
fix(infra): Reference .env variables in Helm values and Terraform backend
1. Helm values.yaml - MinIO credentials - Updated comments to document using .env variables (MINIO_ROOT_USER, MINIO_ROOT_PASSWORD) - Added usage examples with --set flags and envsubst approach - Values should be set from .env via helm install --set flags 2. Terraform backend.tf - Added comprehensive documentation for using environment variables - Documented partial backend configuration approach - Added comments showing how to override with TF_BACKEND_* env vars - Added environment variables to env.example for Terraform backend config Both files now properly reference .env file variables and provide clear documentation on how to use them during deployment.
1 parent a9b1977 commit 5ac9026

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

deployment/helm/rag-modulo/values.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,23 @@ minio:
265265
memory: 1Gi
266266
# Credentials (stored in Secret)
267267
# ⚠️ SECURITY: Credentials MUST be explicitly set or use existingSecret
268-
# Option 1: Set rootUser and rootPassword explicitly
268+
# These values should be set from .env file (MINIO_ROOT_USER, MINIO_ROOT_PASSWORD)
269+
#
270+
# Usage with .env file:
271+
# source .env
272+
# helm install rag-modulo . \
273+
# --set minio.auth.rootUser=${MINIO_ROOT_USER} \
274+
# --set minio.auth.rootPassword=${MINIO_ROOT_PASSWORD}
275+
#
276+
# Or use envsubst (requires values.yaml to use ${MINIO_ROOT_USER} syntax):
277+
# envsubst < values.yaml > values-substituted.yaml
278+
# helm install rag-modulo . -f values-substituted.yaml
279+
#
269280
# Option 2: Use existingSecret (recommended for production)
270281
# Both cannot be empty - validation will fail if neither is provided
271282
auth:
272-
rootUser: "" # REQUIRED: Set to secure value or use existingSecret
273-
rootPassword: "" # REQUIRED: Set to secure value or use existingSecret
283+
rootUser: "" # REQUIRED: Set from .env MINIO_ROOT_USER via --set or use existingSecret
284+
rootPassword: "" # REQUIRED: Set from .env MINIO_ROOT_PASSWORD via --set or use existingSecret
274285
existingSecret: "" # If set, uses this secret instead of rootUser/rootPassword
275286

276287
# ============================================================================

deployment/terraform/backend.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
# Terraform Backend Configuration
22
# This file configures the remote state backend using IBM Cloud Object Storage
3+
#
4+
# NOTE: Terraform backend blocks cannot use variables directly.
5+
# For dynamic configuration, use partial backend configuration:
6+
# terraform init -backend-config="bucket=${TF_BACKEND_BUCKET}" \
7+
# -backend-config="region=${TF_BACKEND_REGION}" \
8+
# -backend-config="endpoint=${TF_BACKEND_ENDPOINT}"
9+
#
10+
# Environment variables (set in .env):
11+
# TF_BACKEND_ENDPOINT - S3 endpoint (default: s3.us-south.cloud-object-storage.appdomain.cloud)
12+
# TF_BACKEND_BUCKET - State bucket name (default: rag-modulo-terraform-state)
13+
# TF_BACKEND_REGION - Region (default: us-south)
14+
# TF_BACKEND_KEY - State file key (default: ibm/environments/terraform.tfstate)
15+
#
16+
# For local development, use the local backend (uncomment at bottom)
317

418
terraform {
519
backend "s3" {
620
# IBM Cloud Object Storage S3-compatible endpoint
21+
# Override via: -backend-config="endpoint=${TF_BACKEND_ENDPOINT}"
722
endpoint = "s3.us-south.cloud-object-storage.appdomain.cloud"
823

924
# Bucket configuration
25+
# Override via: -backend-config="bucket=${TF_BACKEND_BUCKET}"
1026
bucket = "rag-modulo-terraform-state"
27+
# Override via: -backend-config="key=${TF_BACKEND_KEY}"
1128
key = "ibm/environments/terraform.tfstate"
29+
# Override via: -backend-config="region=${TF_BACKEND_REGION}"
1230
region = "us-south"
1331

1432
# Enable versioning and encryption

env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ WATSONX_INSTANCE_ID=your-watsonx-instance-id
168168
# Milvus Configuration (Required for vector database)
169169
MILVUS_PORT=19530
170170

171+
# Terraform Backend Configuration (Optional - for remote state management)
172+
# These are used when initializing Terraform with partial backend config
173+
# TF_BACKEND_ENDPOINT=s3.us-south.cloud-object-storage.appdomain.cloud
174+
# TF_BACKEND_BUCKET=rag-modulo-terraform-state
175+
# TF_BACKEND_REGION=us-south
176+
# TF_BACKEND_KEY=ibm/environments/terraform.tfstate
171177

172178
# =============================================================================
173179
# DEVELOPMENT SETUP INSTRUCTIONS

0 commit comments

Comments
 (0)