Closed daiqingliang closed 4 years ago
用kubectl logs xxx看下日志
@pixiake
[root@master ~]# kubectl logs ks-apiserver-6d7ddd7d-r7mll -n kubesphere-system
W1115 08:12:41.210771 1 client_config.go:549] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I1115 08:12:41.212742 1 server.go:179] Start cache objects
Error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
Usage:
ks-apiserver [flags]
Flags:
--add-dir-header If true, adds the file directory to the header
--alsologtostderr log to standard error as well as files
--bind-address string server bind address (default "0.0.0.0")
--elasticsearch-host string ElasticSearch logging service host. KubeSphere is using elastic as log store, if this filed left blank, KubeSphere will use kubernetes builtin log API instead, and the following elastic search options will be ignored.
--elasticsearch-version string ElasticSearch major version, e.g. 5/6/7, if left blank, will detect automatically.Currently, minimum supported version is 5.x
-h, --help help for ks-apiserver
--index-prefix string Index name prefix. KubeSphere will retrieve logs against indices matching the prefix. (default "fluentbit")
--insecure-port int insecure port number (default 9090)
--istio-pilot-host string istio pilot discovery service url
--jaeger-query-host string jaeger query service url
--jenkins-host string Jenkins service host address. If left blank, means Jenkins is unnecessary.
--jenkins-max-connections int Maximum allowed connections to Jenkins. (default 100)
--jenkins-password string Password for access to Jenkins service, used pair with username.
--jenkins-username string Username for access to Jenkins service. Leave it blank if there isn't any.
--kubeconfig string Path for kubernetes kubeconfig file, if left blank, will use in cluster way.
--log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log-dir string If non-empty, write log files in this directory
--log-file string If non-empty, use this log file
--log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files (default true)
--master string Used to generate kubeconfig for downloading, if not specified, will use host in kubeconfig.
--mysql-host string MySQL service host address. If left blank, the following related mysql options will be ignored.
--mysql-max-connection-life-time duration Maximum connection life time allowed to connecto to mysql. (default 10s)
--mysql-max-idle-connections int Maximum idle connections allowed to connect to mysql. (default 100)
--mysql-max-open-connections int Maximum open connections allowed to connect to mysql. (default 100)
--mysql-password string Password for access to mysql, should be used pair with password.
--mysql-username string Username for access to mysql service.
--openpitrix-app-manager-endpoint string OpenPitrix app manager endpoint
--openpitrix-attachment-manager-endpoint string OpenPitrix attachment manager endpoint
--openpitrix-category-manager-endpoint string OpenPitrix category manager endpoint
--openpitrix-cluster-manager-endpoint string OpenPitrix cluster manager endpoint
--openpitrix-repo-indexer-endpoint string OpenPitrix repo indexer endpoint
--openpitrix-repo-manager-endpoint string OpenPitrix repo manager endpoint
--openpitrix-runtime-manager-endpoint string OpenPitrix runtime manager endpoint
--prometheus-endpoint string Prometheus service endpoint which stores KubeSphere monitoring data, if left blank, will use builtin metrics-server as data source.
--prometheus-secondary-endpoint string Prometheus secondary service endpoint, if left empty and endpoint is set, will use endpoint instead.
--s3-access-key-id string access key of s2i s3 (default "AKIAIOSFODNN7EXAMPLE")
--s3-bucket string bucket name of s2i s3 (default "s2i-binaries")
--s3-disable-SSL disable ssl (default true)
--s3-endpoint string Endpoint to access to s3 object storage service, if left blank, the following options will be ignored.
--s3-force-path-style force path style (default true)
--s3-region string Region of s3 that will access to, like us-east-1. (default "us-east-1")
--s3-secret-access-key string secret access key of s2i s3 (default "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY")
--s3-session-token string session token of s2i s3
--secure-port int secure port number
--servicemesh-prometheus-host string prometheus service for servicemesh
--skip-headers If true, avoid header prefixes in the log messages
--skip-log-headers If true, avoid headers when opening log files
--sonarqube-host string Sonarqube service address, if left empty, following sonarqube options will be ignored.
--sonarqube-token string Sonarqube service access token.
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--tls-cert-file string tls cert file
--tls-private-key string tls private key
-v, --v Level number for the log level verbosity
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
2019/11/15 08:12:41 unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
@zryfish @wansir
@daiqingliang 你的集群是不是没有安装 metrics-server ,你看下 kube-system 下是否有 metrics-server
然后执行 kubectl get apiservice | grep metrics
看下是否有结果
k8s版本:1.15.5
出现错误回顾
通过 最小化快速部署 安装完kubesphere,然后通过修改configMap来启用metric
保存之后,发现ks-apiserver出现问题,web界面无法访问,pod一直就是CrashLoopBackOff。 然后我又通过configMap关闭了metric,发现ks-apiserver仍然报错,无法恢复。