@@ -58,6 +58,7 @@ import (
|
||||
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha3"
|
||||
iamapi "kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2"
|
||||
monitoringv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha3"
|
||||
networkv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/network/v1alpha2"
|
||||
notificationv1 "kubesphere.io/kubesphere/pkg/kapis/notification/v1"
|
||||
"kubesphere.io/kubesphere/pkg/kapis/oauth"
|
||||
openpitrixv1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1"
|
||||
@@ -202,6 +203,7 @@ func (s *APIServer) installKubeSphereAPIs() {
|
||||
im.NewLoginRecorder(s.KubernetesClient.KubeSphere()),
|
||||
s.Config.AuthenticationOptions))
|
||||
urlruntime.Must(servicemeshv1alpha2.AddToContainer(s.container))
|
||||
urlruntime.Must(networkv1alpha2.AddToContainer(s.container, s.Config.NetworkOptions.WeaveScopeHost))
|
||||
urlruntime.Must(devopsv1alpha2.AddToContainer(s.container,
|
||||
s.InformerFactory.KubeSphereSharedInformerFactory(),
|
||||
s.DevopsClient,
|
||||
|
||||
@@ -105,6 +105,7 @@ func newTestConfig() (*Config, error) {
|
||||
NSNPOptions: network.NSNPOptions{
|
||||
AllowedIngressNamespaces: []string{},
|
||||
},
|
||||
WeaveScopeHost: "weave-scope-app.weave",
|
||||
},
|
||||
MonitoringOptions: &prometheus.Options{
|
||||
Endpoint: "http://prometheus.kubesphere-monitoring-system.svc",
|
||||
|
||||
@@ -31,6 +31,7 @@ import (
|
||||
const ScopeQueryUrl = "http://%s/api/topology/services"
|
||||
|
||||
type handler struct {
|
||||
// if weave scope installed in the cluster, it is maybe `weave-scope-app.weave`
|
||||
weaveScopeHost string
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package network
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/network/ippool"
|
||||
)
|
||||
|
||||
@@ -30,6 +31,7 @@ type Options struct {
|
||||
NSNPOptions NSNPOptions `json:"nsnpOptions,omitempty" yaml:"nsnpOptions,omitempty"`
|
||||
EnableIPPool bool `json:"enableIPPool,omitempty" yaml:"enableIPPool"`
|
||||
IPPoolOptions ippool.Options `json:"ippoolOptions,omitempty" yaml:"ippoolOptions,omitempty"`
|
||||
WeaveScopeHost string `json:"weaveScopeHost,omitempty" yaml:"weaveScopeHost,omitempty"`
|
||||
}
|
||||
|
||||
// NewNetworkOptions returns a `zero` instance
|
||||
@@ -43,6 +45,7 @@ func NewNetworkOptions() *Options {
|
||||
IPPoolOptions: ippool.Options{
|
||||
Calico: nil,
|
||||
},
|
||||
WeaveScopeHost: "",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +59,7 @@ func (s *Options) ApplyTo(options *Options) {
|
||||
options.EnableIPPool = s.EnableIPPool
|
||||
options.NSNPOptions = s.NSNPOptions
|
||||
options.IPPoolOptions = s.IPPoolOptions
|
||||
options.WeaveScopeHost = s.WeaveScopeHost
|
||||
}
|
||||
|
||||
func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options) {
|
||||
@@ -63,4 +67,6 @@ func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options) {
|
||||
"This field instructs KubeSphere to enable network policy or not.")
|
||||
fs.BoolVar(&s.EnableIPPool, "enable-ippool", c.EnableIPPool,
|
||||
"This field instructs KubeSphere to enable ippool or not.")
|
||||
fs.StringVar(&s.WeaveScopeHost, "weave-scope-host", c.WeaveScopeHost,
|
||||
"Weave Scope service endpoint which build a topology API of the applications and the containers running on the hosts")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user