Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Uniformize label options #280

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions deploy/charts/istio-csr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,5 +426,12 @@ tolerations:
> ```yaml
> {}
> ```
#### **commonLabels** ~ `object`
> Default value:
> ```yaml
> {}
> ```

Labels to apply to all resources

<!-- /AUTO-GENERATED -->
3 changes: 3 additions & 0 deletions deploy/charts/istio-csr/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.commonLabels }}
{{ toYaml .Values.commonLabels }}
{{- end }}
{{- end -}}

{{/*
Expand Down
2 changes: 2 additions & 0 deletions deploy/charts/istio-csr/templates/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: Certificate
metadata:
name: istiod
namespace: {{ .Values.app.istio.namespace }}
labels:
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
{{- if .Values.app.certmanager.additionalAnnotations }}
annotations:
{{- range $annotation := .Values.app.certmanager.additionalAnnotations }}
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
name: {{ include "cert-manager-istio-csr.name" . }}
rules:
- apiGroups:
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
name: {{ include "cert-manager-istio-csr.name" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
3 changes: 2 additions & 1 deletion deploy/charts/istio-csr/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: {{ include "cert-manager-istio-csr.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -14,6 +14,7 @@ spec:
metadata:
labels:
app: {{ include "cert-manager-istio-csr.name" . }}
{{- include "cert-manager-istio-csr.labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/metrics-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
app: {{ include "cert-manager-istio-csr.name" . }}-metrics
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
spec:
type: {{ .Values.app.metrics.service.type }}
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
app: {{ include "cert-manager-istio-csr.name" . }}
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
prometheus: {{ .Values.app.metrics.service.servicemonitor.prometheusInstance }}
{{- if .Values.app.metrics.service.servicemonitor.labels }}
{{ toYaml .Values.app.metrics.service.servicemonitor.labels | indent 4}}
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
name: {{ include "cert-manager-istio-csr.name" . }}
namespace: {{ .Values.app.certmanager.namespace }}
rules:
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/role_leases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
name: {{ include "cert-manager-istio-csr.name" . }}-leases
namespace: {{ .Values.app.controller.leaderElectionNamespace }}
rules:
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: {{ include "cert-manager-istio-csr.name" . }}
namespace: {{ .Values.app.certmanager.namespace }}
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/rolebinding_leases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: {{ include "cert-manager-istio-csr.name" . }}-leases
namespace: {{ .Values.app.controller.leaderElectionNamespace }}
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
app: {{ include "cert-manager-istio-csr.name" . }}
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/istio-csr/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ imagePullSecrets:
{{- end }}
metadata:
labels:
{{ include "cert-manager-istio-csr.labels" . | indent 4 }}
{{- include "cert-manager-istio-csr.labels" . | nindent 4 }}
name: {{ include "cert-manager-istio-csr.name" . }}
namespace: {{ .Release.Namespace }}
8 changes: 8 additions & 0 deletions deploy/charts/istio-csr/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"app": {
"$ref": "#/$defs/helm-values.app"
},
"commonLabels": {
"$ref": "#/$defs/helm-values.commonLabels"
},
"image": {
"$ref": "#/$defs/helm-values.image"
},
Expand Down Expand Up @@ -444,6 +447,11 @@
"description": "The Istio cluster's trust domain.",
"type": "string"
},
"helm-values.commonLabels": {
"default": {},
"description": "Labels to apply to all resources",
"type": "object"
},
"helm-values.image": {
"additionalProperties": false,
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions deploy/charts/istio-csr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,6 @@ affinity: {}
tolerations: []

nodeSelector: {}

# Labels to apply to all resources
commonLabels: {}