inveniosoftware / helm-invenio

Helm charts for deploying an Invenio instance
https://helm-invenio.readthedocs.io
7 stars 20 forks source link

Default and unique label sets that comply with the k8s specifications #114

Open jaolwi opened 7 months ago

jaolwi commented 7 months ago

All invenio k8s resources (deployment, service, etc) should have a unique label set for common and selector labels which can be assigned to a helm release and matches the k8s conventions.

https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/

Possible solution:

These label sets are also generated by helm create... by default:

{{/*
Common labels
*/}}
{{- define "invenio.labels" -}}
helm.sh/chart: {{ include "invenio.chart" . }}
{{ include "invenio.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "invenio.selectorLabels" -}}
app.kubernetes.io/name: {{ include "invenio.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
jaolwi commented 7 months ago

Partly already addressed by this issue #25

lindhe commented 7 months ago

Good suggestion! Helm has some additional labels that we may also want to consider using: https://helm.sh/docs/chart_best_practices/labels/#standard-labels