Skip to content

Commit

Permalink
fix: missing common annotations in the helm chart (#1471)
Browse files Browse the repository at this point in the history
**Description of the change**

Add common annotations to all resources in the helm chart as per the
[documentation](https://github.com/bitnami-labs/sealed-secrets/blob/main/helm/sealed-secrets/values.yaml#L19):
`## @param commonAnnotations [object] Annotations to add to all deployed
resources`

**Benefits**

Add common annotations to all resources in the helm chart as per the
documentation

**Applicable issues**

- fixes #1372

Signed-off-by: cyrgim <migeon.work@gmail.com>
  • Loading branch information
cyrgim committed Mar 4, 2024
1 parent e5a59d5 commit 0acfe03
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 11 deletions.
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/cluster-role-binding.yaml
Expand Up @@ -10,6 +10,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/cluster-role.yaml
Expand Up @@ -10,6 +10,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
rules:
- apiGroups:
- bitnami.com
Expand Down
3 changes: 3 additions & 0 deletions helm/sealed-secrets/templates/configmap-dashboards.yaml
Expand Up @@ -18,6 +18,9 @@ metadata:
{{- if $.Values.metrics.dashboards.annotations }}
{{- include "sealed-secrets.render" ( dict "value" $.Values.metrics.dashboards.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if $.Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
{{ base $path }}: |-
{{ $.Files.Get $path | indent 4 }}
Expand Down
7 changes: 4 additions & 3 deletions helm/sealed-secrets/templates/deployment.yaml
Expand Up @@ -8,9 +8,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- toYaml .Values.commonAnnotations | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: 1
{{- if .Values.revisionHistoryLimit }}
Expand Down
5 changes: 3 additions & 2 deletions helm/sealed-secrets/templates/ingress.yaml
Expand Up @@ -8,12 +8,13 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.ingress.annotations }}
annotations:
{{- if .Values.ingress.annotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.ingressClassName (eq "true" (include "sealed-secrets.supportsIngressClassname" .)) }}
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
Expand Down
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/networkpolicy.yaml
Expand Up @@ -8,6 +8,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
podSelector:
matchLabels: {{- include "sealed-secrets.matchLabels" . | nindent 6 }}
Expand Down
7 changes: 4 additions & 3 deletions helm/sealed-secrets/templates/pdb.yaml
Expand Up @@ -8,9 +8,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- toYaml .Values.commonAnnotations | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if regexMatch "64$" (typeOf .Values.pdb.minAvailable) }}
minAvailable: {{ .Values.pdb.minAvailable }}
Expand Down
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/psp-clusterrole.yaml
Expand Up @@ -10,6 +10,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
Expand Down
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/psp-clusterrolebinding.yaml
Expand Up @@ -10,6 +10,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/psp.yaml
Expand Up @@ -7,6 +7,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
privileged: false
allowPrivilegeEscalation: false
Expand Down
12 changes: 12 additions & 0 deletions helm/sealed-secrets/templates/role-binding.yaml
Expand Up @@ -11,6 +11,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand All @@ -35,6 +39,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand All @@ -54,6 +62,10 @@ metadata:
{{- if $.Values.rbac.labels }}
{{- include "sealed-secrets.render" ( dict "value" $.Values.rbac.labels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
4 changes: 4 additions & 0 deletions helm/sealed-secrets/templates/role.yaml
Expand Up @@ -11,6 +11,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
rules:
- apiGroups:
- ""
Expand Down
10 changes: 7 additions & 3 deletions helm/sealed-secrets/templates/servicemonitor.yaml
Expand Up @@ -15,9 +15,13 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.annotations }}
annotations: {{- include "sealed-secrets.render" (dict "value" .Values.metrics.serviceMonitor.annotations "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.metrics.serviceMonitor.annotations }}
{{- include "sealed-secrets.render" (dict "value" .Values.metrics.serviceMonitor.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: metrics
Expand Down
8 changes: 8 additions & 0 deletions helm/sealed-secrets/templates/tls-secret.yaml
Expand Up @@ -10,6 +10,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ .certificate | b64enc }}
Expand All @@ -29,6 +33,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "sealed-secrets.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "sealed-secrets.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ $cert.Cert | b64enc | quote }}
Expand Down

0 comments on commit 0acfe03

Please sign in to comment.