Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Move environment variable dependencies for backend and langflow from process env to .env file loaded by dotenv lib in both cases

rodageve993778cbece3
diff --git a/kubernetes/helm/openrag/templates/backend/backend-dotenv.yaml b/kubernetes/helm/openrag/templates/backend/backend-dotenv.yaml
new file mode 100644
index 000000000..b8c789b8b
--- /dev/null
+++ b/kubernetes/helm/openrag/templates/backend/backend-dotenv.yaml
@@ -0,0 +1,199 @@
+{{- /*
+Creates a Secret with a single key ".env" that can be mounted into a pod as a file.
+
+Notes:
+- Uses stringData so you don't need to base64 encode manually.
+- Omits env vars whose source values are empty / unset.
+- Includes booleans / numbers from values.yaml because those are explicitly set.
+*/ -}}
+{{- if .Values.backend.enabled }}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ include "openrag.fullname" . }}-dotenv
+ namespace: {{ include "openrag.namespace" . }}
+ labels:
+ {{- include "openrag.labels" . | nindent 4 }}
+type: Opaque
+stringData:
+ .env: |
+ # Generated from Helm values.yaml (OpenRAG)
+ # Mounted as a file into the pod
+
+ # Ingestion Configuration
+ DISABLE_INGEST_WITH_LANGFLOW={{ ternary "true" "false" .Values.backend.features.disableIngestWithLangflow }}
+ INGEST_SAMPLE_DATA={{ ternary "true" "false" .Values.backend.features.ingestSampleData }}
+
+ # Langflow HTTP timeout configuration
+ {{- if .Values.backend.langflowTimeout }}
+ LANGFLOW_TIMEOUT={{ .Values.backend.langflowTimeout }}
+ {{- end }}
+ {{- if .Values.backend.langflowConnectTimeout }}
+ LANGFLOW_CONNECT_TIMEOUT={{ .Values.backend.langflowConnectTimeout }}
+ {{- end }}
+ {{- if .Values.backend.ingestionTimeout }}
+ INGESTION_TIMEOUT={{ .Values.backend.ingestionTimeout }}
+ {{- end }}
+ {{- if .Values.backend.uploadBatchSize }}
+ UPLOAD_BATCH_SIZE={{ .Values.backend.uploadBatchSize }}
+ {{- end }}
+
+ # Langflow url
+ LANGFLOW_URL={{ include "openrag.langflow.url" . | quote }}
+
+ # Flow IDs
+ {{- if .Values.langflow.flows.chatFlowId }}
+ LANGFLOW_CHAT_FLOW_ID={{ .Values.langflow.flows.chatFlowId | quote }}
+ {{- end }}
+ {{- if .Values.langflow.flows.ingestFlowId }}
+ LANGFLOW_INGEST_FLOW_ID={{ .Values.langflow.flows.ingestFlowId | quote }}
+ {{- end }}
+ {{- if .Values.langflow.flows.urlIngestFlowId }}
+ LANGFLOW_URL_INGEST_FLOW_ID={{ .Values.langflow.flows.urlIngestFlowId | quote }}
+ {{- end }}
+ {{- if .Values.langflow.flows.nudgesFlowId }}
+ NUDGES_FLOW_ID={{ .Values.langflow.flows.nudgesFlowId | quote }}
+ {{- end }}
+
+ # OpenSearch
+ {{- if .Values.global.opensearch.password }}
+ OPENSEARCH_PASSWORD={{ .Values.global.opensearch.password | quote }}
+ {{- end }}
+ OPENSEARCH_DATA_PATH=./opensearch-data
+ {{- if .Values.global.opensearch.host }}
+ OPENSEARCH_HOST={{ .Values.global.opensearch.host | quote }}
+ {{- end }}
+ {{- if .Values.global.opensearch.port }}
+ OPENSEARCH_PORT={{ .Values.global.opensearch.port | quote }}
+ {{- end }}
+ {{- if .Values.global.opensearch.username }}
+ OPENSEARCH_USERNAME={{ .Values.global.opensearch.username | quote }}
+ {{- end }}
+ {{- if .Values.global.opensearch.indexName }}
+ OPENSEARCH_INDEX_NAME={{ .Values.global.opensearch.indexName | quote }}
+ {{- end }}
+
+ # Google OAuth
+ {{- if .Values.global.oauth.google.clientId }}
+ GOOGLE_OAUTH_CLIENT_ID={{ .Values.global.oauth.google.clientId | quote }}
+ {{- end }}
+ {{- if .Values.global.oauth.google.clientSecret }}
+ GOOGLE_OAUTH_CLIENT_SECRET={{ .Values.global.oauth.google.clientSecret | quote }}
+ {{- end }}
+
+ # Microsoft Graph OAuth
+ {{- if .Values.global.oauth.microsoft.clientId }}
+ MICROSOFT_GRAPH_OAUTH_CLIENT_ID={{ .Values.global.oauth.microsoft.clientId | quote }}
+ {{- end }}
+ {{- if .Values.global.oauth.microsoft.clientSecret }}
+ MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET={{ .Values.global.oauth.microsoft.clientSecret | quote }}
+ {{- end }}
+
+ # AWS S3 credentials
+ {{- if .Values.backend.aws.accessKeyId }}
+ AWS_ACCESS_KEY_ID={{ .Values.backend.aws.accessKeyId | quote }}
+ {{- end }}
+ {{- if .Values.backend.aws.secretAccessKey }}
+ AWS_SECRET_ACCESS_KEY={{ .Values.backend.aws.secretAccessKey | quote }}
+ {{- end }}
+
+ # Webhook (continuous ingest)
+ {{- if .Values.backend.webhook.baseUrl }}
+ WEBHOOK_BASE_URL={{ .Values.backend.webhook.baseUrl | quote }}
+ {{- end }}
+
+ # Model Provider API Keys / Endpoints
+ {{- if .Values.llmProviders.openai.apiKey }}
+ OPENAI_API_KEY={{ .Values.llmProviders.openai.apiKey | quote }}
+ {{- end }}
+ {{- if .Values.llmProviders.anthropic.apiKey }}
+ ANTHROPIC_API_KEY={{ .Values.llmProviders.anthropic.apiKey | quote }}
+ {{- end }}
+ {{- if .Values.llmProviders.ollama.endpoint }}
+ OLLAMA_ENDPOINT={{ .Values.llmProviders.ollama.endpoint | quote }}
+ {{- end }}
+ {{- if .Values.llmProviders.watsonx.apiKey }}
+ WATSONX_API_KEY={{ .Values.llmProviders.watsonx.apiKey | quote }}
+ {{- end }}
+ {{- if .Values.llmProviders.watsonx.endpoint }}
+ WATSONX_ENDPOINT={{ .Values.llmProviders.watsonx.endpoint | quote }}
+ {{- end }}
+ {{- if .Values.llmProviders.watsonx.projectId }}
+ WATSONX_PROJECT_ID={{ .Values.llmProviders.watsonx.projectId | quote }}
+ {{- end }}
+
+ # LLM / Embedding provider configuration
+ {{- if .Values.appConfig.agent.llmProvider }}
+ LLM_PROVIDER={{ .Values.appConfig.agent.llmProvider | quote }}
+ {{- end }}
+ {{- if .Values.appConfig.agent.llmModel }}
+ LLM_MODEL={{ .Values.appConfig.agent.llmModel | quote }}
+ {{- end }}
+ {{- if .Values.appConfig.knowledge.embeddingProvider }}
+ EMBEDDING_PROVIDER={{ .Values.appConfig.knowledge.embeddingProvider | quote }}
+ {{- end }}
+ {{- if .Values.appConfig.knowledge.embeddingModel }}
+ EMBEDDING_MODEL={{ .Values.appConfig.knowledge.embeddingModel | quote }}
+ {{- end }}
+
+ # Port Configuration
+ {{- if .Values.backend.langflowPublicUrl }}
+ LANGFLOW_PUBLIC_URL={{ .Values.backend.langflowPublicUrl | quote }}
+ {{- end }}
+
+ # Docling (optional override)
+ {{- if and .Values.global.docling.scheme .Values.global.docling.host .Values.global.docling.port }}
+ DOCLING_SERVE_URL={{ printf "%s://%s:%v" .Values.global.docling.scheme .Values.global.docling.host .Values.global.docling.port | quote }}
+ {{- end }}
+
+ # Langflow auth
+ LANGFLOW_AUTO_LOGIN={{ ternary "true" "false" .Values.langflow.auth.autoLogin }}
+ {{- if .Values.langflow.auth.superuser }}
+ LANGFLOW_SUPERUSER={{ .Values.langflow.auth.superuser | quote }}
+ {{- end }}
+ {{- if .Values.langflow.auth.superuserPassword }}
+ LANGFLOW_SUPERUSER_PASSWORD={{ .Values.langflow.auth.superuserPassword | quote }}
+ {{- end }}
+
+ # Optional workers
+ {{- if .Values.backend.maxWorkers }}
+ MAX_WORKERS={{ .Values.backend.maxWorkers | quote }}
+ {{- end }}
+
+ # OpenRAG Configuration
+ {{- if .Values.global.imageTag }}
+ OPENRAG_VERSION={{ .Values.global.imageTag | quote }}
+ {{- end }}
+ {{- if .Values.backend.persistence.documents.mountPath }}
+ OPENRAG_DOCUMENTS_PATH={{ .Values.backend.persistence.documents.mountPath | quote }}
+ {{- end }}
+
+ # Langflow API Key / Secret Key
+ {{- if .Values.langflow.auth.apiKey }}
+ LANGFLOW_KEY={{ .Values.langflow.auth.apiKey | quote }}
+ {{- end }}
+ {{- if .Values.langflow.auth.secretKey }}
+ LANGFLOW_SECRET_KEY={{ .Values.langflow.auth.secretKey | quote }}
+ {{- end }}
+
+ {{- if .Values.langflow.auth.keyRetries }}
+ LANGFLOW_KEY_RETRIES={{ .Values.langflow.auth.keyRetries | quote }}
+ {{- end }}
+ {{- if .Values.langflow.auth.keyRetryDelay }}
+ LANGFLOW_KEY_RETRY_DELAY={{ .Values.langflow.auth.keyRetryDelay | quote }}
+ {{- end }}
+
+ # Logging and Service
+ {{- if .Values.backend.logFormat }}
+ LOG_FORMAT={{ .Values.backend.logFormat | quote }}
+ {{- end }}
+ {{- if .Values.backend.logLevel }}
+ LOG_LEVEL={{ .Values.backend.logLevel | quote }}
+ {{- end }}
+ {{- if .Values.backend.serviceName }}
+ SERVICE_NAME={{ .Values.backend.serviceName | quote }}
+ {{- end }}
+ {{- if .Values.backend.auth.sessionSecret }}
+ SESSION_SECRET={{ .Values.backend.auth.sessionSecret | quote }}
+ {{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/kubernetes/helm/openrag/templates/backend/deployment.yaml b/kubernetes/helm/openrag/templates/backend/deployment.yaml
index 2e0fc5316..0676e952b 100644
--- a/kubernetes/helm/openrag/templates/backend/deployment.yaml
+++ b/kubernetes/helm/openrag/templates/backend/deployment.yaml
@@ -131,192 +131,11 @@ spec:
- name: http
containerPort: 8000
protocol: TCP
- env:
- # OpenSearch connection (external SaaS)
- - name: OPENSEARCH_HOST
- value: {{ .Values.global.opensearch.host | quote }}
- - name: OPENSEARCH_PORT
- value: {{ .Values.global.opensearch.port | quote }}
- - name: OPENSEARCH_USERNAME
- value: {{ .Values.global.opensearch.username | quote }}
- {{- if .Values.global.opensearch.password }}
- - name: OPENSEARCH_PASSWORD
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-opensearch
- key: password
- {{- end }}
- - name: OPENSEARCH_INDEX_NAME
- value: {{ .Values.global.opensearch.indexName | quote }}
- # Langflow connection
- - name: LANGFLOW_URL
- value: {{ include "openrag.langflow.url" . | quote }}
- {{- if .Values.backend.langflowPublicUrl }}
- - name: LANGFLOW_PUBLIC_URL
- value: {{ .Values.backend.langflowPublicUrl | quote }}
- {{- end }}
- - name: LANGFLOW_AUTO_LOGIN
- value: {{ .Values.langflow.auth.autoLogin | quote }}
- - name: LANGFLOW_SUPERUSER
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-langflow
- key: superuser
- - name: LANGFLOW_SUPERUSER_PASSWORD
- valueFrom:
- name: {{ include "openrag.fullname" . }}-langflow
- key: superuser-password
- - name: LANGFLOW_KEY
- value: {{ .Values.langflow.auth.apiKey | default "" | quote }}
- - name: LANGFLOW_KEY_RETRIES
- value: {{ .Values.langflow.auth.keyRetries | default "15" | quote }}
- - name: LANGFLOW_KEY_RETRY_DELAY
- value: {{ .Values.langflow.auth.keyRetryDelay | default "2.0" | quote }}
- - name: LANGFLOW_VERSION
- value: {{ .Values.langflow.image.tag | default .Values.global.imageTag | quote }}
- - name: LOG_FORMAT
- value: {{ .Values.backend.logFormat | default "json" | quote }}
- - name: LOG_LEVEL
- value: {{ .Values.backend.logLevel | default "INFO" | quote }}
- - name: SERVICE_NAME
- value: {{ .Values.backend.serviceName | default "openrag" | quote }}
- - name: SESSION_SECRET
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-backend
- key: session-secret
- # Flow IDs from ConfigMap
- - name: LANGFLOW_CHAT_FLOW_ID
- valueFrom:
- configMapKeyRef:
- name: {{ include "openrag.fullname" . }}-flow-ids
- key: chat-flow-id
- - name: LANGFLOW_INGEST_FLOW_ID
- valueFrom:
- configMapKeyRef:
- name: {{ include "openrag.fullname" . }}-flow-ids
- key: ingest-flow-id
- - name: LANGFLOW_URL_INGEST_FLOW_ID
- valueFrom:
- configMapKeyRef:
- name: {{ include "openrag.fullname" . }}-flow-ids
- key: url-ingest-flow-id
- - name: NUDGES_FLOW_ID
- valueFrom:
- configMapKeyRef:
- name: {{ include "openrag.fullname" . }}-flow-ids
- key: nudges-flow-id
- # Feature flags
- - name: DISABLE_INGEST_WITH_LANGFLOW
- value: {{ .Values.backend.features.disableIngestWithLangflow | quote }}
- - name: INGEST_SAMPLE_DATA
- value: {{ .Values.backend.features.ingestSampleData | quote }}
- # Logging
- - name: LOG_LEVEL
- value: {{ .Values.backend.logLevel | quote }}
- - name: ACCESS_LOG
- value: {{ .Values.backend.accessLog | quote }}
- {{- if .Values.backend.noColor }}
- - name: NO_COLOR
- value: "1"
- {{- end }}
- # Timeouts
- - name: LANGFLOW_TIMEOUT
- value: {{ .Values.backend.langflowTimeout | quote }}
- - name: LANGFLOW_CONNECT_TIMEOUT
- value: {{ .Values.backend.langflowConnectTimeout | quote }}
- - name: INGESTION_TIMEOUT
- value: {{ .Values.backend.ingestionTimeout | quote }}
- # Concurrency
- - name: UPLOAD_BATCH_SIZE
- value: {{ .Values.backend.uploadBatchSize | quote }}
- {{- if .Values.backend.maxWorkers }}
- - name: MAX_WORKERS
- value: {{ .Values.backend.maxWorkers | quote }}
- {{- end }}
- # LLM Provider keys
- {{- if .Values.llmProviders.openai.enabled }}
- - name: OPENAI_API_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: openai-api-key
- {{- end }}
- {{- if .Values.llmProviders.anthropic.enabled }}
- - name: ANTHROPIC_API_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: anthropic-api-key
- {{- end }}
- {{- if .Values.llmProviders.watsonx.enabled }}
- - name: WATSONX_API_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: watsonx-api-key
- - name: WATSONX_ENDPOINT
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: watsonx-endpoint
- - name: WATSONX_PROJECT_ID
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: watsonx-project-id
- {{- end }}
- # Docling service URL (for document processing in flows)
- - name: DOCLING_SERVE_URL
- value: {{ include "openrag.docling.url" . | quote }}
- {{- if .Values.llmProviders.ollama.enabled }}
- - name: OLLAMA_ENDPOINT
- value: {{ .Values.llmProviders.ollama.endpoint | quote }}
- {{- end }}
- # OAuth credentials
- {{- if .Values.global.oauth.google.enabled }}
- - name: GOOGLE_OAUTH_CLIENT_ID
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-oauth
- key: google-client-id
- - name: GOOGLE_OAUTH_CLIENT_SECRET
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-oauth
- key: google-client-secret
- {{- end }}
- {{- if .Values.global.oauth.microsoft.enabled }}
- - name: MICROSOFT_GRAPH_OAUTH_CLIENT_ID
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-oauth
- key: microsoft-client-id
- - name: MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-oauth
- key: microsoft-client-secret
- {{- end }}
- # AWS credentials
- {{- if .Values.backend.aws.enabled }}
- - name: AWS_ACCESS_KEY_ID
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-aws
- key: access-key-id
- - name: AWS_SECRET_ACCESS_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-aws
- key: secret-access-key
- {{- end }}
- # Webhook configuration
- {{- if .Values.backend.webhook.enabled }}
- - name: WEBHOOK_BASE_URL
- value: {{ .Values.backend.webhook.baseUrl | quote }}
- {{- end }}
volumeMounts:
+ - name: openrag-dotenv
+ mountPath: /app/.env
+ subPath: .env
+ readOnly: true
{{- if .Values.backend.persistence.documents.enabled }}
- name: documents
mountPath: {{ .Values.backend.persistence.documents.mountPath }}
@@ -354,24 +173,46 @@ spec:
- /bin/sh
- -c
- |
- # Check OpenSearch health
- if ! curl -sf -k -u "${OPENSEARCH_USERNAME}:${OPENSEARCH_PASSWORD}" "{{ include "openrag.opensearch.url" . }}" > /dev/null 2>&1; then
- echo "OpenSearch health check failed"
- exit 1
+ set -eu
+ FAILED=0
+
+ # OpenSearch: verify endpoint is reachable; fail only if unreachable (000) or 5xx
+ echo "Checking OpenSearch..."
+ HTTP_CODE="$(curl -sk -o /dev/null -w '%{http_code}' "{{ include "openrag.opensearch.url" . }}" || echo '000')"
+
+ case "$HTTP_CODE" in
+ 000|5??)
+ echo "ERROR: OpenSearch health check failed at {{ include "openrag.opensearch.url" . }} (HTTP $HTTP_CODE)"
+ FAILED=1
+ ;;
+ *)
+ echo "OpenSearch: OK (HTTP $HTTP_CODE)"
+ ;;
+ esac
+
+ # Langflow health
+ echo "Checking Langflow..."
+ if ! curl -sf "{{ include "openrag.langflow.url" . }}/health" >/dev/null 2>&1; then
+ echo "ERROR: Langflow health check failed at {{ include "openrag.langflow.url" . }}/health"
+ FAILED=1
+ else
+ echo "Langflow: OK"
fi
-
- # Check Langflow health
- if ! curl -sf "{{ include "openrag.langflow.url" . }}/health" > /dev/null 2>&1; then
- echo "Langflow health check failed"
- exit 1
+
+ # Docling health
+ echo "Checking Docling..."
+ if ! curl -sf "{{ include "openrag.docling.url" . }}/health" >/dev/null 2>&1; then
+ echo "ERROR: Docling health check failed at {{ include "openrag.docling.url" . }}/health"
+ FAILED=1
+ else
+ echo "Docling: OK"
fi
-
- # Check Docling health
- if ! curl -sf "{{ include "openrag.docling.url" . }}/health" > /dev/null 2>&1; then
- echo "Docling health check failed"
+
+ if [ "$FAILED" -eq 1 ]; then
+ echo "Health check failed: one or more dependencies are unavailable"
exit 1
fi
-
+
echo "All health checks passed"
exit 0
initialDelaySeconds: {{ .Values.backend.readinessProbe.initialDelaySeconds }}
@@ -380,6 +221,13 @@ spec:
failureThreshold: {{ .Values.backend.readinessProbe.failureThreshold }}
{{- end }}
volumes:
+ - name: openrag-dotenv
+ secret:
+ secretName: {{ include "openrag.fullname" . }}-dotenv
+ defaultMode: 0400
+ items:
+ - key: .env
+ path: .env
{{- if .Values.backend.persistence.documents.enabled }}
- name: documents
emptyDir: {}
diff --git a/kubernetes/helm/openrag/templates/langflow/deployment.yaml b/kubernetes/helm/openrag/templates/langflow/deployment.yaml
index 3c25bfa68..c355cc265 100644
--- a/kubernetes/helm/openrag/templates/langflow/deployment.yaml
+++ b/kubernetes/helm/openrag/templates/langflow/deployment.yaml
@@ -121,169 +121,13 @@ spec:
containerPort: 7860
protocol: TCP
- env:
- # Langflow core settings
- - name: LANGFLOW_DATABASE_URL
- value: "sqlite:///{{ .Values.langflow.persistence.mountPath }}/{{ .Values.langflow.persistence.dbSubPath }}"
- - name: LANGFLOW_CONFIG_DIR
- value: {{ .Values.langflow.persistence.mountPath }}
- - name: LANGFLOW_DEACTIVATE_TRACING
- value: {{ .Values.langflow.deactivateTracing | quote }}
- - name: LANGFLOW_LOG_LEVEL
- value: {{ .Values.langflow.logLevel | quote }}
- - name: HIDE_GETTING_STARTED_PROGRESS
- value: "true"
- # Langflow Tracking (Langfuse)
- - name: LANGFUSE_SECRET_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-langflow
- key: langfuse-secret-key
- - name: LANGFUSE_PUBLIC_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-langflow
- key: langfuse-public-key
- - name: LANGFUSE_HOST
- value: {{ .Values.langflow.langfuse.host | quote }}
- # Auth settings
- - name: LANGFLOW_AUTO_LOGIN
- value: {{ .Values.langflow.auth.autoLogin | quote }}
- - name: LANGFLOW_NEW_USER_IS_ACTIVE
- value: {{ .Values.langflow.auth.newUserIsActive | quote }}
- - name: LANGFLOW_ENABLE_SUPERUSER_CLI
- value: {{ .Values.langflow.auth.enableSuperuserCli | quote }}
-
- # Variables to expose to flows (NOTE: must use valid env var names; no hyphens)
- - name: LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT
- value: {{ .Values.langflow.variablesToGetFromEnvironment | quote }}
-
- # Flow context variables (defaults for flow execution)
- - name: JWT
- value: "None"
- - name: OWNER
- value: "None"
- - name: OWNER_NAME
- value: "None"
- - name: OWNER_EMAIL
- value: "None"
- - name: CONNECTOR_TYPE
- value: "system"
- - name: CONNECTOR_TYPE_URL
- value: "url"
- - name: DOCUMENT_ID
- value: ""
- - name: SOURCE_URL
- value: ""
- - name: ALLOWED_USERS
- value: "[]"
- - name: ALLOWED_GROUPS
- value: "[]"
- - name: OPENRAG-QUERY-FILTER
- value: {{ .Values.langflow.openragQueryFilter | quote }}
- - name: FILENAME
- value: "None"
- - name: MIMETYPE
- value: "None"
- - name: FILESIZE
- value: "0"
- - name: SELECTED_EMBEDDING_MODEL
- value: ""
-
- # Secrets from langflow secret
- - name: LANGFLOW_SECRET_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-langflow
- key: secret-key
- - name: LANGFLOW_SUPERUSER
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-langflow
- key: superuser
- - name: LANGFLOW_SUPERUSER_PASSWORD
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-langflow
- key: superuser-password
-
- # OpenSearch connection (for flows)
- - name: OPENSEARCH_HOST
- value: {{ .Values.global.opensearch.host | quote }}
- - name: OPENSEARCH_PORT
- value: {{ .Values.global.opensearch.port | quote }}
- - name: OPENSEARCH_URL
- value: {{ include "openrag.opensearch.url" . | quote }}
- - name: OPENSEARCH_INDEX_NAME
- value: {{ .Values.global.opensearch.indexName | quote }}
- # Docling service URL (for document processing in flows)
- - name: DOCLING_SERVE_URL
- value: {{ .Values.langflow.doclingServeUrl | quote }}
- {{- if .Values.global.opensearch.password }}
- - name: OPENSEARCH_PASSWORD
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-opensearch
- key: password
- {{- end }}
-
- # LLM Provider keys
- {{- if .Values.llmProviders.openai.enabled }}
- - name: OPENAI_API_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: openai-api-key
- {{- else }}
- - name: OPENAI_API_KEY
- value: "None"
- {{- end }}
-
- {{- if .Values.llmProviders.anthropic.enabled }}
- - name: ANTHROPIC_API_KEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: anthropic-api-key
- {{- else }}
- - name: ANTHROPIC_API_KEY
- value: "None"
- {{- end }}
-
- {{- if .Values.llmProviders.watsonx.enabled }}
- - name: WATSONX_APIKEY
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: watsonx-api-key
- - name: WATSONX_URL
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: watsonx-endpoint
- - name: WATSONX_PROJECT_ID
- valueFrom:
- secretKeyRef:
- name: {{ include "openrag.fullname" . }}-llm-providers
- key: watsonx-project-id
- {{- else }}
- - name: WATSONX_APIKEY
- value: "None"
- - name: WATSONX_URL
- value: "None"
- - name: WATSONX_PROJECT_ID
- value: "None"
- {{- end }}
-
- {{- if .Values.llmProviders.ollama.enabled }}
- - name: OLLAMA_BASE_URL
- value: {{ .Values.llmProviders.ollama.endpoint | quote }}
- {{- else }}
- - name: OLLAMA_BASE_URL
- value: "None"
- {{- end }}
+ command: ["langflow", "run", "--env-file", "/app/.env"]
volumeMounts:
+ - name: openrag-langflow-dotenv
+ mountPath: /app/.env
+ subPath: .env
+ readOnly: true
- name: langflow-data
mountPath: {{ .Values.langflow.persistence.mountPath }}
@@ -313,6 +157,13 @@ spec:
{{- end }}
volumes:
+ - name: openrag-langflow-dotenv
+ secret:
+ secretName: {{ include "openrag.fullname" . }}-langflow-dotenv
+ defaultMode: 0400
+ items:
+ - key: .env
+ path: .env
- name: langflow-data
{{- if .Values.langflow.persistence.enabled }}
persistentVolumeClaim:
diff --git a/kubernetes/helm/openrag/templates/langflow/langflow-dotenv.yaml b/kubernetes/helm/openrag/templates/langflow/langflow-dotenv.yaml
new file mode 100644
index 000000000..cfc7f8441
--- /dev/null
+++ b/kubernetes/helm/openrag/templates/langflow/langflow-dotenv.yaml
@@ -0,0 +1,146 @@
+{{- /*
+Creates a Secret with a single key ".env" that can be mounted into a pod as a file.
+
+Notes:
+- Uses stringData so you don't need to base64 encode manually.
+- Omits env vars whose source values are empty / unset.
+- Includes booleans / numbers from values.yaml because those are explicitly set.
+*/ -}}
+{{- if .Values.backend.enabled }}
+apiVersion: v1
+kind: Secret
+metadata:
+ name: {{ include "openrag.fullname" . }}-langflow-dotenv
+ namespace: {{ include "openrag.namespace" . }}
+ labels:
+ {{- include "openrag.labels" . | nindent 4 }}
+type: Opaque
+stringData:
+ .env: |
+ # Generated from Helm values.yaml (OpenRAG)
+ # Mounted as a file into the pod
+
+ # Langflow core settings
+ LANGFLOW_LOAD_FLOWS_PATH={{ .Values.langflow.persistence.mountPath }}/{{ .Values.langflow.persistence.flowsSubPath }}
+ LANGFLOW_DATABASE_URL="sqlite:///{{ .Values.langflow.persistence.mountPath }}/{{ .Values.langflow.persistence.dbSubPath }}"
+ LANGFLOW_DEACTIVATE_TRACING={{ .Values.langflow.deactivateTracing | quote }}
+ LANGFLOW_LOG_LEVEL={{ .Values.langflow.logLevel | quote }}
+ HIDE_GETTING_STARTED_PROGRESS="true"
+
+ # Langflow API secret key (https://docs.langflow.org/api-keys-and-authentication#langflow-secret-key)
+ {{- if .Values.langflow.auth.secretKey }}
+ LANGFLOW_SECRET_KEY={{ .Values.langflow.auth.secretKey | quote }}
+ {{- end }}
+
+ # Model Provider API Keys / Endpoints
+ {{- if .Values.llmProviders.openai.apiKey }}
+ OPENAI_API_KEY={{ .Values.llmProviders.openai.apiKey | quote }}
+ {{- else }}
+ OPENAI_API_KEY="None"
+ {{- end }}
+ {{- if .Values.llmProviders.anthropic.apiKey }}
+ ANTHROPIC_API_KEY={{ .Values.llmProviders.anthropic.apiKey | quote }}
+ {{- else }}
+ ANTHROPIC_API_KEY="None"
+ {{- end }}
+ {{- if .Values.llmProviders.ollama.endpoint }}
+ OLLAMA_BASE_URL={{ .Values.llmProviders.ollama.endpoint | quote }}
+ {{- else }}
+ OLLAMA_BASE_URL="None"
+ {{- end }}
+ {{- if .Values.llmProviders.watsonx.apiKey }}
+ WATSONX_API_KEY={{ .Values.llmProviders.watsonx.apiKey | quote }}
+ {{- else }}
+ WATSONX_API_KEY="None"
+ {{- end }}
+ {{- if .Values.llmProviders.watsonx.endpoint }}
+ WATSONX_ENDPOINT={{ .Values.llmProviders.watsonx.endpoint | quote }}
+ {{- else }}
+ WATSONX_ENDPOINT="None"
+ {{- end }}
+ {{- if .Values.llmProviders.watsonx.projectId }}
+ WATSONX_PROJECT_ID={{ .Values.llmProviders.watsonx.projectId | quote }}
+ {{- else }}
+ WATSONX_PROJECT_ID="None"
+ {{- end }}
+
+ # LLM / Embedding provider configuration
+ {{- if .Values.appConfig.agent.llmProvider }}
+ LLM_PROVIDER={{ .Values.appConfig.agent.llmProvider | quote }}
+ {{- end }}
+ {{- if .Values.appConfig.agent.llmModel }}
+ LLM_MODEL={{ .Values.appConfig.agent.llmModel | quote }}
+ {{- end }}
+ {{- if .Values.appConfig.knowledge.embeddingProvider }}
+ EMBEDDING_PROVIDER={{ .Values.appConfig.knowledge.embeddingProvider | quote }}
+ {{- end }}
+ {{- if .Values.appConfig.knowledge.embeddingModel }}
+ EMBEDDING_MODEL={{ .Values.appConfig.knowledge.embeddingModel | quote }}
+ {{- end }}
+
+ # Docling service URL
+ {{- if and .Values.global.docling.scheme .Values.global.docling.host .Values.global.docling.port }}
+ DOCLING_SERVE_URL={{ printf "%s://%s:%v" .Values.global.docling.scheme .Values.global.docling.host .Values.global.docling.port | quote }}
+ {{- end }}
+
+ # OpenSearch connection (for flows)
+ OPENSEARCH_HOST={{ .Values.global.opensearch.host | quote }}
+ OPENSEARCH_PORT={{ .Values.global.opensearch.port | quote }}
+ OPENSEARCH_URL={{ include "openrag.opensearch.url" . | quote }}
+ OPENSEARCH_INDEX_NAME={{ .Values.global.opensearch.indexName | quote }}
+ {{- if .Values.global.opensearch.password }}
+ OPENSEARCH_PASSWORD={{ .Values.global.opensearch.password | quote }}
+ {{- end }}
+
+ # Langflow auth
+ LANGFLOW_AUTO_LOGIN={{ ternary "true" "false" .Values.langflow.auth.autoLogin }}
+ {{- if .Values.langflow.auth.superuser }}
+ LANGFLOW_SUPERUSER={{ .Values.langflow.auth.superuser | quote }}
+ {{- end }}
+ {{- if .Values.langflow.auth.superuserPassword }}
+ LANGFLOW_SUPERUSER_PASSWORD={{ .Values.langflow.auth.superuserPassword | quote }}
+ {{- end }}
+ LANGFLOW_NEW_USER_IS_ACTIVE={{ ternary "true" "false" .Values.langflow.auth.newUserIsActive }}
+ LANGFLOW_ENABLE_SUPERUSER_CLI={{ ternary "true" "false" .Values.langflow.auth.enableSuperuserCli }}
+
+ # Langfuse tracing (optional)
+ {{- if .Values.langflow.langfuse.secretKey }}
+ LANGFUSE_SECRET_KEY={{ .Values.langflow.langfuse.secretKey | quote }}
+ {{- end }}
+ {{- if .Values.langflow.langfuse.publicKey }}
+ LANGFUSE_PUBLIC_KEY={{ .Values.langflow.langfuse.publicKey | quote }}
+ {{- end }}
+ {{- if .Values.langflow.langfuse.host }}
+ LANGFUSE_HOST={{ .Values.langflow.langfuse.host | quote }}
+ {{- end }}
+
+ # Variables to expose to flows (NOTE: must use valid env var names; no hyphens)
+ LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT={{ .Values.langflow.variablesToGetFromEnvironment | quote }}
+
+ # Flow context variables (defaults for flow execution)
+ JWT={{ .Values.langflow.flowDefaults.jwt | quote }}
+ OWNER={{ .Values.langflow.flowDefaults.owner | quote }}
+ OWNER_NAME={{ .Values.langflow.flowDefaults.ownerName | quote }}
+ OWNER_EMAIL={{ .Values.langflow.flowDefaults.ownerEmail | quote }}
+ CONNECTOR_TYPE={{ .Values.langflow.flowDefaults.connectorType | quote }}
+ CONNECTOR_TYPE_URL={{ .Values.langflow.flowDefaults.connectorTypeUrl | quote }}
+ DOCUMENT_ID={{ .Values.langflow.flowDefaults.documentId | quote }}
+ SOURCE_URL={{ .Values.langflow.flowDefaults.sourceUrl | quote }}
+ ALLOWED_USERS={{ .Values.langflow.flowDefaults.allowedUsers | quote }}
+ ALLOWED_GROUPS={{ .Values.langflow.flowDefaults.allowedGroups | quote }}
+ OPENRAG-QUERY-FILTER={{ .Values.langflow.openragQueryFilter | quote }}
+ FILENAME={{ .Values.langflow.flowDefaults.filename | quote }}
+ MIMETYPE={{ .Values.langflow.flowDefaults.mimetype | quote }}
+ FILESIZE={{ .Values.langflow.flowDefaults.filesize | quote }}
+ SELECTED_EMBEDDING_MODEL={{ .Values.langflow.flowDefaults.selectedEmbeddingModel | quote }}
+
+ # Langflow API Key generation / retries
+ LANGFLOW_KEY={{ .Values.langflow.auth.apiKey | quote }}
+ {{- if .Values.langflow.auth.keyRetries }}
+ LANGFLOW_KEY_RETRIES={{ .Values.langflow.auth.keyRetries | quote }}
+ {{- end }}
+ {{- if .Values.langflow.auth.keyRetryDelay }}
+ LANGFLOW_KEY_RETRY_DELAY={{ .Values.langflow.auth.keyRetryDelay | quote }}
+ {{- end }}
+
+{{- end }}
\ No newline at end of file
diff --git a/kubernetes/helm/openrag/values.yaml b/kubernetes/helm/openrag/values.yaml
index 1eb7fff48..6a2064d08 100644
--- a/kubernetes/helm/openrag/values.yaml
+++ b/kubernetes/helm/openrag/values.yaml
@@ -102,7 +102,6 @@ langflow:
autoLogin: false
superuser: "admin" # Langflow superuser username
superuserPassword: "" # Langflow superuser password (stored in secret)
- superuserPassword: "" # Langflow superuser password (stored in secret)
apiKey: "" # Optional: pre-generated API key
keyRetries: 15 # Number of retries for key generation
keyRetryDelay: 2.0 # Delay between retries
@@ -116,6 +115,23 @@ langflow:
doclingServeUrl: "http://host.docker.internal:5001"
openragQueryFilter: "{}"
+ # Flow context default variables (injected into every flow execution)
+ flowDefaults:
+ jwt: "None"
+ owner: "None"
+ ownerName: "None"
+ ownerEmail: "None"
+ connectorType: "system"
+ connectorTypeUrl: "url"
+ documentId: ""
+ sourceUrl: ""
+ allowedUsers: "[]"
+ allowedGroups: "[]"
+ filename: "None"
+ mimetype: "None"
+ filesize: "0"
+ selectedEmbeddingModel: ""
+
# Langfuse Tracking
langfuse:
secretKey: ""