Skip to content

helm-chart: Add annotations on webapp service #12981

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

Merged
merged 5 commits into from
May 30, 2022

Conversation

thomas-vl
Copy link
Contributor

What

Added the possibility of creating annotations on the service in the helm chart.

How

Updated the helm chart to allow service annotations.

🚨 User Impact 🚨

There are no breaking changes you can still deploy without using annotations.

@CLAassistant
Copy link

CLAassistant commented May 18, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/platform issues related to the platform kubernetes labels May 18, 2022
@martimors
Copy link
Contributor

Suggest using the automated readme generator for documenting your new value instead, see ci.sh

@alafanechere alafanechere self-assigned this May 20, 2022
@alafanechere alafanechere changed the title Added annotations on the service helm-chart: Add annotations on the service May 23, 2022
@alafanechere alafanechere changed the title helm-chart: Add annotations on the service helm-chart: Add annotations on webapp service May 23, 2022
Comment on lines 6 to 9
{{- if .Values.webapp.service.annotations }}
annotations:
{{- include "common.tplvalues.render" (dict "value" .Values.webapp.service.annotations "context" $) | nindent 4 }}
{{- 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
{{- if .Values.webapp.service.annotations }}
annotations:
{{- include "common.tplvalues.render" (dict "value" .Values.webapp.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- with .Values.webapp.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}

Does something prevents you from following the same syntax as used in ingress.yaml to create indentations? I'd prefer both file to use the same syntax for consistency.

@alafanechere
Copy link
Contributor

Thank you @thomas-vl for this contribution. Could you please share why you need annotations on your web app service?

@alafanechere
Copy link
Contributor

Suggest using the automated readme generator for documenting your new value instead, see ci.sh

Thank you for the suggestion @dingobar , I run ./ci.sh update-docs on this branch (after installing readme-generator) but it's failing with the following error:

ERROR: Missing metadata for key: webapp.service.annotations.toto
/opt/homebrew/lib/node_modules/readme-generator-for-helm/lib/checker.js:92
    throw new Error('ERROR: Wrong metadata!');
    ^

Error: ERROR: Wrong metadata!
    at checkKeys (/opt/homebrew/lib/node_modules/readme-generator-for-helm/lib/checker.js:92:11)
    at getValuesSections (/opt/homebrew/lib/node_modules/readme-generator-for-helm/index.js:23:3)
    at runReadmeGenerator (/opt/homebrew/lib/node_modules/readme-generator-for-helm/index.js:45:20)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/readme-generator-for-helm/bin/index.js:21:1)

Do you know how to fix this? It looks related to how the annotations value was defined in values.yaml.

@alafanechere
Copy link
Contributor

@thomas-vl are you ready to make the changes @dingobar and I suggested?

@alafanechere
Copy link
Contributor

FYI I'll be off until next Monday, please bear with me if there's a delay reviewing your upcoming changes.

@thomas-vl
Copy link
Contributor Author

Thank you @thomas-vl for this contribution. Could you please share why you need annotations on your web app service?

I run Airbyte on GKE and I need to annotate the service with the correct NEG so that the HTTPS Loadbalancer knows what endpoint to use.
I'm also very limited on time, I'll make the changes this week.

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

@thomas-vl I made the changes suggested by @dingobar and used the same jinja syntax as in ingress.yaml to render annotations from values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform community kubernetes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants