Skip to content

Add annotations to pods#183

Open
emagiz wants to merge 2 commits intoportainer:masterfrom
emagiz:feat/allow-setting-pod-annotations
Open

Add annotations to pods#183
emagiz wants to merge 2 commits intoportainer:masterfrom
emagiz:feat/allow-setting-pod-annotations

Conversation

@emagiz
Copy link
Copy Markdown
Contributor

@emagiz emagiz commented Jul 16, 2025

This PR add a value to the values file which allows setting pod annotations. This is enables the usage of a fundamental object in the k8s spec

@OmarGadd
Copy link
Copy Markdown
Contributor

This PR fixes #184

@OmarGadd
Copy link
Copy Markdown
Contributor

@samdulam Is there anyone who can review this?

{{- include "portainer.selectorLabels" . | nindent 8 }}
annotations:
{{- if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations | nindent 8 }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
{{- toYaml .Values.podAnnotations | nindent 8 }}
{{- tpl (toYaml .Values.podAnnotations) . | nindent 8 }}

This allow dynamic values in podAnnotations. Use case example https://stackoverflow.com/questions/69371607/helm-add-checksum-annotation-from-values

This approach is used in many popular charts, e.g.

@emagiz

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.

3 participants