Skip to content

Commit

Permalink
Updating templates to remove blank annotations (kedacore#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
emctl authored Jun 29, 2023
1 parent 56b0749 commit 008b720
Show file tree
Hide file tree
Showing 26 changed files with 85 additions and 23 deletions.
4 changes: 3 additions & 1 deletion keda/templates/cert-manager/keda-issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ .Values.operator.name }}-issuer
namespace: {{ .Release.Namespace }}
spec:
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/cert-manager/self-issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ .Values.operator.name }}-selfsigned-issuer
namespace: {{ .Release.Namespace }}
spec:
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
6 changes: 5 additions & 1 deletion keda/templates/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: Deployment
metadata:
name: {{ .Values.operator.name }}
namespace: {{ .Release.Namespace }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app: {{ .Values.operator.name }}
name: {{ .Values.operator.name }}
Expand Down Expand Up @@ -35,13 +37,15 @@ spec:
{{- if .Values.podIdentity.azureWorkload.enabled }}
azure.workload.identity/use: "true"
{{- end }}
{{- if or .Values.podAnnotations.keda .Values.additionalAnnotations }}
annotations:
{{- if .Values.podAnnotations.keda }}
{{- toYaml .Values.podAnnotations.keda | nindent 8 }}
{{- end }}
{{- if .Values.additionalAnnotations }}
{{- toYaml .Values.additionalAnnotations | nindent 8 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ kind: PodDisruptionBudget
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Values.operator.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.serviceAccount.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.operator.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ .Values.operator.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions keda/templates/manager/service.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v1
kind: Service
metadata:
{{- if or .Values.additionalAnnotations .Values.service.annotations (and .Values.prometheus.operator.enabled ( not (or .Values.prometheus.operator.podMonitor.enabled .Values.prometheus.operator.serviceMonitor.enabled ))) }}
annotations:
{{- if and .Values.prometheus.operator.enabled ( not (or .Values.prometheus.operator.podMonitor.enabled .Values.prometheus.operator.serviceMonitor.enabled )) }}
prometheus.io/scrape: "true"
Expand All @@ -17,6 +18,7 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/manager/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.operator.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions keda/templates/metrics-server/apiservice.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
{{- if or .Values.certificates.certManager.enabled .Values.additionalAnnotations }}
annotations:
{{- if .Values.certificates.certManager.enabled }}
{{- if .Values.certificates.certManager.generateCA }}
Expand All @@ -12,6 +13,7 @@ metadata:
{{- if .Values.additionalAnnotations }}
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: v1beta1.external.metrics.k8s.io
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/metrics-server/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}-external-metrics-reader
{{- include "keda.labels" . | indent 4 }}
Expand Down
12 changes: 9 additions & 3 deletions keda/templates/metrics-server/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}-system-auth-delegator
{{- include "keda.labels" . | indent 4 }}
Expand All @@ -20,8 +22,10 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}-auth-reader
{{- include "keda.labels" . | indent 4 }}
Expand All @@ -39,8 +43,10 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}-hpa-controller-external-metrics
{{- include "keda.labels" . | indent 4 }}
Expand Down
6 changes: 5 additions & 1 deletion keda/templates/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: Deployment
metadata:
name: {{ .Values.operator.name }}-metrics-apiserver
namespace: {{ .Release.Namespace }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app: {{ .Values.operator.name }}-metrics-apiserver
app.kubernetes.io/name: {{ .Values.operator.name }}-metrics-apiserver
Expand Down Expand Up @@ -33,6 +35,7 @@ spec:
{{- if .Values.podIdentity.azureWorkload.enabled }}
azure.workload.identity/use: "true"
{{- end }}
{{- if or .Values.additionalAnnotations .Values.podAnnotations.metricsAdapter (and .Values.prometheus.metricServer.enabled ( not (or .Values.prometheus.metricServer.podMonitor.enabled .Values.prometheus.metricServer.serviceMonitor.enabled )) )}}
annotations:
{{- if .Values.additionalAnnotations }}
{{- toYaml .Values.additionalAnnotations | nindent 8 }}
Expand All @@ -45,6 +48,7 @@ spec:
{{- if .Values.podAnnotations.metricsAdapter }}
{{- toYaml .Values.podAnnotations.metricsAdapter | nindent 8}}
{{- end }}
{{- end }}
spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/metrics-server/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ kind: PodDisruptionBudget
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Values.operator.name }}-metrics-apiserver
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}-metrics-apiserver
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/metrics-server/podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.operator.name }}-metrics-apiserver
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions keda/templates/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
{{- include "keda.labels" . | indent 4 }}
name: {{ .Values.operator.name }}-metrics-apiserver
namespace: {{ .Release.Namespace }}
{{- if or .Values.additionalAnnotations .Values.service.annotations (and .Values.prometheus.metricServer.enabled ( not (or .Values.prometheus.metricServer.podMonitor.enabled .Values.prometheus.metricServer.serviceMonitor.enabled )))}}
annotations:
{{- if and .Values.prometheus.metricServer.enabled ( not (or .Values.prometheus.metricServer.podMonitor.enabled .Values.prometheus.metricServer.serviceMonitor.enabled )) }}
prometheus.io/scrape: "true"
Expand All @@ -23,6 +24,7 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
ports:
- name: https
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/metrics-server/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.operator.name }}-metrics-apiserver
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
6 changes: 5 additions & 1 deletion keda/templates/webhooks/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ kind: Deployment
metadata:
name: {{ .Values.webhooks.name }}
namespace: {{ .Release.Namespace }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app: {{ .Values.webhooks.name }}
name: {{ .Values.webhooks.name }}
Expand All @@ -30,13 +32,15 @@ spec:
{{- if .Values.podLabels.webhooks }}
{{- toYaml .Values.podLabels.webhooks | nindent 8 }}
{{- end }}
{{- if or .Values.podAnnotations.webhooks .Values.additionalAnnotations }}
annotations:
{{- if .Values.podAnnotations.webhooks }}
{{- toYaml .Values.podAnnotations.webhooks | nindent 8 }}
{{- end }}
{{- if .Values.additionalAnnotations }}
{{- toYaml .Values.additionalAnnotations | nindent 8 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/webhooks/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ kind: PodDisruptionBudget
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Values.webhooks.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.serviceAccount.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/webhooks/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ .Values.webhooks.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.webhooks.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions keda/templates/webhooks/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
apiVersion: v1
kind: Service
metadata:
{{- if or .Values.prometheus.webhooks.enabled .Values.additionalAnnotations .Values.service.annotations }}
annotations:
{{- if and .Values.prometheus.webhooks.enabled ( not .Values.prometheus.webhooks.serviceMonitor.enabled ) }}
prometheus.io/scrape: "true"
Expand All @@ -18,6 +19,7 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.webhooks.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
4 changes: 3 additions & 1 deletion keda/templates/webhooks/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.webhooks.name }}
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml .Values.additionalAnnotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.webhooks.name }}
{{- include "keda.labels" . | indent 4 }}
Expand Down
Loading

0 comments on commit 008b720

Please sign in to comment.