From c29b74012402b098d0eb5cc287706d53e32d7319 Mon Sep 17 00:00:00 2001 From: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:42:54 +0100 Subject: [PATCH] fix hashmod yaml (#650) Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> --- ...observatorium-metrics-store-default-template.yaml | 6 +++--- .../observatorium-metrics-store-rhel-template.yaml | 6 +++--- ...servatorium-metrics-store-telemeter-template.yaml | 6 +++--- ...observatorium-metrics-store-default-template.yaml | 6 +++--- .../observatorium-metrics-store-rhel-template.yaml | 6 +++--- ...servatorium-metrics-store-telemeter-template.yaml | 6 +++--- .../assets/store-auto-shard-relabel-configMap.sh | 12 +++++++----- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/resources/services/app-sre-stage-01/rhobs/default/observatorium-metrics-store-default-template.yaml b/resources/services/app-sre-stage-01/rhobs/default/observatorium-metrics-store-default-template.yaml index 5f9256f251..f740eba204 100755 --- a/resources/services/app-sre-stage-01/rhobs/default/observatorium-metrics-store-default-template.yaml +++ b/resources/services/app-sre-stage-01/rhobs/default/observatorium-metrics-store-default-template.yaml @@ -441,9 +441,9 @@ objects: -o=jsonpath='{.status.replicas}')\n\n# Logging parameters\necho \"generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS_STORE_REPLICAS=${STATEFULSET_NAME} HOSTNAME=${HOSTNAME} NAMESPACE=${NAMESPACE} THANOS_STORE_REPLICAS=${THANOS_STORE_REPLICAS}\"\n\ncat - </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels: - [\"__block_id\"]\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- - action: keep\n source_labels: [\"shard\"]\n regex: ${ORDINAL_INDEX}\nEOF\n" + </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels:\n + \ - __block_id\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- + action: keep\n source_labels:\n - shard\n regex: ${ORDINAL_INDEX}\nEOF\n" kind: ConfigMap metadata: creationTimestamp: null diff --git a/resources/services/app-sre-stage-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml b/resources/services/app-sre-stage-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml index 9e01baaa58..2521ca25bc 100755 --- a/resources/services/app-sre-stage-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml +++ b/resources/services/app-sre-stage-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml @@ -441,9 +441,9 @@ objects: -o=jsonpath='{.status.replicas}')\n\n# Logging parameters\necho \"generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS_STORE_REPLICAS=${STATEFULSET_NAME} HOSTNAME=${HOSTNAME} NAMESPACE=${NAMESPACE} THANOS_STORE_REPLICAS=${THANOS_STORE_REPLICAS}\"\n\ncat - </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels: - [\"__block_id\"]\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- - action: keep\n source_labels: [\"shard\"]\n regex: ${ORDINAL_INDEX}\nEOF\n" + </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels:\n + \ - __block_id\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- + action: keep\n source_labels:\n - shard\n regex: ${ORDINAL_INDEX}\nEOF\n" kind: ConfigMap metadata: creationTimestamp: null diff --git a/resources/services/app-sre-stage-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml b/resources/services/app-sre-stage-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml index 9e6e9ca659..67620f55c1 100755 --- a/resources/services/app-sre-stage-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml +++ b/resources/services/app-sre-stage-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml @@ -441,9 +441,9 @@ objects: -o=jsonpath='{.status.replicas}')\n\n# Logging parameters\necho \"generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS_STORE_REPLICAS=${STATEFULSET_NAME} HOSTNAME=${HOSTNAME} NAMESPACE=${NAMESPACE} THANOS_STORE_REPLICAS=${THANOS_STORE_REPLICAS}\"\n\ncat - </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels: - [\"__block_id\"]\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- - action: keep\n source_labels: [\"shard\"]\n regex: ${ORDINAL_INDEX}\nEOF\n" + </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels:\n + \ - __block_id\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- + action: keep\n source_labels:\n - shard\n regex: ${ORDINAL_INDEX}\nEOF\n" kind: ConfigMap metadata: creationTimestamp: null diff --git a/resources/services/telemeter-prod-01/rhobs/default/observatorium-metrics-store-default-template.yaml b/resources/services/telemeter-prod-01/rhobs/default/observatorium-metrics-store-default-template.yaml index 5f9256f251..f740eba204 100755 --- a/resources/services/telemeter-prod-01/rhobs/default/observatorium-metrics-store-default-template.yaml +++ b/resources/services/telemeter-prod-01/rhobs/default/observatorium-metrics-store-default-template.yaml @@ -441,9 +441,9 @@ objects: -o=jsonpath='{.status.replicas}')\n\n# Logging parameters\necho \"generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS_STORE_REPLICAS=${STATEFULSET_NAME} HOSTNAME=${HOSTNAME} NAMESPACE=${NAMESPACE} THANOS_STORE_REPLICAS=${THANOS_STORE_REPLICAS}\"\n\ncat - </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels: - [\"__block_id\"]\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- - action: keep\n source_labels: [\"shard\"]\n regex: ${ORDINAL_INDEX}\nEOF\n" + </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels:\n + \ - __block_id\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- + action: keep\n source_labels:\n - shard\n regex: ${ORDINAL_INDEX}\nEOF\n" kind: ConfigMap metadata: creationTimestamp: null diff --git a/resources/services/telemeter-prod-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml b/resources/services/telemeter-prod-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml index 9e01baaa58..2521ca25bc 100755 --- a/resources/services/telemeter-prod-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml +++ b/resources/services/telemeter-prod-01/rhobs/rhel/observatorium-metrics-store-rhel-template.yaml @@ -441,9 +441,9 @@ objects: -o=jsonpath='{.status.replicas}')\n\n# Logging parameters\necho \"generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS_STORE_REPLICAS=${STATEFULSET_NAME} HOSTNAME=${HOSTNAME} NAMESPACE=${NAMESPACE} THANOS_STORE_REPLICAS=${THANOS_STORE_REPLICAS}\"\n\ncat - </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels: - [\"__block_id\"]\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- - action: keep\n source_labels: [\"shard\"]\n regex: ${ORDINAL_INDEX}\nEOF\n" + </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels:\n + \ - __block_id\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- + action: keep\n source_labels:\n - shard\n regex: ${ORDINAL_INDEX}\nEOF\n" kind: ConfigMap metadata: creationTimestamp: null diff --git a/resources/services/telemeter-prod-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml b/resources/services/telemeter-prod-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml index 9e6e9ca659..67620f55c1 100755 --- a/resources/services/telemeter-prod-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml +++ b/resources/services/telemeter-prod-01/rhobs/telemeter/observatorium-metrics-store-telemeter-template.yaml @@ -441,9 +441,9 @@ objects: -o=jsonpath='{.status.replicas}')\n\n# Logging parameters\necho \"generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS_STORE_REPLICAS=${STATEFULSET_NAME} HOSTNAME=${HOSTNAME} NAMESPACE=${NAMESPACE} THANOS_STORE_REPLICAS=${THANOS_STORE_REPLICAS}\"\n\ncat - </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels: - [\"__block_id\"]\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- - action: keep\n source_labels: [\"shard\"]\n regex: ${ORDINAL_INDEX}\nEOF\n" + </tmp/config/hashmod-config.yaml\n- action: hashmod\n source_labels:\n + \ - __block_id\n target_label: shard\n modulus: ${THANOS_STORE_REPLICAS}\n- + action: keep\n source_labels:\n - shard\n regex: ${ORDINAL_INDEX}\nEOF\n" kind: ConfigMap metadata: creationTimestamp: null diff --git a/services_go/observatorium/assets/store-auto-shard-relabel-configMap.sh b/services_go/observatorium/assets/store-auto-shard-relabel-configMap.sh index 6147339cf1..992614e331 100755 --- a/services_go/observatorium/assets/store-auto-shard-relabel-configMap.sh +++ b/services_go/observatorium/assets/store-auto-shard-relabel-configMap.sh @@ -12,10 +12,12 @@ echo "generating store hashmod config with ORDINAL_INDEX=${ORDINAL_INDEX} THANOS cat </tmp/config/hashmod-config.yaml - action: hashmod - source_labels: ["__block_id"] - target_label: shard - modulus: ${THANOS_STORE_REPLICAS} + source_labels: + - __block_id + target_label: shard + modulus: ${THANOS_STORE_REPLICAS} - action: keep - source_labels: ["shard"] - regex: ${ORDINAL_INDEX} + source_labels: + - shard + regex: ${ORDINAL_INDEX} EOF