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

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

Open
jaolwi opened this issue Mar 25, 2024 · 2 comments
Open

Comments

@jaolwi
Copy link

jaolwi commented Mar 25, 2024

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
Copy link
Author

jaolwi commented Mar 25, 2024

Partly already addressed by this issue #25

@lindhe
Copy link
Contributor

lindhe commented Mar 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants