Skip to content

Commit

Permalink
Merge pull request #254 from nlamirault/feat/labels
Browse files Browse the repository at this point in the history
feat(helm): refactoring Kubernetes labels
  • Loading branch information
barney-s authored Feb 5, 2025
2 parents 3f9a39c + be82697 commit a77a812
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ helm.sh/chart: {{ include "kro.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: controller
app.kubernetes.io/part-of: kro
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end }}

{{/*
Expand Down
5 changes: 2 additions & 3 deletions helm/templates/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ kind: ClusterRoleBinding
metadata:
name: {{ include "kro.fullname" . }}-role-binding
labels:
app: kro
release: {{ .Release.Name }}
{{- include "kro.labels" . | nindent 4 }}
roleRef:
kind: ClusterRole
apiGroup: rbac.authorization.k8s.io
name: {{ include "kro.fullname" . }}-cluster-role
subjects:
- kind: ServiceAccount
name: {{ include "kro.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ .Release.Namespace }}
4 changes: 3 additions & 1 deletion helm/templates/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kro.fullname" . }}-cluster-role
labels:
{{- include "kro.labels" . | nindent 4 }}
rules:
- apiGroups:
- "*"
resources:
- "*"
verbs:
- '*'
- '*'
2 changes: 1 addition & 1 deletion helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "kro.selectorLabels" . | nindent 8 }}
{{- include "kro.labels" . | nindent 8 }}
{{- with .Values.deployment.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ nameOverride: ""
# Override the full name of the chart
fullnameOverride: ""

# Additional labels that should be applied to all resources
additionalLabels: {}
# app: kro

image:
# The location of the container image repository
repository: ghcr.io/kro-run/kro/controller
Expand Down

0 comments on commit a77a812

Please sign in to comment.