-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat: Add extraVolumes and extraVolumeMounts to all main containers #16361
feat: Add extraVolumes and extraVolumeMounts to all main containers #16361
Conversation
helm/superset/values.yaml
Outdated
@@ -82,6 +82,10 @@ extraConfigs: {} | |||
|
|||
extraSecrets: {} | |||
|
|||
extraVolumes: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an example of each so people know how to use these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -76,5 +80,9 @@ spec: | |||
configMap: | |||
name: {{ template "superset.fullname" . }}-extra-config | |||
{{- end }} | |||
{{- range $volumeName, $volume := .Values.extraVolumes }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just range over all of these and just call toyaml on them directly? That would allow users to customize extra volume options, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting changing this to a list
instead of a map
? The reason I implemented it this way is that my team manages multiple clusters (with one deployment of Superset per cluster). It is useful to have one "base configuration" with common values, which can then be appended to in the more specific values. Making this a list would force us to repeat this part of our configuration in multiple locations, which I was trying to avoid.
Having said that, I'm open to changing it. I'm just trying to better understand your comment:
That would allow users to customize extra volume options, etc.
With the way I implemented it, users are indeed free to specify whatever options they require. I've added a few extra options to the examples I committed in response to your previous comment. The only potential issue I can think of is that the volume names are slightly restricted by what Helm considers a valid key. Everything else will be used as-is by this line (85):
{{- tpl (toYaml $volume) $ | nindent 10 -}}
Am I misunderstanding your comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense. I just think that most folks will run into a spot where they need an extra option for the volume, and will need to add a PR to get the additional config they need shoved in.
Something like this is what I was thinking:
https://github.com/Kong/charts/blob/main/charts/kong/values.yaml#L35
It really allows for the most flexibility possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. So using the example you linked to, that would turn into:
extraVolumes:
volumeName:
emptyDir: {}
extraVolumeMounts:
volumeName:
mountPath: "/opt/user/dir/mount"
The syntax is a little different, but I believe the flexibility is the same, is it not? With the added bonus that additional volumes can be appended without overriding the entire list (as per the use case I laid out in my previous reply).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it would look like:
extraVolumes:
- name: "cool-volume"
emptyDir: {}
extraVolumeMounts:
- name: "cool-volume"
mountPath: "/opt/user/dir/mount"
This allows us to add things like defaultMode
, etc. to the volume definitions. We can also mount from secrets, or configMaps without changing this chart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant was that, if you modify the example in the way I wrote it in my reply, you would get the exact same YAML output as if I made the changes you requested.
My intent was to allow maximum flexibility. As far as I know, this implementation allows 100% of the volumes
and volumeMounts
spec. Could you provide an example of something that isn't supported with this implementation to help me better understand, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use a list rather than a map here. Nested maps are a little tricky to follow in this context. The volumes
and volumeMounts
stanzas in Deployments, etc. use lists, so it makes the transition pretty straight forward for end users to just drop their list into this chart's values override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just pushed this change.
* master: (582 commits) feat: config to customize bootstrap data overrides (apache#16386) fix: regex for multi-region IPs (apache#16410) chore: Changes the DatabaseSelector to use the new Select component (apache#16334) chore: Displays the dataset description in a tooltip in the datasets list (apache#16392) fix(pylint): Fix master (apache#16405) chore(pylint): Enable useless-suppression check (apache#16388) feat: Add extraVolumes and extraVolumeMounts to all main containers (apache#16361) initial commit (apache#16366) fix: big number default date format (apache#16383) initial commit (apache#16380) fix: import dashboard w/o metadata (apache#16360) test: Functional RTL for email report modal II (apache#16148) fix: update table ID in query context on chart import (apache#16374) docs: document FLASK_APP_MUTATOR (apache#16286) feat: Add new dev commands to Makefile (apache#16327) fix: call external metadata endpoint with correct rison object (apache#16369) fix: Fix parsing onSaving reports toast when user hasn't saved chart (apache#16330) fix: columns/index rebuild (apache#16355) chore(viz): bump deckgl plugin to 0.4.11 (apache#16353) fix: Blank space in Change dataset modal without warning message (apache#16324) ... # Conflicts: # superset/app.py # superset/models/dashboard.py # tests/integration_tests/charts/filter_sets/__init__.py # tests/integration_tests/charts/filter_sets/conftest.py # tests/integration_tests/charts/filter_sets/consts.py # tests/integration_tests/charts/filter_sets/create_api_tests.py # tests/integration_tests/charts/filter_sets/delete_api_tests.py # tests/integration_tests/charts/filter_sets/get_api_tests.py # tests/integration_tests/charts/filter_sets/update_api_tests.py # tests/integration_tests/charts/filter_sets/utils.py # tests/integration_tests/superset_test_config.py
SUMMARY
Adds
extraVolumes
andextraVolumeMounts
objects to the Helm chart. Any volumes specified will be mounted to the main containers of all deployments as well as the init-job. Use cases include mounting additional Python modules (so they don't have to be written in-line as a YAML string) and passing in CA certs that are required by our stack.TESTING INSTRUCTIONS
extraVolumes
andextraVolumeMounts
.helm install --dry-run
and confirm that the pod specs contain the new volumesADDITIONAL INFORMATION