From 4ecf74f23981366285272f28db86a21af2246535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Mon, 30 Sep 2024 16:52:22 +0200 Subject: [PATCH 1/2] ingest-storage: Make label-selector in ReplicaTemplate configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Štibraný --- .../mimir/ingest-storage-ingester-autoscaling.libsonnet | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet b/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet index 682f9480f8d..559a3c5f11b 100644 --- a/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet +++ b/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet @@ -24,6 +24,11 @@ // to rollout ingesters autoscaling with no downtime. ingest_storage_ingester_autoscaling_ingester_annotations_enabled: $._config.ingest_storage_ingester_autoscaling_enabled, + // Make label selector in ReplicaTemplate configurable. This mostly doesn't matter, but from our experience if the selector + // doesn't match correct pods, HPA in GKE will display wrong usage in "kubectl describe hpa". This is harmless, but can + // easily be fixed by using name=ingester-zone-a. (We will roll out that change internally, and then upstream). + ingest_storage_ingester_replica_template_label_selector: 'name=unused', + // Make triggers configurable so that we can add more. Each object needs to have: query, threshold, metric_type. ingest_storage_ingester_autoscaling_triggers: [ { @@ -75,7 +80,7 @@ assert !$._config.ingest_storage_ingester_autoscaling_enabled || $.rollout_operator_deployment != null : 'partitions ingester autoscaling requires rollout-operator in namespace %s' % $._config.namespace, // Create resource that will be targetted by ScaledObject. - ingester_primary_zone_replica_template: if !$._config.ingest_storage_ingester_autoscaling_enabled then null else $.replicaTemplate($._config.ingest_storage_ingester_autoscaling_primary_zone, replicas=-1, label_selector='name=unused'), + ingester_primary_zone_replica_template: if !$._config.ingest_storage_ingester_autoscaling_enabled then null else $.replicaTemplate($._config.ingest_storage_ingester_autoscaling_primary_zone, replicas=-1, label_selector=$._config.ingest_storage_ingester_replica_template_label_selector), // // Configure prepare-shutdown endpoint in all ingesters. From d26ef73b22b9956d25e39978c163cd7a49c8a63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Mon, 30 Sep 2024 16:54:01 +0200 Subject: [PATCH 2/2] CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Štibraný --- CHANGELOG.md | 1 + .../mimir/ingest-storage-ingester-autoscaling.libsonnet | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 863d33d6604..c7e846f5a6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ * [ENHANCEMENT] Add `ingest_storage_ingester_autoscaling_triggers` option to specify multiple triggers in ScaledObject created for ingest-store ingester autoscaling. #9422 * [ENHANCEMENT] Add `ingest_storage_ingester_autoscaling_scale_up_stabilization_window_seconds` and `ingest_storage_ingester_autoscaling_scale_down_stabilization_window_seconds` config options to make stabilization window for ingester autoscaling when using ingest-storage configurable. #9445 +* [ENHANCEMENT] Make label-selector in ReplicaTemplate/ingester-zone-a object configurable when using ingest-storage. #9480 ### Mimirtool diff --git a/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet b/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet index 559a3c5f11b..dd712daf294 100644 --- a/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet +++ b/operations/mimir/ingest-storage-ingester-autoscaling.libsonnet @@ -27,7 +27,7 @@ // Make label selector in ReplicaTemplate configurable. This mostly doesn't matter, but from our experience if the selector // doesn't match correct pods, HPA in GKE will display wrong usage in "kubectl describe hpa". This is harmless, but can // easily be fixed by using name=ingester-zone-a. (We will roll out that change internally, and then upstream). - ingest_storage_ingester_replica_template_label_selector: 'name=unused', + ingest_storage_replica_template_label_selector: 'name=unused', // Make triggers configurable so that we can add more. Each object needs to have: query, threshold, metric_type. ingest_storage_ingester_autoscaling_triggers: [ @@ -80,7 +80,7 @@ assert !$._config.ingest_storage_ingester_autoscaling_enabled || $.rollout_operator_deployment != null : 'partitions ingester autoscaling requires rollout-operator in namespace %s' % $._config.namespace, // Create resource that will be targetted by ScaledObject. - ingester_primary_zone_replica_template: if !$._config.ingest_storage_ingester_autoscaling_enabled then null else $.replicaTemplate($._config.ingest_storage_ingester_autoscaling_primary_zone, replicas=-1, label_selector=$._config.ingest_storage_ingester_replica_template_label_selector), + ingester_primary_zone_replica_template: if !$._config.ingest_storage_ingester_autoscaling_enabled then null else $.replicaTemplate($._config.ingest_storage_ingester_autoscaling_primary_zone, replicas=-1, label_selector=$._config.ingest_storage_replica_template_label_selector), // // Configure prepare-shutdown endpoint in all ingesters.