我在集群上部署了 metrics-server。吊舱按预期运行。
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes
返回:
错误:您必须登录到服务器(未经授权)
指标服务器 pod 内的日志如下所示:
I0727 13:33:23.905320 1 serving.go:273] Generated self-signed cert (/tmp/apiserver.crt, /tmp/apiserver.key) │
│ [restful] 2019/07/27 13:33:26 log.go:33: [restful/swagger] listing is available at https://:8443/swaggerapi │
│ [restful] 2019/07/27 13:33:26 log.go:33: [restful/swagger] https://:8443/swaggerui/ is mapped to folder /swagger-ui/ │
│ I0727 13:33:26.284542 1 serve.go:96] Serving securely on [::]:8443 │
│ W0727 13:33:47.904111 1 x509.go:172] x509: subject with cn=kubernetes-proxy is not in the allowed list: [system:auth-proxy] │
│ E0727 13:33:47.904472 1 authentication.go:62] Unable to authenticate the request due to an error: [x509: subject with cn=kubernetes-proxy is not allowed, x509: certificate signed by unknown authority]
此错误消息看起来像是配置错误的 RBAC 规则,但是我的集群中没有 auth-proxy cluster-role...
cn=kubernetes-proxy 的主题不在允许列表中:[system:auth-proxy]
在某些时候它可能是一个简单的 RBAC 错误配置吗?
设置 --kubelet-insecure-tls 没有帮助
我在 Scaleway 上运行 Ubuntu 的裸机服务器上使用 k3s 版本 0.7.0