diff --git a/Makefile b/Makefile index 394b1bd17..133921710 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ docker-build: all # Run tests test: generate fmt vet - export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT=1m; go test ./pkg/... ./cmd/... -coverprofile cover.out + go test ./pkg/... ./cmd/... -coverprofile cover.out .PHONY: clean clean: diff --git a/cmd/ks-apiserver/app/server.go b/cmd/ks-apiserver/app/server.go index 7513d5e41..ff18a2f2d 100644 --- a/cmd/ks-apiserver/app/server.go +++ b/cmd/ks-apiserver/app/server.go @@ -34,10 +34,8 @@ import ( es "kubesphere.io/kubesphere/pkg/simple/client/elasticsearch" fb "kubesphere.io/kubesphere/pkg/simple/client/fluentbit" "kubesphere.io/kubesphere/pkg/simple/client/mysql" - "kubesphere.io/kubesphere/pkg/simple/client/prometheus" "log" "net/http" - "net/url" ) var jsonIter = jsoniter.ConfigCompatibleWithStandardLibrary @@ -103,20 +101,11 @@ func initializeKialiConfig(s *options.ServerRunOptions) { // Exclude system namespaces config.API.Namespaces.Exclude = []string{"istio-system", "kubesphere*", "kube*"} - config.InCluster = false + config.InCluster = true // Set default prometheus service url - config.ExternalServices.PrometheusServiceURL = "http://prometheus.kubesphere-monitoring-system.svc:9090" - - // ugly hack to get prometheus service url - if pflag.Parsed() && pflag.Lookup("prometheus-endpoint") != nil { - // Set prometheus - endpoint, err := url.Parse(prometheus.PrometheusAPIEndpoint) - if err != nil { - config.ExternalServices.PrometheusServiceURL = endpoint.Path - } - } - + // TODO: use kubesphere builtin p8s instead of istio p8s + config.ExternalServices.PrometheusServiceURL = "http://prometheus.istio-system.svc.cluster.local:9090" config.ExternalServices.PrometheusCustomMetricsURL = config.ExternalServices.PrometheusServiceURL // Set istio pilot discovery service url diff --git a/tools/cmd/doc-gen/main.go b/tools/cmd/doc-gen/main.go index 65d5057c8..90b8bb6dc 100644 --- a/tools/cmd/doc-gen/main.go +++ b/tools/cmd/doc-gen/main.go @@ -32,6 +32,7 @@ import ( _ "kubesphere.io/kubesphere/pkg/apis/metrics/install" _ "kubesphere.io/kubesphere/pkg/apis/operations/install" _ "kubesphere.io/kubesphere/pkg/apis/resources/install" + _ "kubesphere.io/kubesphere/pkg/apis/servicemesh/metrics/install" ) var output string