-
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
x509: certificate signed by unknown authority #146
Comments
It looks like you're trying to validate the kubelet serving certs without having them be signed by the main Kubernetes CA. If you're on metrics-server from before v0.3.0, this can be confirmed with the |
I deployed new kubernetes server 1.12 using kubeadm and then using kubectl create -f deploy/1.8+/ I created metric server , no custom changes were done in either kubelet or metric server of kubernetes API. |
Please try using the |
How and where do I use those flags? I have the same problem but can't find any information on how to use this |
@albrr your metrics-server
|
thanks @k0nstantinv :) |
@DirectXMan12 following recommendations I am employing a Kubelet CA separate from the main CA. But now I get this all the time:
The Apiserver itself can be configured to verify using the Kubelet CA.
I suppose for metrics-server this would be possible too? |
+1 |
Yes, we need a feature to support a separate kubelet CA. @brancz this is becoming a decently common request /kind feature |
While waiting this new feature. It’s possible to mount the certificate inside the pod using a volume or something else ? |
@rayanebel I don't think so as the same cert that is currently used by default for the kubelet is also used (and there it is valid) for the apiserver. If anyone wants to give this a go, please feel free to open a PR 🙂 . |
Just for completeness: We also need the same thing in the Prometheus Adapter. |
@metalmatze feel free to open an issue there. |
Has any progress been made on this? Do/should i need to regenerate the kubelet certificates (we use AWS and Kubeadm)? I cant see why i would need to do that, our pods are being deployed to the nodes... So the kubelet certificates should exist i believe. btw i already have apiserver-kubelet-client.key and apiserver-kubelet-client.crt on master |
there's hasn't been any PR for it yet, IIRC. It's on the list of things to do soon, though. |
I did the following (kubeadm ha cluster):
|
Another
It's basically the same as @desmatz solution, but using the CA key directly instead of using the cert signing API. |
thank you so much! |
@ioanc From what I understood, these solutions intend to be planned in advance for use of metrics server, existing clusters with a separate CA for kubelet and or not using kubeadm do need support to specify kubelet CA public key as suggested by @DirectXMan12 |
when you use kubeadm deploy metrics-server, you can add |
I have the same error:
And the kubelet client certificate is signed by the main CA (kube-apiserver, or are we talking about another one?)
If I pass the I used kubeadm to bootstrap the cluster (single master, 2 workers), no custom setup whatsoever, kubernetes version is 1.13.4. on the master:
on the worker:
metrics-server deployment.yaml:
If you require I can increase the log level. I would appreciate if you can take your time to explain what the issue here is and how I can solve it. |
That works for me too. I added this to my
After starting the master or joining any nodes, the CSRs need to be approved. |
@sarneaud , thanks a lot. Your last comment saved me. @DirectXMan12 , you can ignore my comment. What missing was kubelet-server-[datetime].pem under /var/lib/kubelet/pki in the worker node (also in master obviously), apparently metrics-server needs that certificate and it has to be signed by the /etc/kubernetes/pki/ca.crt which is in the master node, if you want to make things secure by switching off --kubelet-insecure-tls. What I do not get is why metrics-server cannot use /var/lib/kubelet/pki/kubelet-client-[datetime].pem which is also signed by the same ca and it has the same cn as the kubelet-server.pem, except this one is used by kubelet to talk to kube-apiserver. |
To answer my own question
The answer is here:
However even though RotateKubeletServerCertificate is enabled by default, those CSRs will need to be approved (as described in this comment) once the existing server certificate expires --validity is 1 year. |
See: kubernetes-sigs/metrics-server#146 Signed-off-by: Nicolas Lamirault <[email protected]>
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. 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 found this issue is probably caused by kubernetes/kubeadm#1223 My solution is using api proxy by changing the lines in https://github.com/kubernetes-incubator/metrics-server/blob/afbc8a030383caaa0888ea1cdedf7c079f18c048/pkg/sources/summary/client.go#L93-L94 to
rebuild the metrics-server and change https://github.com/kubernetes-incubator/metrics-server/blob/afbc8a030383caaa0888ea1cdedf7c079f18c048/deploy/1.8%2B/resource-reader.yaml#L9-L12 to
Hope this will help someones who struggling to use |
@secret104278 - This is how I have solved it. I have different CA for kubelet certs in my setup.
Metrics server parameter
|
I Got this
|
if you are trying to access an external resource with an SSL generated by letsencrypt you should install the file isrgrootx1.pem.txt as ca-certificates.pem under a ConfigMap in Kubernetes. The ConfigMap should be called for example ca-pemstore. Then on your deployment or pod definition you create a volume from that configMap and a volumeMount on the container with mountPath /etc/ssl/certs/ca-certificates.pem and subPath: ca-certificates.pem (I think the name must match the filename you have on the configMap) I recommend renaming the txt file to ca-certificates.pem and then run the command kubectl -n create configmap ca-pemstore --from-file ca-certificates.pem with that your applications inside the pod will be able to have the root certificate from letsencrypt |
In Metric server pod getting following error.
[restful] 2018/10/01 06:35:24 log.go:33: [restful/swagger] https://:443/swaggerui/ is mapped to folder /swagger-ui/
I1001 06:35:24.584055 1 serve.go:96] Serving securely on [::]:443
E1001 06:36:24.615237 1 manager.go:102] unable to fully collect metrics: unable to fully scrape metrics from source kubelet_summary:kube: unable to fetch metrics from Kubelet kube (kube): Get https://kube:10250/stats/summary/: x509: certificate signed by unknown authority
E1001 06:37:24.543263 1 manager.go:102] unable to fully collect metrics: unable to fully scrape metrics from source kubelet_summary:kube: unable to fetch metrics from Kubelet kube (kube): Get https://kube:10250/stats/summary/: x509: certificate signed by unknown authority
The text was updated successfully, but these errors were encountered: