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

[bitnami/redis] Enables Redis to utilize external-dns #8570

Merged
merged 14 commits into from
Jan 20, 2022

Conversation

jtslear
Copy link
Contributor

@jtslear jtslear commented Jan 4, 2022

Description of the change

  • By way of using external-dns we can assign a DNS entry for each Pod
  • Doing so allows anyone who's got the ability to talk to the IP's for which Redis utilize, external to the cluster, to become members of the Redis cluster
  • This is helpful during Redis migrations where backing up and restoring are destructive, but instead, we can enable both Redis in Kubernetes and Redis on VM's to talk to each other, perform application configuration changes, and turn down the VM's.
    • Theoretically vice versa as well
  • Note that this REQUIRES the person leveraging this option to have external-dns in a working fashion prior to this being usable.

Checklist

  • Chart version bumped in Chart.yaml according to semver.
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [bitnami/<name_of_the_chart>])

Sorry, something went wrong.

@github-actions
Copy link

github-actions bot commented Jan 4, 2022

Great PR! Please pay attention to the following items before merging:

Files matching bitnami/*/values.yaml:

  • Is the PR adding a new container? Please reviewer, add it to the models (internal process)
  • Is the PR adding a new parameter? Please, ensure it’s documented in the README.md

This is an automatically generated QA checklist based on modified files

Sorry, something went wrong.

@jtslear jtslear changed the title Enables Redis to utilize external-dns [bitnami/redis] Enables Redis to utilize external-dns Jan 4, 2022
Copy link
Contributor

@alemorcuq alemorcuq left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @jtslear. I've left some comments, but since I'm not very familiar with the technology, I'd like another colleague to review this as well. I'll ping him on Monday.

{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.externalDNS.enabled }}
external-dns.alpha.kubernetes.io/hostname: {{ printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }}
Copy link
Contributor

Choose a reason for hiding this comment

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

{{ printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }} is used quite a bit on this PR, I think it's worth to add a helper to include it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment on lines 26 to 36
## @param externalDNS Boolean to indicate the desire to utilize `external-dns`
##
externalDNS:
enabled: false
# suffix: ""

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is a good way to name the parameters, as users could assume that this also deploys a installation of the bitnami/external-dns chart.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would agree. I've renamed it to useExternalDNS. Though I'm not thrilled about that name either. Open to further suggestions.

@jtslear
Copy link
Contributor Author

jtslear commented Jan 5, 2022

@alemorcuq I could use some guidance on the test, generate-chart-readme. I've added the values in place, but the job claims I did not and also I added one that does not exist. I'm not sure what I need to do to fix this. I created the values in the README manually, alongside an example configuration to assist persons whom may want to leverage this configuration option.

Comment on lines 12 to 18
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.useExternalDNS.enabled }}
{{ .Values.useExternalDNS.annotationKey }}hostname: {{ include "redis.externalDNS.suffix" . }}
{{- range $key, $val := .Values.useExternalDNS.additionalAnnotations }}
{{ $.Values.useExternalDNS.annotationKey }}{{ $key }}: {{ $val | quote }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.useExternalDNS.enabled }}
{{ .Values.useExternalDNS.annotationKey }}hostname: {{ include "redis.externalDNS.suffix" . }}
{{- range $key, $val := .Values.useExternalDNS.additionalAnnotations }}
{{ $.Values.useExternalDNS.annotationKey }}{{ $key }}: {{ $val | quote }}
{{- end }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.useExternalDNS.enabled }}
{{ .Values.useExternalDNS.annotationKey }}hostname: {{ include "redis.externalDNS.suffix" . }}
{{- range $key, $val := .Values.useExternalDNS.additionalAnnotations }}
{{ $.Values.useExternalDNS.annotationKey }}{{ $key }}: {{ $val | quote }}
{{- end }}

We can notch the indentation of the commonAnnoations render. Ideally, we could do the same for the additionalAnnotations , however, the spaces currently matter within the range loop because of how this is composed within.

What do you think of making this into a single template for all of these annotations, say redis.externalDNS.annotations, and instead simply gating this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@WarheadsSE thanks for the suggestion, I proceeded to do exactly this in ba304f9

@jtslear jtslear requested a review from alemorcuq January 6, 2022 14:46
@alemorcuq
Copy link
Contributor

@alemorcuq I could use some guidance on the test, generate-chart-readme. I've added the values in place, but the job claims I did not and also I added one that does not exist. I'm not sure what I need to do to fix this. I created the values in the README manually, alongside an example configuration to assist persons whom may want to leverage this configuration option.

It is missing the @param metadata in the values.yaml. The README table can be generated from that metadata. More on this tool here: https://github.com/bitnami/charts/blob/master/CONTRIBUTING.md#documentation-requirements

@juan131, could you take a look at this PR?

@jtslear
Copy link
Contributor Author

jtslear commented Jan 10, 2022

@alemorcuq Readme is fixed, thank you much! This is now ready for review.

Copy link
Contributor

@juan131 juan131 left a comment

Choose a reason for hiding this comment

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

Thanks for your PR @jtslear ! Please check my comments when you have a chance.

@jtslear jtslear requested a review from juan131 January 11, 2022 14:41
@jtslear jtslear force-pushed the jts/external-dns branch 2 times, most recently from 0336928 to 3f88ed0 Compare January 13, 2022 13:34
John T Skarbek and others added 12 commits January 13, 2022 09:55

Unverified

No user is associated with the committer email.
* By way of using `external-dns` we can assign a DNS entry for each Pod
* Doing so allows anyone who's got the ability to talk to the IP's for
  which Redis utilize, external to the cluster, to become members of the
  Redis cluster
* This is helpful during Redis migrations where backing up and restoring
  are destructive, but instead we can enable both Redis in kubernetes
  and Redis on VM's to talk to each other, perform application
  configuration changes, and turn down the VM's.
  * Theoretically vice versa as well

Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Co-authored-by: Jason Plum <[email protected]>
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Co-authored-by: Juan Ariza Toledano <[email protected]>
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>
cleahup

Unverified

No user is associated with the committer email.
Signed-off-by: John T Skarbek <[email protected]>
@alemorcuq
Copy link
Contributor

Sorry for the late reply. Let's try to get this merged, I'm rerunning the jobs.

@jtslear
Copy link
Contributor Author

jtslear commented Jan 18, 2022

@alemorcuq I suspect that #8662 is preventing the tests from being successful. The behavior is slightly different, so I'm not 100% confident: Reference log output: https://github.com/bitnami/charts/runs/4842365585?check_suite_focus=true#step:6:1081

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@alemorcuq
Copy link
Contributor

A PR has been merged as a result of the task you mentioned, so let's check again.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants