feat(helm): add environment variables for Reflex configuration
Some checks failed
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CD - Build & Deploy / release (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CD - Build & Deploy / release (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled
ci/woodpecker/push/woodpecker Pipeline failed
Changes: - Add API_URL, FRONTEND_PORT, BACKEND_PORT env vars to deployment - Construct DATABASE_URL from PostgreSQL connection params - Construct REDIS_URL from Redis connection params (with/without password) - Add reflex.apiUrl config to values files: * Default: http://localhost:8000 * Staging: https://staging.peikarband.ir * Production: https://peikarband.ir - Add ENVIRONMENT to configMap This ensures rxconfig.py gets proper environment-specific configuration without hardcoding values. The app now works correctly in all environments (dev, staging, production) with appropriate URLs and settings.
This commit is contained in:
@@ -49,6 +49,13 @@ spec:
|
|||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
env:
|
env:
|
||||||
{{- toYaml .Values.env | nindent 12 }}
|
{{- toYaml .Values.env | nindent 12 }}
|
||||||
|
# Reflex configuration
|
||||||
|
- name: API_URL
|
||||||
|
value: {{ .Values.reflex.apiUrl | quote }}
|
||||||
|
- name: FRONTEND_PORT
|
||||||
|
value: {{ .Values.service.frontend.targetPort | quote }}
|
||||||
|
- name: BACKEND_PORT
|
||||||
|
value: {{ .Values.service.backend.targetPort | quote }}
|
||||||
{{- if .Values.postgresql.enabled }}
|
{{- if .Values.postgresql.enabled }}
|
||||||
- name: DATABASE_HOST
|
- name: DATABASE_HOST
|
||||||
value: {{ .Values.postgresql.external.host }}
|
value: {{ .Values.postgresql.external.host }}
|
||||||
@@ -66,17 +73,29 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ .Values.postgresql.external.passwordSecret.name }}
|
name: {{ .Values.postgresql.external.passwordSecret.name }}
|
||||||
key: {{ .Values.postgresql.external.passwordSecret.key }}
|
key: {{ .Values.postgresql.external.passwordSecret.key }}
|
||||||
|
# Construct DATABASE_URL for Reflex
|
||||||
|
- name: DATABASE_URL
|
||||||
|
value: "postgresql://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATABASE_HOST):$(DATABASE_PORT)/$(DATABASE_NAME)"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.redis.enabled }}
|
{{- if .Values.redis.enabled }}
|
||||||
- name: REDIS_HOST
|
- name: REDIS_HOST
|
||||||
value: {{ .Values.redis.external.host }}
|
value: {{ .Values.redis.external.host }}
|
||||||
- name: REDIS_PORT
|
- name: REDIS_PORT
|
||||||
value: {{ .Values.redis.external.port | quote }}
|
value: {{ .Values.redis.external.port | quote }}
|
||||||
|
{{- if .Values.redis.external.passwordSecret }}
|
||||||
- name: REDIS_PASSWORD
|
- name: REDIS_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ .Values.redis.external.passwordSecret.name }}
|
name: {{ .Values.redis.external.passwordSecret.name }}
|
||||||
key: {{ .Values.redis.external.passwordSecret.key }}
|
key: {{ .Values.redis.external.passwordSecret.key }}
|
||||||
|
# Construct REDIS_URL with password
|
||||||
|
- name: REDIS_URL
|
||||||
|
value: "redis://:$(REDIS_PASSWORD)@$(REDIS_HOST):$(REDIS_PORT)/0"
|
||||||
|
{{- else }}
|
||||||
|
# Construct REDIS_URL without password
|
||||||
|
- name: REDIS_URL
|
||||||
|
value: "redis://$(REDIS_HOST):$(REDIS_PORT)/0"
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ replicaCount: 3
|
|||||||
image:
|
image:
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
|
# Reflex configuration for production
|
||||||
|
reflex:
|
||||||
|
apiUrl: "https://peikarband.ir" # Production API URL
|
||||||
|
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
prometheus.io/scrape: "true"
|
prometheus.io/scrape: "true"
|
||||||
prometheus.io/port: "8000"
|
prometheus.io/port: "8000"
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ replicaCount: 1
|
|||||||
image:
|
image:
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
|
# Reflex configuration for staging
|
||||||
|
reflex:
|
||||||
|
apiUrl: "https://staging.peikarband.ir" # Staging API URL
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 500m
|
cpu: 500m
|
||||||
|
|||||||
@@ -124,10 +124,15 @@ env:
|
|||||||
|
|
||||||
envFrom: []
|
envFrom: []
|
||||||
|
|
||||||
|
# Reflex-specific configuration
|
||||||
|
reflex:
|
||||||
|
apiUrl: "http://localhost:8000" # Override in production values
|
||||||
|
|
||||||
configMap:
|
configMap:
|
||||||
data:
|
data:
|
||||||
APP_NAME: "peikarband"
|
APP_NAME: "peikarband"
|
||||||
LOG_LEVEL: "info"
|
LOG_LEVEL: "info"
|
||||||
|
ENVIRONMENT: "production"
|
||||||
|
|
||||||
secretRef:
|
secretRef:
|
||||||
name: "peikarband-secrets"
|
name: "peikarband-secrets"
|
||||||
|
|||||||
Reference in New Issue
Block a user