-
Notifications
You must be signed in to change notification settings - Fork 930
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
[K8S][HELM] Implement new configuration approach #6521
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6521 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 687 687
Lines 42442 42442
Branches 5793 5793
======================================
Misses 42442 42442 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
That sounds amazing. Sorry a little busy these days, will take a detailed look later (hopefully next week) |
Also cc @zwangsheng and @zhaohehuhu who also deploy Kyuubi on K8s using Helm chart. |
671c64a
to
513cb9a
Compare
513cb9a
to
0cfbed9
Compare
0cfbed9
to
14829f3
Compare
Merged to master |
### Why are the changes needed? The PR adds support for Hadoop configuration files to be used by Apache Kyuubi, Apache Spark etc. The PR is continuation of PR #6521 and relates to the issue #6123. ### How was this patch tested? 1. Create `hadoop-configs.yaml` file (ConfigMap with `core-site.xml` and `hive-site.xml` entries): ```yaml apiVersion: v1 kind: ConfigMap metadata: name: hadoop-configs data: 'core-site.xml': | <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hadoop.pr.test</name> <value>configmap</value> </property> </configuration> 'hive-site.xml': | <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hive.pr.test</name> <value>configmap</value> </property> </configuration> ``` 2. Create ConfigMap from `hadoop-configs.yaml` file: ```shell kubectl create -f hadoop-configs.yaml ``` 3. Create custom `values-hadoop.yaml` (overwrites `core-site.xml`): ```yaml image: repository: apache/kyuubi tag: 1.10.0-spark rbac: create: true rules: - apiGroups: [""] resources: ["pods", "configmaps", "services"] verbs: ["create", "list", "delete", "watch", "deletecollection", "get"] hadoopConf: files: 'core-site.xml': | <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hadoop.pr.test</name> <value>values</value> </property> </configuration> 'hdfs-site.xml': | <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hdfs.pr.test</name> <value>values</value> </property> </configuration> filesFrom: - configMap: name: hadoop-configs sparkConf: files: 'spark-defaults.conf': | spark.submit.deployMode=client spark.kubernetes.container.image=apache/spark:3.5.2 spark.kubernetes.authenticate.driver.serviceAccountName=kyuubi ``` 4. Install the chart ```shell helm install kyuubi charts/kyuubi -f values-hadoop.yaml ``` 5. Check there are 3 files in the Hadoop configuration directory: ```shell kubectl exec kyuubi-0 -- ls /opt/hadoop/conf core-site.xml hdfs-site.xml hive-site.xml ``` 6. Check `/opt/hadoop/conf/core-site.xml` has content from ConfigMap: ```shell kubectl exec kyuubi-0 -- cat /opt/hadoop/conf/core-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hadoop.pr.test</name> <value>configmap</value> </property> </configuration> ``` 7. Check `/opt/hadoop/conf/hdfs-site.xml` has content from values: ```shell kubectl exec kyuubi-0 -- cat /opt/hadoop/conf/hdfs-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hdfs.pr.test</name> <value>values</value> </property> </configuration> ``` 8. Check `/opt/hadoop/conf/hive-site.xml` has content from ConfigMap: ```shell kubectl exec kyuubi-0 -- cat /opt/hadoop/conf/hive-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hive.pr.test</name> <value>configmap</value> </property> </configuration> ``` 9. Check configuration values from Spark session: ```shell kubectl exec kyuubi-0 -- ./bin/beeline -u 'jdbc:hive2://kyuubi-thrift-binary:10009' -e 'set hadoop.pr.test;' +-----------------+------------+ | key | value | +-----------------+------------+ | hadoop.pr.test | configmap | +-----------------+------------ kubectl exec kyuubi-0 -- ./bin/beeline -u 'jdbc:hive2://kyuubi-thrift-binary:10009' -e 'set hdfs.pr.test;' +---------------+---------+ | key | value | +---------------+---------+ | hdfs.pr.test | values | +---------------+--------- kubectl exec kyuubi-0 -- ./bin/beeline -u 'jdbc:hive2://kyuubi-thrift-binary:10009' -e 'set hive.pr.test;' +---------------+------------+ | key | value | +---------------+------------+ | hive.pr.test | configmap | +---------------+------------ ``` ### Was this patch authored or co-authored using generative AI tooling? No Closes #6875 from dnskr/helm-add-hadoop-configs-support. Closes #6875 8c8665f [dnskr] [K8S][HELM] Add Hadoop configuration files support Authored-by: dnskr <[email protected]> Signed-off-by: dnskr <[email protected]>
🔍 Description
Issue References 🔗
This pull request changes Helm chart configuration approach as discussed in #6123
Describe Your Solution 🔧
Suggested implementation makes chart configuration more general and more flexible. It allows to configure Kyuubi (and its engines) by setting configuration file contents to chart properties or by providing configuration files through existing ConfigMaps and Secrets. Also users are not limited by predefined number of files and can put any files to configuration directories.
Types of changes 🔖
Test Plan 🧪
1. Test suite "Kyuubi configuration"
Property file
values-kyuubi-files.yaml
ConfigMap
kyuubi-configs
fromconfigmap-kyuubi-configs.yaml
Rendered templates are correct
Configuration files are in place
$ kubectl create -f configmap-kyuubi-configs.yaml $ helm install kyuubi charts/kyuubi -f values-kyuubi-files.yaml $ kubectl exec kyuubi-0 -- ls conf kyuubi-custom.properties kyuubi-env.sh kyuubi-test.properties
2. Test suite "Spark configuration"
Property file
values-spark-files.yaml
ConfigMap
spark-configs
fromconfigmap-spark-configs.yaml
Rendered templates are correct
Configuration files are in place
$ kubectl create -f configmap-spark-configs.yaml $ helm install kyuubi charts/kyuubi -f values-spark-files.yaml $ kubectl exec kyuubi-0 -- ls ../spark/conf spark-custom.properties spark-env.sh spark-test.properties
Property file
values-kyuubi-defaults.yaml
ConfigMap
kyuubi-defaults-config
fromconfigmap-kyuubi-defaults.yaml
Rendered templates are correct
Content of
kyuubi-defaults.conf
comes from ConfigMapChecklist 📝
Be nice. Be informative.