From a7bc46015ebc2e42e59ebb06c7a270d8d892ac21 Mon Sep 17 00:00:00 2001 From: takirala Date: Thu, 21 Apr 2022 23:55:53 +0800 Subject: [PATCH] feat: configurable annotations for gitea StatefulSet (#315) Fixes #314 Right now, the gitea StatefulSet does not allow any annotations to be configured via the helmchart - see https://gitea.com/gitea/helm-chart/src/tag/v5.0.4/templates/gitea/statefulset.yaml#L4-L6 My use case: I am trying to use Reloader (https://github.com/stakater/Reloader) so that I can configure my values.yaml such that i can set some annotations on the StatefulSet and thus Reloader can rollout a restart of gitea StatefulSet whenever a watched secret or configmap is updated. Co-authored-by: Tarun Gupta Akirala Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/315 Reviewed-by: techknowlogick Reviewed-by: justusbunsi Co-authored-by: takirala Co-committed-by: takirala --- README.md | 1 + templates/gitea/statefulset.yaml | 4 ++++ values.yaml | 1 + 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index d44881f..9ce59f3 100644 --- a/README.md +++ b/README.md @@ -718,6 +718,7 @@ gitea: | Parameter | Description | Default | | ------------------------------------------- | -------------------------------------------------------------------- | ------- | +| `statefulset.annotations` | Annotations for the Gitea StatefulSet to be created | `{}` | | `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` | | `statefulset.env` | Additional environment variables to pass to containers | `[]` | | `extraVolumes` | Additional volumes to mount to the Gitea statefulset | `{}` | diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index ff6c9e1..8ae7bd6 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -2,6 +2,10 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "gitea.fullname" . }} + annotations: + {{- if .Values.statefulset.annotations }} + {{- toYaml .Values.statefulset.annotations | nindent 4 }} + {{- end }} labels: {{- include "gitea.labels" . | nindent 4 }} spec: diff --git a/values.yaml b/values.yaml index 8bf8799..f2fd36f 100644 --- a/values.yaml +++ b/values.yaml @@ -113,6 +113,7 @@ statefulset: # value: my-value terminationGracePeriodSeconds: 60 labels: {} + annotations: {} persistence: enabled: true