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

helm: Add customizable global and per-container env vars to helm chart #13796

Closed
wants to merge 7 commits into from

Conversation

jwitko
Copy link
Contributor

@jwitko jwitko commented Feb 13, 2023

Description

This PR adds customizable global and per-container environment variable appended array objects.

There already exists the ability to add basic key/value configurable variables via the global configVars and per-container config maps however the format they are implemented in does not support the broader Kubernetes environment variable use cases.

For example if a person wanted to pass in druid_metadata_storage_connector_password via an existing Kubernetes secret this would not be possible in the existing config.

This PR would allow for pulling of environment variables from secrets, configmaps, and any other K8s supported environment variable configuration on a global and per-container basis.

It should also be noted that the Chart.yaml version is bumped to 0.3.6 from 0.3.3 because #13747 and #13783 came first.

Release note

Add customizable global and per-container env vars to helm chart


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@a2l007 a2l007 added the Helm Chart https://github.com/apache/druid/tree/master/helm/druid label Feb 14, 2023
@churromorales
Copy link
Contributor

to understand, this allow for more than just name, value envVars, so you can do ValueFrom and grab things from secrets, or other places?

@jwitko
Copy link
Contributor Author

jwitko commented Feb 14, 2023

to understand, this allow for more than just name, value envVars, so you can do ValueFrom and grab things from secrets, or other places?

Yes correct. It also allows you to direct the key/values inside configmaps/secrets to be populated into an envVar of your choice. In my example in this PR I'm taking the dynamically generated postgresDB secret which is created by a postgresDB operator and pushing it into the Druid accepted envVar for DB passwords.

Copy link
Contributor

@georgew5656 georgew5656 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a couple small comments, otherwise this looks good to me

{{- range $key, $val := .Values.broker.config }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end}}
{{- end }}
{{- with .Values.broker.env }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no other thing referencing environment variables I didn't see a need to get more complicated than env but if its what is needed to get this merged then sure, I'm not married to the name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just prefer it this way to make it clear we aren't overwriting the entire environment variables section with the extra env variable, just appending

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I can see what you're saying. I'll make the change

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jwitko could you make a commit for this? I agree with @georgew5656.

@@ -73,7 +73,7 @@ spec:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: "{{ template "druid.name" . }}"
app: {{ template "druid.name" . | quote }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason this field has to use the quote function instead of just quoting the value? it seems like most of the other fields in this chart use quotes, e.g.
"{{ .Release.Name }}" instead of {{ .Release.Name | quote }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quote can take a list and quote all the values but that almost certainly would never come into play here. I personally just think its cleaner.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me

@imcheck
Copy link

imcheck commented Aug 21, 2023

When could this pr be merged ? @jwitko @georgew5656
I made an issue related this (#14867) and this pr will be resolved it.

@jwitko
Copy link
Contributor Author

jwitko commented Aug 21, 2023

@imcheck This PR has been ready to merge (from my perspective) since March.

@imcheck
Copy link

imcheck commented Aug 22, 2023

Who do i have to mention for merging this pr quickly? 😢

Copy link

github-actions bot commented Feb 6, 2024

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the [email protected] list.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 6, 2024
@lens0021
Copy link

lens0021 commented Feb 6, 2024

Any updates?

@jwitko
Copy link
Contributor Author

jwitko commented Feb 6, 2024

Any updates?

No unfortunately not. I've pinged in slack but I cannot get a response. The project seems to not be interested in these PRs.

@github-actions github-actions bot removed the stale label Feb 7, 2024
@asdf2014
Copy link
Member

@jwitko Thanks for your contribution. As mentioned in PR #15904, we have migrated the Helm Chart to a new repository, you are welcome to raise up new PR there and we can maintain the Druid Helm Chart together in new repository. And this PR will closed soon. Thank you again for your understanding and collaboration.

Copy link

This pull request has been marked as stale due to 60 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If you think
that's incorrect or this pull request should instead be reviewed, please simply
write any comment. Even if closed, you can still revive the PR at any time or
discuss it on the [email protected] list.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 22, 2024
@jwitko jwitko closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Helm Chart https://github.com/apache/druid/tree/master/helm/druid stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants