remove prom check for public-api self-check (#5436)

Currently, public-api is part of the core control-plane where
the prom check fails when ran before the viz extension is installed.
This change comments out that check, Once metrics api is moved into
viz, maybe this check can be part of it instead or directly part of
`linkerd viz check`.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Co-authored-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
This commit is contained in:
Tarun Pothulapati 2021-01-06 03:52:39 +05:30 committed by GitHub
parent d3d7f4e2e2
commit e04647fb8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 24 deletions

View File

@ -45,11 +45,11 @@ type podReport struct {
}
const (
podQuery = "max(process_start_time_seconds{%s}) by (pod, namespace)"
k8sClientSubsystemName = "kubernetes"
k8sClientCheckDescription = "control plane can talk to Kubernetes"
promClientSubsystemName = "prometheus"
promClientCheckDescription = "control plane can talk to Prometheus"
podQuery = "max(process_start_time_seconds{%s}) by (pod, namespace)"
k8sClientSubsystemName = "kubernetes"
k8sClientCheckDescription = "control plane can talk to Kubernetes"
// promClientSubsystemName = "prometheus"
// promClientCheckDescription = "control plane can talk to Prometheus"
)
func newGrpcServer(
@ -206,20 +206,23 @@ func (s *grpcServer) SelfCheck(ctx context.Context, in *healthcheckPb.SelfCheckR
},
}
if s.prometheusAPI != nil {
promClientCheck := &healthcheckPb.CheckResult{
SubsystemName: promClientSubsystemName,
CheckDescription: promClientCheckDescription,
Status: healthcheckPb.CheckStatus_OK,
}
_, err = s.queryProm(ctx, fmt.Sprintf(podQuery, ""))
if err != nil {
promClientCheck.Status = healthcheckPb.CheckStatus_ERROR
promClientCheck.FriendlyMessageToUser = fmt.Sprintf("Error calling Prometheus from the control plane: %s", err)
}
// TODO: viz: Enable this check once controller moves to viz
/*
if s.prometheusAPI != nil {
promClientCheck := &healthcheckPb.CheckResult{
SubsystemName: promClientSubsystemName,
CheckDescription: promClientCheckDescription,
Status: healthcheckPb.CheckStatus_OK,
}
_, err = s.queryProm(ctx, fmt.Sprintf(podQuery, ""))
if err != nil {
promClientCheck.Status = healthcheckPb.CheckStatus_ERROR
promClientCheck.FriendlyMessageToUser = fmt.Sprintf("Error calling Prometheus from the control plane: %s", err)
}
response.Results = append(response.Results, promClientCheck)
}
response.Results = append(response.Results, promClientCheck)
}
*/
return response, nil
}

View File

@ -4,7 +4,6 @@ import (
"context"
"fmt"
"os"
"strconv"
"strings"
"testing"
"time"
@ -815,6 +814,10 @@ func TestInstallSP(t *testing.T) {
}
}
// This test fails because no web component is installed during this phase of
// the extension split. It should be renabled after the issue below is closed.
// Issue: https://github.com/linkerd/linkerd2/issues/5478
/*
func TestDashboard(t *testing.T) {
dashboardPort := 52237
dashboardURL := fmt.Sprintf("http://localhost:%d", dashboardPort)
@ -851,6 +854,7 @@ func TestDashboard(t *testing.T) {
resp, TestHelper.GetVersion())
}
}
*/
func TestInject(t *testing.T) {
resources, err := testutil.ReadFile("testdata/smoke_test.yaml")

View File

@ -64,7 +64,6 @@ linkerd-api
√ control plane pods are ready
√ control plane self-check
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus
linkerd-version
---------------

View File

@ -68,7 +68,6 @@ linkerd-api
√ control plane pods are ready
√ control plane self-check
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus
linkerd-version
---------------

View File

@ -52,7 +52,6 @@ linkerd-api
√ control plane pods are ready
√ control plane self-check
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus
linkerd-version
---------------

View File

@ -56,7 +56,6 @@ linkerd-api
√ control plane pods are ready
√ control plane self-check
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus
linkerd-version
---------------

View File

@ -56,7 +56,6 @@ linkerd-api
√ control plane pods are ready
√ control plane self-check
√ [kubernetes] control plane can talk to Kubernetes
√ [prometheus] control plane can talk to Prometheus
linkerd-version
---------------