Skip to content

Commit b71ab41

Browse files
authored
feat: Refactoring Kubernetes recommended labels (#192)
* feat(helm): add missing labels Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com> * feat(helm): clean labels management Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com> --------- Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
1 parent 3c3f8ed commit b71ab41

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

charts/openfga/templates/_helpers.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ helm.sh/chart: {{ include "openfga.chart" . }}
4747
{{- with .Values.commonLabels }}
4848
{{ . | toYaml }}
4949
{{- end }}
50+
app.kubernetes.io/component: authorization-controller
5051
{{- if .Chart.AppVersion }}
5152
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
5253
{{- end }}
5354
app.kubernetes.io/managed-by: {{ .Release.Service }}
55+
app.kubernetes.io/part-of: openfga
5456
{{- end }}
5557

5658
{{/*

charts/openfga/templates/deployment.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ spec:
2525
prometheus.io/path: /metrics
2626
prometheus.io/port: "{{ (split ":" .Values.telemetry.metrics.addr)._1 }}"
2727
labels:
28-
{{- include "openfga.selectorLabels" . | nindent 8 }}
29-
{{- with .Values.commonLabels }}
30-
{{- toYaml . | nindent 8 }}
31-
{{- end }}
28+
{{- include "openfga.labels" . | nindent 8 }}
3229
{{- with .Values.podExtraLabels }}
3330
{{- toYaml . | nindent 8 }}
3431
{{- end }}

charts/openfga/templates/rbac.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:
55
name: {{ include "openfga.fullname" . }}-job-status-reader
6+
labels:
7+
{{- include "openfga.labels" . | nindent 4 }}
68
rules:
79
- apiGroups:
810
- batch
@@ -16,11 +18,13 @@ apiVersion: rbac.authorization.k8s.io/v1
1618
kind: RoleBinding
1719
metadata:
1820
name: {{ include "openfga.fullname" . }}-job-status-reader
21+
labels:
22+
{{- include "openfga.labels" . | nindent 4 }}
1923
roleRef:
2024
apiGroup: rbac.authorization.k8s.io
2125
kind: Role
2226
name: {{ include "openfga.fullname" . }}-job-status-reader
2327
subjects:
2428
- kind: ServiceAccount
2529
name: {{ include "openfga.serviceAccountName" . }}
26-
{{- end }}
30+
{{- end }}

0 commit comments

Comments
 (0)