Skip to content

Commit

Permalink
fix: use thanos default port in service and containerPort
Browse files Browse the repository at this point in the history
Before thanos was only listening on localhost. Relying on the default
setting allows user to modify that via server side apply and add a proxy
chain.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
  • Loading branch information
jan--f committed Feb 8, 2024
1 parent 4367a6e commit a9282d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions pkg/controllers/monitoring/thanos-querier/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ func thanosComponentReconcilers(thanos *msoapi.ThanosQuerier, sidecarUrls []stri
func newThanosQuerierDeployment(name string, spec *msoapi.ThanosQuerier, sidecarUrls []string, thanosCfg ThanosConfiguration) *appsv1.Deployment {
args := []string{
"query",
"--grpc-address=127.0.0.1:10901",
"--http-address=127.0.0.1:9090",
"--log.format=logfmt",
"--query.replica-label=prometheus_replica",
"--query.auto-downsampling",
Expand Down Expand Up @@ -71,7 +69,7 @@ func newThanosQuerierDeployment(name string, spec *msoapi.ThanosQuerier, sidecar
Image: thanosCfg.Image,
Ports: []corev1.ContainerPort{
{
ContainerPort: 9090,
ContainerPort: 10902,
Name: "metrics",
},
},
Expand Down Expand Up @@ -116,7 +114,7 @@ func newService(name string, namespace string) *corev1.Service {
Spec: corev1.ServiceSpec{
Ports: []corev1.ServicePort{
{
Port: 9090,
Port: 10902,
Name: "http",
},
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/monitoring_stack_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ func namespaceSelectorTest(t *testing.T) {
stopChan := make(chan struct{})
defer close(stopChan)
//nolint
if pollErr := wait.Poll(15*time.Second, framework.DefaultTestTimeout, func() (bool, error) {
if pollErr := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, framework.DefaultTestTimeout, true, func(ctx context.Context) (bool, error) {
err := f.StartServicePortForward(ms.Name+"-prometheus", e2eTestNamespace, "9090", stopChan)
return err == nil, nil
}); pollErr != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/thanos_querier_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func singleStackWithSidecar(t *testing.T) {
stopChan := make(chan struct{})
defer close(stopChan)
if err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 2*time.Minute, true, func(ctx context.Context) (bool, error) {
err = f.StartServicePortForward(name, e2eTestNamespace, "9090", stopChan)
err = f.StartServicePortForward(name, e2eTestNamespace, "10902", stopChan)
return err == nil, nil
}); wait.Interrupted(err) {
t.Fatal(err)
Expand Down

0 comments on commit a9282d5

Please sign in to comment.