Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[K8S][HELM] Implement new configuration approach #6521

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 2 additions & 26 deletions charts/kyuubi/templates/kyuubi-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,6 @@ metadata:
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
data:
{{- with .Values.kyuubiConf.kyuubiEnv }}
kyuubi-env.sh: |
{{- tpl . $ | nindent 4 }}
{{- end }}
kyuubi-defaults.conf: |
## Helm chart provided Kyuubi configurations
kyuubi.kubernetes.namespace={{ .Release.Namespace }}
kyuubi.frontend.connection.url.use.hostname=false
kyuubi.frontend.thrift.binary.bind.port={{ .Values.server.thriftBinary.port }}
kyuubi.frontend.thrift.http.bind.port={{ .Values.server.thriftHttp.port }}
kyuubi.frontend.rest.bind.port={{ .Values.server.rest.port }}
kyuubi.frontend.mysql.bind.port={{ .Values.server.mysql.port }}
kyuubi.frontend.protocols={{ include "kyuubi.frontend.protocols" . }}

# Kyuubi Metrics
kyuubi.metrics.enabled={{ .Values.metrics.enabled }}
kyuubi.metrics.reporters={{ .Values.metrics.reporters }}
kyuubi.metrics.prometheus.port={{ .Values.metrics.prometheusPort }}

