Feat: support runnig ks-apiserver without redis option && change log level

Signed-off-by: yuswift <yuswiftli@yunify.com>
This commit is contained in:
yuswift
2020-11-16 17:23:48 +08:00
parent 69a27e40aa
commit 2278132d08
2 changed files with 6 additions and 4 deletions

View File

@@ -129,7 +129,7 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
}
}
} 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

View File

@@ -155,9 +155,7 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
}
var cacheClient cache.Interface
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 != nil && len(s.RedisOptions.Host) != 0 {
if s.RedisOptions.Host == fakeInterface && s.DebugMode {
apiServer.CacheClient = cache.NewSimpleCache()
} else {
@@ -167,6 +165,10 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
}
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 != "" {