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

Allow additional annotations for standby and active services via config #896

Merged

Conversation

tekicat
Copy link
Contributor

@tekicat tekicat commented May 19, 2023

Revival of #546

Currently there is no ability to annotate services for active and standby services, as they inherit their settings from the main server service configuration. This is a problem, when you need to attach different annotations to the different services. Instead of just allowing for setting of annotations, I opted to allow configuring the services for more flexibility.

Helps to close #674

Partially resolves #588

Thanks @jamesgoodhouse

@tekicat tekicat requested a review from a team May 19, 2023 10:32
@hashicorp-cla
Copy link

hashicorp-cla commented May 19, 2023

CLA assistant check
All committers have signed the CLA.

@tekicat
Copy link
Contributor Author

tekicat commented May 23, 2023

Hey @tomhjp , @tvoran
Would appreciate your inputs, thanks!

@chris-ng-scmp
Copy link

This is a must have feature for Vault HELM chart to set difference annotations for individual services, how long we can see this appoved?

@tekicat tekicat requested a review from a team as a code owner September 25, 2023 16:58
@tekicat tekicat force-pushed the allow_config_for_standby_and_active_services branch from e6527d0 to 663a24e Compare September 25, 2023 17:00
Copy link
Contributor

@kschoche kschoche left a comment

Choose a reason for hiding this comment

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

Hi @tekicat -
Thanks for submitting this, I just got around to reviewing. I think the approach looks good, and is a nice+clean iteration of the original PR.
I left a few suggestions about missing tests, and some general cleanup, and after these get addressed I think we're good to go!
Let me know if you have any questions about any the feedback.
~Kyle

values.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
Comment on lines +713 to +739
{{/*
Sets extra vault server Service (active) annotations
*/}}
{{- define "vault.service.active.annotations" -}}
{{- if .Values.server.service.active.annotations }}
{{- $tp := typeOf .Values.server.service.active.annotations }}
{{- if eq $tp "string" }}
{{- tpl .Values.server.service.active.annotations . | nindent 4 }}
{{- else }}
{{- toYaml .Values.server.service.active.annotations | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}
{{/*
Sets extra vault server Service annotations
*/}}
{{- define "vault.service.standby.annotations" -}}
{{- if .Values.server.service.standby.annotations }}
{{- $tp := typeOf .Values.server.service.standby.annotations }}
{{- if eq $tp "string" }}
{{- tpl .Values.server.service.standby.annotations . | nindent 4 }}
{{- else }}
{{- toYaml .Values.server.service.standby.annotations | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to suggest that we dry this up a bit and make it a single function where we just pass in .Values.server.service.active/standby as the root, but I ran into helm/helm#5979 trying to implement it myself, so I think it's okay as is.

templates/server-ha-active-service.yaml Outdated Show resolved Hide resolved
templates/server-ha-standby-service.yaml Outdated Show resolved Hide resolved
test/unit/server-ha-active-service.bats Show resolved Hide resolved
test/unit/server-ha-standby-service.bats Show resolved Hide resolved
@kschoche kschoche self-assigned this Sep 25, 2023
@kschoche kschoche added enhancement New feature or request chart Area: helm chart labels Sep 25, 2023
Co-authored-by: Kyle Schochenmaier <[email protected]>
@tekicat
Copy link
Contributor Author

tekicat commented Sep 26, 2023

Thanks for the suggestions @kschoche , they looked good and I have applied them. :)

Copy link
Contributor

@kschoche kschoche left a comment

Choose a reason for hiding this comment

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

Thanks so much, this looks great!

@kschoche kschoche merged commit 7728f8c into hashicorp:main Sep 26, 2023
8 checks passed
@kschoche kschoche mentioned this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chart Area: helm chart enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

service annotations applied to both vault and vault-internal services Separate annotations per service
4 participants