dashboard: Dashboard complaints on startup: x509: failed to load system roots and no roots provided
Issue details
I’m following the documentation at http://kubernetes.io/docs/user-guide/ui/, but it fails at the first step already. The container fails to start with the log entry:
Starting HTTP server on port 9090
Creating API server client for https://10.101.10.1:443
E0927 10:59:50.111556 1 config.go:267] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get https://10.101.10.1:443/version: x509: failed to load system roots and no roots provided
Nowhere on that page is it explained how to deal with this issue and a Google search doesn’t provide enlightment. We have serviceaccounts enabled and the pod has the default one attached. When I take a look at the serviceaccount with describe, I get the following:
Name: default
Namespace: kube-system
Labels: <none>
Image pull secrets: <none>
Mountable secrets: default-token-6x2t1
Tokens: default-token-6x2t1
I have no idea how to continue from here. Which cert is dashboard looking for? What’s the best way of getting that into the container? Also, is the documentation outdated or am I doing something weird, as the (pretty simple) recipe does not seem to work for me.
Environment
We’re running the containers on CoreOS running on AWS. Currently running 1.3.6, planning on updating to 1.4.0 somewhere soon.
Dashboard version: v1.4.0
Kubernetes version: v1.3.6
Operating system: CoreOS stable
Node.js version: Not sure, using the default gcr image
Go version: Same as Node.js version
Steps to reproduce
Follow the guide as described here: http://kubernetes.io/docs/user-guide/ui/
Observed result
Starting HTTP server on port 9090
Creating API server client for https://10.101.10.1:443
E0927 10:59:50.111556 1 config.go:267] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to
a server that does not exist. Reason: Get https://10.101.10.1:443/version: x509: failed to load system roots and no roots provided
And than the pod stays in CrashLoopBackOff status.
Expected result
A working UI!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 27 (9 by maintainers)
Cluster configuration
Keep in mind that this is my dev configuration. I’m also using certificate based authentication to connect to the cluster. You can enable more authentication/authorization plugins if you want. This is just my basic setup.
API Server
Kubelet
Controller manager
Proxy
Scheduler
Kubeconfig
Certificates configuration
I’m using my simple script to generate needed certs. Correct SAN address/hostname needs to be set in openssl config file.
Config & script
By installing my admin certificate in browser I can connect to deployed dashboard. More about how to do this kubernetes/kubernetes#31665.
Note: You may have to delete default secrets and dashboard pod in order for it to pick up service accounts. After that it should work.
I’m still wondering why the default didn’t work for you… I’ll keep this open for further investigation.
Of course:
apiserver:
For good measure, here’s controller as well:
And scheduler:
Also, our kubeconfig:
Ah, the kubeconfig flag has been added after 1.4 release. Can you check out latest
:canarytag or compile dashboard at HEAD?Alas: