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

Enable custom pod labels for helm chart #326

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/k6-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.0.11"
description: A Helm chart to install the k6-operator
name: k6-operator
version: 1.2.0
version: 2.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think it should be a breaking change? This seems like a "pure" addition: old deployments should continue to work as is. I.e. why not 1.3.0?

FYI, I'll need to test it a bit and probably return to this PR ~ tomorrow.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing your experience with versioning of other Helm charts. The chart in k6-operator was added very recently and we're figuring out the "right way" still 😅
Let's go with major bump this time indeed 👍

kubeVersion: ">=1.16.0-0"
home: https://k6.io
sources:
Expand Down
4 changes: 4 additions & 0 deletions charts/k6-operator/samples/customAnnotationsAndLabels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ customAnnotations:
customLabels:
"customized-labels": "k6-operator"

podLabels:
environment: production
owner: development

certManager:
enabled: true

Expand Down
8 changes: 8 additions & 0 deletions charts/k6-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ Create the name of the service account to use
{{- end }}
{{- end -}}

{{- define "k6-operator.podLabels" -}}
{{- if .Values.podLabels }}
{{- with .Values.podLabels }}
{{- toYaml . }}
{{- end }}
{{- end }}
{{- end -}}

{{- define "k6-operator.customAnnotations" -}}
{{- if .Values.customAnnotations }}
{{- with .Values.customAnnotations }}
Expand Down
1 change: 1 addition & 0 deletions charts/k6-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
metadata:
labels:
{{- include "k6-operator.selectorLabels" . | nindent 8 }}
{{- include "k6-operator.podLabels" . | nindent 8 }}
spec:
containers:
{{- if .Values.authProxy.enabled }}
Expand Down
3 changes: 3 additions & 0 deletions charts/k6-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ customAnnotations: {}
# customLabels -- Custom Label to be applied on all resources
customLabels: {}

# podLabels -- Custom Label to be applied on all pods
podLabels: {}

# nodeSelector -- Node Selector to be applied on all containers
nodeSelector: {}

Expand Down
Loading