From 8a060fa87ffdcd9190f2c91336910af4b5b60017 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 20 Mar 2019 11:15:00 +0800 Subject: [PATCH 1/2] fix kiali config --- cmd/ks-apiserver/app/server.go | 2 +- tools/cmd/doc-gen/main.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/ks-apiserver/app/server.go b/cmd/ks-apiserver/app/server.go index aef7453ae..0cf535cd4 100644 --- a/cmd/ks-apiserver/app/server.go +++ b/cmd/ks-apiserver/app/server.go @@ -95,7 +95,7 @@ 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" 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 From 00b958887c4da2e3a2e16af83765506e8bf973eb Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 20 Mar 2019 12:17:47 +0800 Subject: [PATCH 2/2] use istio p8s --- cmd/ks-apiserver/app/server.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/cmd/ks-apiserver/app/server.go b/cmd/ks-apiserver/app/server.go index 0cf535cd4..f62d2e6fe 100644 --- a/cmd/ks-apiserver/app/server.go +++ b/cmd/ks-apiserver/app/server.go @@ -29,10 +29,8 @@ import ( "kubesphere.io/kubesphere/pkg/filter" "kubesphere.io/kubesphere/pkg/informers" "kubesphere.io/kubesphere/pkg/signals" - "kubesphere.io/kubesphere/pkg/simple/client/prometheus" "log" "net/http" - "net/url" ) func NewAPIServerCommand() *cobra.Command { @@ -98,17 +96,8 @@ func initializeKialiConfig(s *options.ServerRunOptions) { 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