未验证 提交 343b2e60 编写于 作者: K KubeSphere CI Bot 提交者: GitHub

Merge pull request #3120 from yuswift/feature/lightweight-membercluster-installation

Feat: support runnig ks-apiserver without redis option && change log level
...@@ -129,7 +129,7 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{}) ...@@ -129,7 +129,7 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
} }
} }
} else { } else {
klog.Info("Kubesphere-controller-manager starts without ldap option, it will not sync user into ldap") klog.Warning("ks-controller-manager starts without ldap provided, it will not sync user into ldap")
} }
var openpitrixClient openpitrix.Client var openpitrixClient openpitrix.Client
......
...@@ -155,9 +155,7 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS ...@@ -155,9 +155,7 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
} }
var cacheClient cache.Interface var cacheClient cache.Interface
if s.RedisOptions == nil || len(s.RedisOptions.Host) == 0 { if s.RedisOptions != nil && len(s.RedisOptions.Host) != 0 {
return nil, fmt.Errorf("redis service address MUST not be empty, please check configmap/kubesphere-config in kubesphere-system namespace")
} else {
if s.RedisOptions.Host == fakeInterface && s.DebugMode { if s.RedisOptions.Host == fakeInterface && s.DebugMode {
apiServer.CacheClient = cache.NewSimpleCache() apiServer.CacheClient = cache.NewSimpleCache()
} else { } else {
...@@ -167,6 +165,10 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS ...@@ -167,6 +165,10 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
} }
apiServer.CacheClient = cacheClient apiServer.CacheClient = cacheClient
} }
} else {
klog.Warning("ks-apiserver starts without redis provided, it will use in memory cache. " +
"This may cause inconsistencies when running ks-apiserver with multiple replicas.")
apiServer.CacheClient = cache.NewSimpleCache()
} }
if s.EventsOptions.Host != "" { if s.EventsOptions.Host != "" {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册