How to load a file to a specific path in a Container with ConfigMap?

2/17/2020

I'm using the Helm chart to deploy Spark to Kubernetes in GCE. I want to provide a custom spark-defaults.conf file in a ConfigMap to be deployed to spark-master path /opt/bitnami/spark/conf.

But I don't understand how can I make another file custom-keys.yaml to be deployed to the same path that is referenced from the spark-defaults.conf? The documentation only describes how to override default spark configuration. What is the correct way to load extra files and jars in this case?

I've specified a ConfigMap for spark-master in the values.yaml:

master:
  ## Set a custom configuration by using an existing configMap with the configuration file.
  ##
   configurationConfigMap: master-config

master-config.yaml

kind: ConfigMap
metadata:
  name: master-config
data:
  {{ (.Files.Glob "files/spark-defaults.conf").AsConfig | indent 2 }}
-- samba
apache-spark
google-cloud-platform
kubernetes
kubernetes-helm

1 Answer

2/17/2020

The ConfigMap name can be provided on deployment time.

helm install <Name> bitnami/spark --set master.configurationConfigMap=master-config
-- Subramanian Manickam
Source: StackOverflow