From 0f1e991889c891dcd199b025e924ce8b00c0f577 Mon Sep 17 00:00:00 2001 From: Nakrez Date: Wed, 17 Mar 2021 08:07:42 +0800 Subject: [PATCH] Add possibiliy to define statefulset labels (#130) This change adds a new value *statefulset.labels* to allow the user to add custom labels to the StatefulSet. An example of where this could be useful is if gitea's pvc is stored on OpenEBS. With this new option, the user can add the extra *openebs.io/sts-target-affinity* label to specify that the volume target pod should run on the same node as gitea's StatefulSet. Co-authored-by: Baptiste Covolato Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/130 Reviewed-by: luhahn Reviewed-by: lafriks Co-authored-by: Nakrez Co-committed-by: Nakrez --- templates/gitea/statefulset.yaml | 6 ++++++ values.yaml | 1 + 2 files changed, 7 insertions(+) diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index c199ea8..4e19c9b 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -9,6 +9,9 @@ spec: selector: matchLabels: {{- include "gitea.selectorLabels" . | nindent 6 }} + {{- if .Values.statefulset.labels }} + {{- toYaml .Values.statefulset.labels | nindent 6 }} + {{- end }} serviceName: {{ include "gitea.fullname" . }} template: metadata: @@ -21,6 +24,9 @@ spec: {{- end }} labels: {{- include "gitea.labels" . | nindent 8 }} + {{- if .Values.statefulset.labels }} + {{- toYaml .Values.statefulset.labels | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/values.yaml b/values.yaml index 1475521..0dd4d0c 100644 --- a/values.yaml +++ b/values.yaml @@ -69,6 +69,7 @@ statefulset: # - name: VARIABLE # value: my-value terminationGracePeriodSeconds: 60 + labels: {} persistence: enabled: true