From fc77c2bc8c41fb1d27d86a984cd39b78cbdcdac8 Mon Sep 17 00:00:00 2001 From: Benedikt Bongartz Date: Tue, 15 Oct 2024 09:36:37 +0200 Subject: [PATCH] tempo-query: Make use of gRPC ReadinessProbe Signed-off-by: Benedikt Bongartz --- .chloggen/tempo-query_ReadinessProbe.yaml | 16 ++++++++++++++++ .../manifests/queryfrontend/query_frontend.go | 10 ++++++++++ .../queryfrontend/query_frontend_test.go | 10 ++++++++++ 3 files changed, 36 insertions(+) create mode 100755 .chloggen/tempo-query_ReadinessProbe.yaml diff --git a/.chloggen/tempo-query_ReadinessProbe.yaml b/.chloggen/tempo-query_ReadinessProbe.yaml new file mode 100755 index 000000000..f54c16d5d --- /dev/null +++ b/.chloggen/tempo-query_ReadinessProbe.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action) +component: tempostack + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Use the ReadinessProbe to better indicate when tempo-query is ready to accept requests. Improving the startup reliability by avoiding lost data. + +# One or more tracking issues related to the change +issues: [1058] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: Without a readiness check in place, there is a risk that data will be lost when the queryfrontend pod is ready but the tempo query API is not yet available. diff --git a/internal/manifests/queryfrontend/query_frontend.go b/internal/manifests/queryfrontend/query_frontend.go index 27ca29859..97b8d0d42 100644 --- a/internal/manifests/queryfrontend/query_frontend.go +++ b/internal/manifests/queryfrontend/query_frontend.go @@ -311,6 +311,16 @@ func deployment(params manifestutils.Params) (*appsv1.Deployment, error) { }, Resources: tempoQueryResources(tempo), SecurityContext: manifestutils.TempoContainerSecurityContext(), + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{ + Port: manifestutils.PortTempoGRPCQuery, + }, + }, + TimeoutSeconds: 1, + PeriodSeconds: 5, + FailureThreshold: 12, + }, } jaegerQueryVolume := corev1.Volume{ Name: manifestutils.TmpStorageVolumeName + "-query", diff --git a/internal/manifests/queryfrontend/query_frontend_test.go b/internal/manifests/queryfrontend/query_frontend_test.go index e9a5650f9..9f54ea5cb 100644 --- a/internal/manifests/queryfrontend/query_frontend_test.go +++ b/internal/manifests/queryfrontend/query_frontend_test.go @@ -289,6 +289,16 @@ func getExpectedDeployment(withJaeger bool) *v1.Deployment { ReadOnly: true, }, }, + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{ + Port: manifestutils.PortTempoGRPCQuery, + }, + }, + TimeoutSeconds: 1, + PeriodSeconds: 5, + FailureThreshold: 12, + }, Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceCPU: *resource.NewMilliQuantity(45, resource.BinarySI),