From 652eb9d657322c453b510ee4f2bb1cad305910a7 Mon Sep 17 00:00:00 2001 From: JoaoBraveCoding Date: Thu, 22 Dec 2022 15:48:18 +0000 Subject: [PATCH] Sets query.sd-dns-resolver=miekgdns for thanos-querier and thanos-ruler Issue: https://issues.redhat.com/browse/OCPBUGS-5153 Problem: a downstream commit was made to make this the default because of https://bugzilla.redhat.com/show_bug.cgi?id=1953518. However, this commit conflicts when updating the downstream brach. Solution: migrate default to jsonnet Signed-off-by: JoaoBraveCoding --- assets/thanos-querier/deployment.yaml | 1 + assets/thanos-ruler/thanos-ruler.yaml | 4 +++- jsonnet/components/thanos-querier.libsonnet | 4 ++++ jsonnet/components/thanos-ruler.libsonnet | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/assets/thanos-querier/deployment.yaml b/assets/thanos-querier/deployment.yaml index 112efe34b6..e28ff5699d 100644 --- a/assets/thanos-querier/deployment.yaml +++ b/assets/thanos-querier/deployment.yaml @@ -61,6 +61,7 @@ spec: - --grpc-client-server-name=prometheus-grpc - --rule=dnssrv+_grpc._tcp.prometheus-operated.openshift-monitoring.svc.cluster.local - --target=dnssrv+_grpc._tcp.prometheus-operated.openshift-monitoring.svc.cluster.local + - --query.sd-dns-resolver=miekgdns env: - name: HOST_IP_ADDRESS valueFrom: diff --git a/assets/thanos-ruler/thanos-ruler.yaml b/assets/thanos-ruler/thanos-ruler.yaml index 365aaeb7ef..97db4baf93 100644 --- a/assets/thanos-ruler/thanos-ruler.yaml +++ b/assets/thanos-ruler/thanos-ruler.yaml @@ -20,7 +20,9 @@ spec: key: alertmanagers.yaml name: thanos-ruler-alertmanagers-config containers: - - name: thanos-ruler + - args: + - --query.sd-dns-resolver=miekgdns + name: thanos-ruler securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/jsonnet/components/thanos-querier.libsonnet b/jsonnet/components/thanos-querier.libsonnet index 583cbeec12..facdb4047f 100644 --- a/jsonnet/components/thanos-querier.libsonnet +++ b/jsonnet/components/thanos-querier.libsonnet @@ -356,6 +356,10 @@ function(params) '--grpc-client-server-name=prometheus-grpc', '--rule=dnssrv+_grpc._tcp.prometheus-operated.openshift-monitoring.svc.cluster.local', '--target=dnssrv+_grpc._tcp.prometheus-operated.openshift-monitoring.svc.cluster.local', + // The native Go resolver fails to parse compressed responses for SRV records. + // The miekgdns resolver doesn't suffer the same issue hence defaulting to it instead. + // See https://bugzilla.redhat.com/show_bug.cgi?id=1953518 + '--query.sd-dns-resolver=miekgdns', ], resources: { requests: { diff --git a/jsonnet/components/thanos-ruler.libsonnet b/jsonnet/components/thanos-ruler.libsonnet index 6f27e4e9fb..10b50185fc 100644 --- a/jsonnet/components/thanos-ruler.libsonnet +++ b/jsonnet/components/thanos-ruler.libsonnet @@ -385,6 +385,12 @@ function(params) // Note: this is performing strategic-merge-patch for thanos-ruler container. // Remainder of the container configuration is managed by prometheus-operator based on $.thanosRuler.spec name: tr.config.name, + args: [ + // The native Go resolver fails to parse compressed responses for SRV records. + // The miekgdns resolver doesn't suffer the same issue hence defaulting to it instead. + // See https://bugzilla.redhat.com/show_bug.cgi?id=1953518 + '--query.sd-dns-resolver=miekgdns', + ], terminationMessagePolicy: 'FallbackToLogsOnError', volumeMounts: [ {