Skip to content

Commit

Permalink
[K8S][HELM] Add Hadoop configuration files support
Browse files Browse the repository at this point in the history
  • Loading branch information
dnskr committed Dec 28, 2024
1 parent a051253 commit 8c8665f
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
27 changes: 27 additions & 0 deletions charts/kyuubi/templates/kyuubi-hadoop-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-hadoop
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
data:
{{- with .Values.hadoopConf.files }}
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/kyuubi/templates/kyuubi-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
{{- include "kyuubi.selectorLabels" . | nindent 8 }}
annotations:
checksum/conf: {{ include (print $.Template.BasePath "/kyuubi-configmap.yaml") . | sha256sum }}
checksum/conf-hadoop: {{ include (print $.Template.BasePath "/kyuubi-hadoop-configmap.yaml") . | sha256sum }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets: {{- toYaml . | nindent 8 }}
Expand Down Expand Up @@ -79,6 +80,8 @@ spec:
env:
- name: KYUUBI_CONF_DIR
value: {{ .Values.kyuubiConf.dir }}
- name: HADOOP_CONF_DIR
value: {{ .Values.hadoopConf.dir }}
- name: SPARK_CONF_DIR
value: {{ .Values.sparkConf.dir }}
{{- with .Values.env }}
Expand Down Expand Up @@ -124,6 +127,8 @@ spec:
volumeMounts:
- name: conf
mountPath: {{ .Values.kyuubiConf.dir }}
- name: conf-hadoop
mountPath: {{ .Values.hadoopConf.dir }}
- name: conf-spark
mountPath: {{ .Values.sparkConf.dir }}
{{- with .Values.volumeMounts }}
Expand All @@ -141,6 +146,14 @@ spec:
{{- with .Values.kyuubiConf.filesFrom }}
{{- tpl (toYaml .) $ | nindent 14 }}
{{- end }}
- name: conf-hadoop
projected:
sources:
- configMap:
name: {{ .Release.Name }}-hadoop
{{- with .Values.hadoopConf.filesFrom }}
{{- tpl (toYaml .) $ | nindent 14 }}
{{- end }}
- name: conf-spark
projected:
sources:
Expand Down
32 changes: 32 additions & 0 deletions charts/kyuubi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,38 @@ kyuubiConf:
# - key: trust-store
# path: certs/truststore.jks

# Hadoop configuration files
hadoopConf:
# $HADOOP_CONF_DIR directory
dir: /opt/hadoop/conf
# Configuration files from the specified keys (file name) and values (file content)
files: ~
#files:
# 'core-site.xml': |
# <?xml version="1.0"?>
# <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
# <configuration>
# <property>
# <name>hadoop.tmp.dir</name>
# <value>/tmp/hadoop-${user.name}</value>
# </property>
# </configuration>

# Configuration files from the list of existing ConfigMaps and Secrets
filesFrom: []
#filesFrom:
#- configMap:
# name: hadoop-configs
#- secret:
# name: hadoop-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:
# $SPARK_CONF_DIR directory
Expand Down

0 comments on commit 8c8665f

Please sign in to comment.