Skip to content

Commit

Permalink
superset discovers elastic
Browse files Browse the repository at this point in the history
  • Loading branch information
ihiverlet committed Jun 18, 2024
1 parent 08e12e5 commit b5e1d93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/superset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -33,5 +33,5 @@ dependencies:
version: 0.12.4
repository: https://apache.github.io/superset
- name: library-chart
version: 1.5.20
version: 1.5.23
repository: https://inseefrlab.github.io/helm-charts-interactive-services
16 changes: 15 additions & 1 deletion charts/superset/templates/_discovery.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ Create the name of the config map S3 to use
{{- $service:= ( index $secret.data "elastic-service" | default "") | b64dec }}
{{- $name:= ( index $secret.data "elastic-name" | default "") | b64dec }}
{{- $port:= ( index $secret.data "elastic-port") | b64dec }}
{{- $data := dict "elastic" $elastic "service" $service "name" $name "port" $port}}
{{- $password := ( index $secret.data "elastic-password" | default "") | b64dec }}
{{- $tls := ( index $secret.data "elastic-tls" | default "ZmFsc2U=") | b64dec }}
{{- $username := ( index $secret.data "elastic-username" | default "") | b64dec }}
{{- $data := dict "elastic" $elastic "service" $service "name" $name "port" $port "password" $password "username" $username "tls" $tls }}
{{- if $test }}
{{ printf "databases:" | indent 2 }}
{{- $test = 0}}
Expand Down Expand Up @@ -96,12 +99,23 @@ Create the name of the config map S3 to use
{{- $service:= .service }}
{{- $port:= .port }}
{{- $name:= .name }}
{{- $username:= .username }}
{{- $password:= .password }}
{{- $tls:= .tls }}
{{- if $elastic }}
{{ printf "- allow_file_upload: true"| indent 2}}
{{ printf "allow_ctas: true"| indent 4}}
{{ printf "allow_cvas: true"| indent 4}}
{{ printf "database_name: %s" $name | indent 4}}
{{- if eq $tls "true" }}
{{- if and $password $username }}
{{ printf "sqlalchemy_uri: elasticsearch+https://%s:%s@%s:%s/" $username $password $service $port | indent 4 }}
{{- else }}
{{ printf "sqlalchemy_uri: elasticsearch+https://%s:%s/" $service $port | indent 4 }}
{{- end }}
{{- else }}
{{ printf "sqlalchemy_uri: elasticsearch+http://%s:%s/" $service $port | indent 4}}
{{- end }}
{{ printf "tables: []" | indent 4}}
{{- end }}
{{- end -}}
Expand Down

0 comments on commit b5e1d93

Please sign in to comment.