## User provided Kyuubi configurations
{{- with .Values.kyuubiConf.kyuubiDefaults }}
{{- tpl . $ | nindent 4 }}
{{- end }}
{{- with .Values.kyuubiConf.log4j2 }}
log4j2.xml: |
{{- tpl . $ | nindent 4 }}
{{- with .Values.kyuubiConf.files }}
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
17 changes: 2 additions & 15 deletions charts/kyuubi/templates/kyuubi-spark-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ metadata:
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
data:
{{- with .Values.sparkConf.sparkEnv }}
spark-env.sh: |
{{- tpl . $ | nindent 4 }}
{{- end }}
{{- with .Values.sparkConf.sparkDefaults }}
spark-defaults.conf: |
{{- tpl . $ | nindent 4 }}
{{- end }}
{{- with .Values.sparkConf.log4j2 }}
log4j2.properties: |
{{- tpl . $ | nindent 4 }}
{{- end }}
{{- with .Values.sparkConf.metrics }}
metrics.properties: |
{{- tpl . $ | nindent 4 }}
{{- with .Values.sparkConf.files }}
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
42 changes: 33 additions & 9 deletions charts/kyuubi/templates/kyuubi-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,28 @@ spec:
{{- with .Values.command }}
command: {{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
{{- with .Values.args }}
{{- if .Values.args }}
args: {{- tpl (toYaml .) $ | nindent 12 }}
{{- else }}
args:
- ./bin/kyuubi
- run
- --conf kyuubi.kubernetes.namespace={{ .Release.Namespace }}
- --conf kyuubi.frontend.connection.url.use.hostname=false
- --conf kyuubi.frontend.thrift.binary.bind.port={{ .Values.server.thriftBinary.port }}
- --conf kyuubi.frontend.thrift.http.bind.port={{ .Values.server.thriftHttp.port }}
- --conf kyuubi.frontend.rest.bind.port={{ .Values.server.rest.port }}
- --conf kyuubi.frontend.mysql.bind.port={{ .Values.server.mysql.port }}
- --conf kyuubi.frontend.protocols={{ include "kyuubi.frontend.protocols" . }}
- --conf kyuubi.metrics.enabled={{ .Values.metrics.enabled }}
- --conf kyuubi.metrics.reporters={{ .Values.metrics.reporters }}
- --conf kyuubi.metrics.prometheus.port={{ .Values.metrics.prometheusPort }}
{{- end }}
env:
- name: KYUUBI_CONF_DIR
value: {{ .Values.kyuubiConfDir }}
value: {{ .Values.kyuubiConf.dir }}
- name: SPARK_CONF_DIR
value: {{ .Values.sparkConfDir }}
value: {{ .Values.sparkConf.dir }}
{{- with .Values.env }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -109,9 +123,9 @@ spec:
{{- end }}
volumeMounts:
- name: conf
mountPath: {{ .Values.kyuubiConfDir }}
mountPath: {{ .Values.kyuubiConf.dir }}
- name: conf-spark
mountPath: {{ .Values.sparkConfDir }}
mountPath: {{ .Values.sparkConf.dir }}
{{- with .Values.volumeMounts }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand All @@ -120,11 +134,21 @@ spec:
{{- end }}
volumes:
- name: conf
configMap:
name: {{ .Release.Name }}
projected:
sources:
- configMap:
name: {{ .Release.Name }}
{{- with .Values.kyuubiConf.filesFrom }}
{{- tpl (toYaml .) $ | nindent 14 }}
{{- end }}
- name: conf-spark
configMap:
name: {{ .Release.Name }}-spark
projected:
sources:
- configMap:
name: {{ .Release.Name }}-spark
{{- with .Values.sparkConf.filesFrom }}
{{- tpl (toYaml .) $ | nindent 14 }}
{{- end }}
{{- with .Values.volumes }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
Expand Down
90 changes: 42 additions & 48 deletions charts/kyuubi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,53 +145,40 @@ server:
# clientIP:
# timeoutSeconds: 10800

# $KYUUBI_CONF_DIR directory
kyuubiConfDir: /opt/kyuubi/conf
# Kyuubi configuration files
kyuubiConf:
# The value (templated string) is used for kyuubi-env.sh file
# See example at conf/kyuubi-env.sh.template and https://kyuubi.readthedocs.io/en/master/configuration/settings.html#environments for more details
kyuubiEnv: ~
# kyuubiEnv: |
# #!/usr/bin/env bash
# export JAVA_HOME=/usr/jdk64/jdk1.8.0_152
# export SPARK_HOME=/opt/spark
# export FLINK_HOME=/opt/flink
# export HIVE_HOME=/opt/hive

# The value (templated string) is used for kyuubi-defaults.conf file
# See https://kyuubi.readthedocs.io/en/master/configuration/settings.html#kyuubi-configurations for more details
kyuubiDefaults: ~
# kyuubiDefaults: |
# $KYUUBI_CONF_DIR directory
dir: /opt/kyuubi/conf
# Configuration files from the specified keys (file name) and values (file content)
files: ~
#files:
# 'kyuubi-defaults.conf': |
# kyuubi.authentication=NONE
# kyuubi.frontend.bind.host=10.0.0.1
# kyuubi.engine.type=SPARK_SQL
# kyuubi.engine.share.level=USER
# kyuubi.session.engine.initialize.timeout=PT3M
# kyuubi.ha.addresses=zk1:2181,zk2:2181,zk3:2181
# kyuubi.ha.namespace=kyuubi

# The value (templated string) is used for log4j2.xml file
# See example at conf/log4j2.xml.template https://kyuubi.readthedocs.io/en/master/configuration/settings.html#logging for more details
log4j2: ~

# $SPARK_CONF_DIR directory
sparkConfDir: /opt/spark/conf
# Spark configuration files
# Configuration files from the list of existing ConfigMaps and Secrets
filesFrom: []
#filesFrom:
#- configMap:
# name: kyuubi-configs
#- secret:
# name: kyuubi-secrets
#- secret:
# name: ssl-secrets
# items:
# - key: key-store
# path: certs/keystore.jks
# - key: trust-store
# path: certs/truststore.jks

# Spark configuration, see https://github.com/apache/spark/tree/master/conf and Spark documentation for more details
sparkConf:
# The value (templated string) is used for spark-env.sh file
# See example at https://github.com/apache/spark/blob/master/conf/spark-env.sh.template and Spark documentation for more details
sparkEnv: ~
# sparkEnv: |
# #!/usr/bin/env bash
# export JAVA_HOME=/usr/jdk64/jdk1.8.0_152
# export SPARK_LOG_DIR=/opt/spark/logs
# export SPARK_LOG_MAX_FILES=5

# The value (templated string) is used for spark-defaults.conf file
# See example at https://github.com/apache/spark/blob/master/conf/spark-defaults.conf.template and Spark documentation for more details
sparkDefaults: ~
# sparkDefaults: |
# $SPARK_CONF_DIR directory
dir: /opt/spark/conf
# Configuration files from the specified keys (file name) and values (file content)
files: ~
#files:
# 'spark-defaults.conf': |
# spark.submit.deployMode=cluster
# spark.kubernetes.container.image=apache/spark:3.5.0
# spark.kubernetes.authenticate.driver.serviceAccountName=spark
Expand All @@ -207,13 +194,20 @@ sparkConf:
# spark.hadoop.fs.s3a.path.style.access=true
# spark.hadoop.fs.s3a.fast.upload=true

# The value (templated string) is used for log4j2.properties file
# See example at https://github.com/apache/spark/blob/master/conf/log4j2.properties.template and Spark documentation for more details
log4j2: ~

# The value (templated string) is used for metrics.properties file
# See example at https://github.com/apache/spark/blob/master/conf/metrics.properties.template and Spark documentation for more details
metrics: ~
# Configuration files from the list of existing ConfigMaps and Secrets
filesFrom: []
#filesFrom:
#- configMap:
# name: spark-configs
#- secret:
# name: spark-secrets
#- secret:
# name: ssl-secrets
# items:
# - key: key-store
# path: certs/keystore.jks
# - key: trust-store
# path: certs/truststore.jks

# Command to launch Kyuubi server (templated)
command: ~
Expand Down
Loading