Skip to content

Commit

Permalink
add env var for opensearch
Browse files Browse the repository at this point in the history
  • Loading branch information
topherinternational committed Dec 20, 2024
1 parent 2b7354d commit abe9384
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ If release name contains chart name it will be used as a full name.
key: connection
{{- end }}
{{- end }}
{{- if .Values.opensearch.enabled }}
{{- if .Values.enableBuiltInSecretEnvVars.AIRFLOW__OPENSEARCH__HOST }}
- name: AIRFLOW__OPENSEARCH__HOST
valueFrom:
secretKeyRef:
name: {{ template "opensearch_secret" . }}
key: connection
{{- end }}
{{- end }}
{{- end }}

{{/* User defined Airflow environment variables */}}
Expand Down Expand Up @@ -427,6 +436,10 @@ If release name contains chart name it will be used as a full name.
{{- default (printf "%s-elasticsearch" (include "airflow.fullname" .)) .Values.elasticsearch.secretName }}
{{- end }}

{{- define "opensearch_secret" -}}
{{- default (printf "%s-opensearch" (include "airflow.fullname" .)) .Values.opensearch.secretName }}
{{- end }}

{{- define "flower_secret" -}}
{{- default (printf "%s-flower" (include "airflow.fullname" .)) .Values.flower.secretName }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,11 @@
"description": "Enable ``AIRFLOW__ELASTICSEARCH__ELASTICSEARCH_HOST`` variable to be read from the Elasticsearch Host Secret - Airflow <1.10.4 variant",
"type": "boolean",
"default": true
},
"AIRFLOW__OPENSEARCH__HOST": {
"description": "Enable ``AIRFLOW__OPENSEARCH__HOST`` variable to be read from the OpenSearch Host Secret",
"type": "boolean",
"default": true
}
}
},
Expand Down
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ enableBuiltInSecretEnvVars:
AIRFLOW__CELERY__BROKER_URL: true
AIRFLOW__ELASTICSEARCH__HOST: true
AIRFLOW__ELASTICSEARCH__ELASTICSEARCH_HOST: true
AIRFLOW__OPENSEARCH__HOST: true

# Priority Classes that will be installed by charts.
# Ideally, there should be an entry for dagProcessor, flower,
Expand Down

0 comments on commit abe9384

Please sign in to comment.