-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metrics-server assumes same TLS config for kube-apiserver and kubelets #25
Comments
I guess this configuration will cause the swaggerui can not work correctly. My k8s cluster was built with kubeadmin, and when I try to visit the swaggerui, I get these errors. itaas@kvm-013487:~/k8s$ kubectl logs metrics-server-859cb9bd4b-tnhtx -n=kube-system
I1122 06:41:18.721787 1 heapster.go:71] /metrics-server --source=kubernetes.summary_api:''
I1122 06:41:18.721867 1 heapster.go:72] Metrics Server version v0.2.0
I1122 06:41:18.722052 1 configs.go:61] Using Kubernetes client with master "https://10.96.0.1:443" and version
I1122 06:41:18.722076 1 configs.go:62] Using kubelet port 10255
I1122 06:41:18.723357 1 heapster.go:128] Starting with Metric Sink
I1122 06:41:19.349881 1 serving.go:308] Generated self-signed cert (apiserver.local.config/certificates/apiserver.crt, apiserver.local.config/certificates/apiserver.key)
I1122 06:41:19.661749 1 heapster.go:101] Starting Heapster API server...
[restful] 2017/11/22 06:41:19 log.go:33: [restful/swagger] listing is available at https:///swaggerapi
[restful] 2017/11/22 06:41:19 log.go:33: [restful/swagger] https:///swaggerui/ is mapped to folder /swagger-ui/
I1122 06:41:19.663614 1 serve.go:85] Serving securely on 0.0.0.0:443
I1123 01:27:49.900802 1 logs.go:41] http: TLS handshake error from 192.168.222.192:47540: remote error: tls: bad certificate
I1123 01:27:50.116378 1 logs.go:41] http: TLS handshake error from 192.168.222.192:47542: remote error: tls: bad certificate
I1123 01:27:56.031159 1 logs.go:41] http: TLS handshake error from 192.168.222.192:47556: remote error: tls: bad certificate |
I don't think this would cause issues with the swagger UI. Please file a separate bug for that. |
The master API server receives the kubelet CA from the |
I believe one possible option is to augment metrics-server to accept an additional set of arguments to specify the kubelet CA & client credentials. |
that seems fairly reasonable. PRs are welcome (and/or one of @piosz or I will get to it eventually) |
The |
Does anyone have a solution to this? How can we get metrics-server to talk to kubelet when kubelet has tls client auth? |
@aurcioli-handy You can do it but you have to use the same CA for both Kubelet and the main API, which feels slightly dirty but should not in and of itself be a security issue if done properly. |
Okay, I was able to get this working with the following setup: kubelet
metrics-server
with kubeconfig
And the rest was just massaging RBAC to get the permissions right. |
Wouldn't this line in your deployment of metric-server:
Result in it accepting 'insecure' certificates? and that way it doesn't matter what certificates's you put there? |
We should probably have a new |
How about add |
that's an option too (although probably just the /good-first-issue |
@DirectXMan12: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I would like to try fix this.
Do you mean |
yeah, that was my suggestion -- if you use a file in kubeconfig format, you can just re-use the logic for loading a kubeconfig, etc. On the other hand, I've learned (recently) that some people find this method confusing, so flags are probably fine too. Let's start with a |
/assign @caitong93 |
@DirectXMan12: GitHub didn't allow me to assign the following users: caitong93. Note that only kubernetes-incubator members and repo collaborators can be assigned. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…ster OCPBUGS-25164: Bump to 0.7.1
Presently, metrics-server re-uses the TLS config that it constructs for communication with kube-apiserver in its configuration for talking with the kubelets. This is bad because kube-apiserver and kubelet are supposed to (or at least can) use separate CAs. As it stands, bringing metrics-server into the mix requires you to use the same CA for kube-apiserver and your kubelets.
Problem line: https://github.com/kubernetes-incubator/metrics-server/blob/251f7b578894d3f9adfccd9b0cc2127321819fba/metrics/sources/kubelet/configs.go#L67
The text was updated successfully, but these errors were encountered: