diff --git a/templates/helm/templates/_controller-role-kind-patch.yaml.tpl b/templates/helm/templates/_controller-role-kind-patch.yaml.tpl index 29f3c6bd..39e5bf02 100644 --- a/templates/helm/templates/_controller-role-kind-patch.yaml.tpl +++ b/templates/helm/templates/_controller-role-kind-patch.yaml.tpl @@ -4,10 +4,18 @@ kind: ClusterRole metadata: creationTimestamp: null name: ack-{{ .ServicePackageName }}-controller + labels: + {{ "{{- range $key, $value := .Values.role.labels }}" }} + {{ "{{ $key }}: {{ $value | quote }}" }} + {{ "{{- end }}" }} {{ "{{ else }}" }} kind: Role metadata: creationTimestamp: null name: ack-{{ .ServicePackageName }}-controller + labels: + {{ "{{- range $key, $value := .Values.role.labels }}" }} + {{ "{{ $key }}: {{ $value | quote }}" }} + {{ "{{- end }}" }} namespace: {{ "{{ .Release.Namespace }}" }} {{ "{{ end }}" }} diff --git a/templates/helm/values.schema.json b/templates/helm/values.schema.json index 2d3555a6..86a7580f 100644 --- a/templates/helm/values.schema.json +++ b/templates/helm/values.schema.json @@ -65,6 +65,14 @@ ], "type": "object" }, + "role": { + "description": "Role settings", + "properties": { + "labels": { + "type": "object" + } + } + }, "metrics": { "description": "Metrics settings", "properties": { diff --git a/templates/helm/values.yaml.tpl b/templates/helm/values.yaml.tpl index ad7be8cc..9d6a65b8 100644 --- a/templates/helm/values.yaml.tpl +++ b/templates/helm/values.yaml.tpl @@ -28,6 +28,10 @@ deployment: # Which priorityClassName to set? # See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority priorityClassName: "" + +# If "installScope: cluster" then these labels will be applied to ClusterRole +role: + labels: {} metrics: service: