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

[helm-chart] add values for setting annotations and labels for rollout-operator #6733

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
28f8ec9
[helm-chart] add values for setting annotations and labels for rollou…
m1rp Nov 24, 2023
f4705ac
implement feedback
m1rp Dec 4, 2023
6ff0205
update changelog
m1rp Dec 5, 2023
2df4381
fix more linting issues
m1rp Mar 25, 2024
ebef306
Merge branch 'main' into rollout-operator-config
dimitarvdimitrov May 1, 2024
7dbd8d2
Readd deleted comments
dimitarvdimitrov May 1, 2024
de77d1c
Move changelog entry
dimitarvdimitrov May 1, 2024
6a95788
Fix comment spacing
dimitarvdimitrov May 1, 2024
81dbb5a
implement feedback
m1rp May 28, 2024
ab3a28a
Merge branch 'main' into rollout-operator-config
m1rp Jul 15, 2024
5656c5b
[helm-chart] add values for setting annotations and labels for rollou…
m1rp Nov 24, 2023
d95fbd6
implement feedback
m1rp Dec 4, 2023
eb3654d
update changelog
m1rp Dec 5, 2023
e5e5660
fix more linting issues
m1rp Mar 25, 2024
b3da90a
Move changelog entry
dimitarvdimitrov May 1, 2024
852e7a9
Fix comment spacing
dimitarvdimitrov May 1, 2024
dc56ee9
implement feedback
m1rp May 28, 2024
c8df137
Merge branch 'rollout-operator-config' of https://github.com/m1rp/mim…
seanankenbruck Feb 18, 2025
339d914
moved changelog ref to top of file
seanankenbruck Feb 18, 2025
096dc67
Merge pull request #2 from seanankenbruck/rollout-operator-config
m1rp Feb 24, 2025
79653ae
set prepare-downscale and downscale leader by default per comment htt…
seanankenbruck Mar 3, 2025
8c98d28
added a validation step to verify noDownscale and prepareDownscale ar…
seanankenbruck Mar 3, 2025
42ceae2
fix downscaleLeader reference
seanankenbruck Mar 3, 2025
4c534cd
rebuilt helm tests with 'make build-helm-tests'
seanankenbruck Mar 3, 2025
1ac7705
clean white noise
seanankenbruck Mar 3, 2025
d415a93
Merge pull request #3 from seanankenbruck/rollout-operator-config
m1rp Mar 4, 2025
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
1 change: 1 addition & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Entries should include a reference to the Pull Request that introduced the chang
* [ENHANCEMENT] Set resources for smoke-test job. #10608
* [BUGFIX] Create proper in-cluster remote URLs when gateway and nginx are disabled. #10625
* [BUGFIX] Fix calculation of `mimir.siToBytes` and use floating point arithmetics. #10044
* [ENHANCEMENT] Add values for setting annotations and labels for rollout-operator. #6733

## 5.6.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ which allows us to keep generating everything for the default zone.
"nodeSelector" ($rolloutZone.nodeSelector | default (dict) )
"replicas" $replicaPerZone
"storageClass" $rolloutZone.storageClass
"noDownscale" $rolloutZone.noDownscale
"downscaleLeader" $rolloutZone.downscaleLeader
"prepareDownscale" $rolloutZone.prepareDownscale
) -}}
{{- end -}}
{{- if $componentSection.zoneAwareReplication.migration.enabled -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,22 @@ metadata:
name: {{ include "mimir.resourceName" $args }}
labels:
{{- include "mimir.labels" $args | nindent 4 }}
{{- if (eq $rolloutZone.noDownscale true )}}
grafana.com/no-downscale: {{$rolloutZone.noDownscale}}
{{- else }}
{{- if (eq $rolloutZone.prepareDownscale true )}}
grafana.com/prepare-downscale: {{$rolloutZone.prepareDownscale}}
{{- end }}
{{- end }}
annotations:
{{- include "mimir.componentAnnotations" $args | nindent 4 }}
{{- if $rolloutZone.prepareDownscale }}
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: {{ include "mimir.serverHttpListenPort" . }}
{{- end -}}
{{- if $rolloutZone.downscaleLeader }}
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
{{- end }}
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: {{ $rolloutZone.replicas }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,23 @@ metadata:
name: {{ include "mimir.resourceName" $args }}
labels:
{{- include "mimir.labels" $args | nindent 4 }}
{{- if (eq $rolloutZone.noDownscale true )}}
grafana.com/no-downscale: {{$rolloutZone.noDownscale}}
{{- else }}
{{- if (eq $rolloutZone.prepareDownscale true )}}
grafana.com/prepare-downscale: {{$rolloutZone.prepareDownscale}}
grafana.com/min-time-between-zones-downscale: 12h
{{- end }}
{{- end }}
annotations:
{{- include "mimir.componentAnnotations" $args | nindent 4 }}
{{- if $rolloutZone.prepareDownscale }}
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: {{ include "mimir.serverHttpListenPort" . }}
{{- end -}}
{{- if $rolloutZone.downscaleLeader }}
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
{{- end }}
namespace: {{ .Release.Namespace | quote }}
spec:
podManagementPolicy: {{ .Values.ingester.podManagementPolicy }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,23 @@ metadata:
name: {{ include "mimir.resourceName" $args }}
labels:
{{- include "mimir.labels" $args | nindent 4 }}
{{- if (eq $rolloutZone.noDownscale true )}}
grafana.com/no-downscale: {{$rolloutZone.noDownscale}}
{{- else }}
{{- if (eq $rolloutZone.prepareDownscale true )}}
grafana.com/prepare-downscale: {{$rolloutZone.prepareDownscale}}
grafana.com/min-time-between-zones-downscale: 30m
{{- end }}
{{- end }}
annotations:
{{- include "mimir.componentAnnotations" $args | nindent 4 }}
{{- if $rolloutZone.prepareDownscale }}
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: {{ include "mimir.serverHttpListenPort" . }}
{{- end -}}
{{- if $rolloutZone.downscaleLeader }}
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
{{- end }}
namespace: {{ .Release.Namespace | quote }}
spec:
podManagementPolicy: {{ .Values.store_gateway.podManagementPolicy }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,9 @@
{{- if and (not .Values.enterprise.enabled) .Values.federation_frontend.enabled -}}
{{- fail "You have federation_frontend.enabled=true, but enterprise.enabled=false. Federation Frontend is an enterprise-only feature and requires enterprise mode to be enabled." }}
{{- end -}}

{{- range .Values.ingester.zoneAwareReplication.zones }}
{{- if and (eq .noDownscale true) (eq .prepareDownscale true) }}
{{- fail (printf "For ingester zone '%s': noDownscale and prepareDownscale cannot be used simultaneously." .name) -}}
{{- end }}
{{- end }}
72 changes: 72 additions & 0 deletions operations/helm/charts/mimir-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,14 @@ alertmanager:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `alertmanager.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: false
# -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- name: zone-b
# -- nodeselector to restrict where pods of this zone can be placed. E.g.:
Expand All @@ -806,6 +814,14 @@ alertmanager:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `alertmanager.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
Copy link
Contributor

Choose a reason for hiding this comment

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

would be great if we can set the downscale leader automatically in the zonal templates. That way automatica downscaling can be just a single boolean toggle for the ingester/store-gateway which automatically sets up downscale leader and prepare downscale for the 3 zones.

But i think this PR has been lingering for long enough to try to slow it down further. happy to not include this change in the PR if you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

having said that - i think having noDownscale: false would be a safer change because it will mean folks can keep running the chart as they used to. If we get automatic downscaling automatically set up like I suggested above, then I think it's viable to have it on by default.

I think it makes sense to try to minimize the added manual effort for folks after they upgrade to a chart version which contains this PR

Copy link
Author

Choose a reason for hiding this comment

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

i think that changing noDownscale: false makes sense. and as you mentioned the PR has been lingering for a while and i just don't have the bandwidth to deal with it.

# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: false
# -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- name: zone-c
# -- nodeselector to restrict where pods of this zone can be placed. E.g.:
Expand All @@ -819,6 +835,14 @@ alertmanager:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `alertmanager.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: false

distributor:
# -- Whether to render the manifests related to the distributor component.
Expand Down Expand Up @@ -1149,6 +1173,14 @@ ingester:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: true
# -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- name: zone-b
# -- nodeselector to restrict where pods of this zone can be placed. E.g.:
Expand All @@ -1162,6 +1194,14 @@ ingester:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: mimir-ingester-zone-a
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: true
# -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- name: zone-c
# -- nodeselector to restrict where pods of this zone can be placed. E.g.:
Expand All @@ -1175,6 +1215,14 @@ ingester:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: mimir-ingester-zone-b
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: true

overrides_exporter:
enabled: true
Expand Down Expand Up @@ -2283,6 +2331,14 @@ store_gateway:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `store_gateway.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: false
# -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- name: zone-b
# -- nodeselector to restrict where pods of this zone can be placed. E.g.:
Expand All @@ -2296,6 +2352,14 @@ store_gateway:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `store_gateway.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: false
# -- Name of the zone, used in labels and selectors. Must follow Kubernetes naming restrictions: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- name: zone-c
# -- nodeselector to restrict where pods of this zone can be placed. E.g.:
Expand All @@ -2309,6 +2373,14 @@ store_gateway:
# If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning
# If undefined or set to null (the default), then fall back to the value of `store_gateway.persistentVolume.storageClass`.
storageClass: null
# -- noDownscale adds a label that can be used by the rollout-operator as documented in the rollout-operator repo: https://github.com/grafana/rollout-operator#webhooks
noDownscale: false
# -- downscaleLeader is an Annotation used by the rollout-operator
# If defined, downscaleLeader: <downscaleLeader>
# If undefined or set to null (the default), no Annotation is set
downscaleLeader: null
# -- prepareDownscale adds labels and annotations for the rollout-operator to prepare downscaling: https://github.com/grafana/rollout-operator#how-scaling-up-and-down-works
prepareDownscale: false

compactor:
# -- Whether to render the manifests related to the compactor component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ metadata:
name: "ingester-zone-a"
rollout-group: ingester
zone: zone-a
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down Expand Up @@ -163,8 +167,13 @@ metadata:
name: "ingester-zone-b"
rollout-group: ingester
zone: zone-b
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down Expand Up @@ -313,8 +322,13 @@ metadata:
name: "ingester-zone-c"
rollout-group: ingester
zone: zone-c
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ metadata:
name: "ingester-zone-a"
rollout-group: ingester
zone: zone-a
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down Expand Up @@ -154,8 +158,13 @@ metadata:
name: "ingester-zone-b"
rollout-group: ingester
zone: zone-b
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down Expand Up @@ -295,8 +304,13 @@ metadata:
name: "ingester-zone-c"
rollout-group: ingester
zone: zone-c
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ metadata:
name: "ingester-zone-a"
rollout-group: ingester
zone: zone-a
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down Expand Up @@ -149,8 +153,13 @@ metadata:
name: "ingester-zone-b"
rollout-group: ingester
zone: zone-b
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down Expand Up @@ -285,8 +294,13 @@ metadata:
name: "ingester-zone-c"
rollout-group: ingester
zone: zone-c
grafana.com/prepare-downscale: true
grafana.com/min-time-between-zones-downscale: 12h
annotations:
rollout-max-unavailable: "50"
grafana.com/prepare-downscale-http-path: ingester/prepare-shutdown
grafana.com/prepare-downscale-http-port: 8080
grafana.com/rollout-downscale-leader: $rolloutZone.downscaleLeader
namespace: "citestns"
spec:
podManagementPolicy: Parallel
Expand Down
Loading
Loading