Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
ajout du discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisdondon committed Mar 10, 2021
1 parent 9e8cb13 commit 53afbf9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
16 changes: 14 additions & 2 deletions charts/jupyter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.security.whitelis
{{- end }}


{{- define "hiveMestastore.configmap" -}}
{{- define "hiveMetastore.configmap" -}}
{{ printf "<?xml version=\"1.0\"?>" }}
{{ printf "<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>" }}
{{ printf "<configuration>"}}
Expand All @@ -124,10 +124,22 @@ nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.security.whitelis
{{- end }}
{{ printf "<property>"}}
{{ printf "<name>metastore.thrift.uris</name>" | indent 4}}
{{ printf "<value>thrift://\"%s\":9083</value>" $service.metadata.name | indent 4}}
{{ printf "<value>thrift://%s:9083</value>" $service.metadata.name | indent 4}}
{{ printf "</property>"}}
{{- $virgule = 1}}
{{- end }}
{{- end }}
{{ printf "</configuration>"}}
{{- end }}

{{/*
Create the name of the config map hive to use
*/}}
{{- define "jupyter.configMapNameHive" -}}
{{- if .Values.discovery.hive }}
{{- $name:= (printf "%s-configmaphive" (include "jupyter.fullname" .) ) }}
{{- default $name .Values.hive.configMapName }}
{{- else }}
{{- default "default" .Values.hive.configMapName }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/jupyter/templates/configmap-hive.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if contains "thrift" (include "hiveMetastore.configmap" .) }}
{{- if .Values.discovery.hive -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{- printf "%s-configmaphive" (include "jupyter.fullname" .) }}
name: {{ include "jupyter.configMapNameHive" . }}
labels:
{{- include "jupyter.labels" . | nindent 4 }}
data:
Expand Down
4 changes: 4 additions & 0 deletions charts/jupyter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ git:
name: ""
email: ""
cache: ""
#active ou non la recherche d'un hiveMetastore dans le namespace
# see configmap-hive.yaml et helpers template
discovery:
hive: true

hive:
configMapName: ""
Expand Down

0 comments on commit 53afbf9

Please sign in to comment.