-
Notifications
You must be signed in to change notification settings - Fork 715
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
"kubeadm certs" phase uses a hard-coded etcd CA certificate path even in external etcd mode #1276
Comments
i'm pretty sure we had the same report of etcd paths not being respected from the config, but i cannot find the issue - @chuckha and me were assigned at first. this was problematic with upgrades too if i recall correctly. /assign @fabriziopandini @liztio @chuckha |
I was so distracted by the error in front of me concerning the CA file path that I neglected to notice that the client key and certificate paths are also specified in the same As for ignoring this triple altogether, the question is whether running in "external etcd mode" means that the "certs" phase won't try to generate a client certificate, for lack of a CA key, or whether it merely means that etcd is not kubeadm's responsibility to run, but it remains willing to create the certificates needed by the control plane (in this case, the etcd client certificate). Since the |
I'm closing this because of this part was refactored during v1.13 |
@fabriziopandini: 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. |
This is still an issue in version 1.13.1. I don't have the ability to reopen a closed issue, @fabianofranz, but I hope you'll do so. |
This is still an issue in version 1.13.3 |
Any one who solved it ? |
I can't reproduce on 1.13.3
Can you try with this config? apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
etcd:
caFile: "/etc/kubernetes/pki/etcd-ca.crt"
keyFile: "/etc/kubernetes/pki/apiserver-etcd-client.key"
certFile: "/etc/kubernetes/pki/apiserver-etcd-client.crt"
endpoints:
- "https://etcd0.000-003.kubernetes.local:2379"
- "https://etcd1.000-003.kubernetes.local:2379"
- "https://etcd2.000-003.kubernetes.local:2379"
|
@seh @nasir03082409229 |
@neolit123 I've experienced this same behavior in 1.13.5 with both |
Thanks for verify it @marc-sensenich |
we need verification for 1.14 and 1.15. cc @ereslibre |
/lifecycle active |
@seh |
Thank you! We worked around it by conforming to the expected name, but I look forward to less surprise and more freedom in the next release. I'll go take a look at your kubernetes/kubernetes#80867. |
Since there is a fix merged, I close this one. /close |
@rosti: 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. |
What keywords did you search in kubeadm issues before filing this one?
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
kubeadm version (use
kubeadm version
):Environment:
kubectl version
):AWS EC2
uname -a
):Linux ip-10-105-51-211 4.14.78-coreos #1 SMP Mon Nov 5 17:42:07 UTC 2018 x86_64 Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz GenuineIntel GNU/Linux
What happened?
I am running kubeadm in "external etcd mode," where I've placed my etcd CA certificate and API etcd client key and certificate on the machine on which I then run kubeadm init. In my
ClusterConfiguration
manifest within my configuration file, I have the following stanza:Note the path to the etcd CA certificate file: /etc/kubernetes/pki/etcd-ca.crt.
When I run kubeadm init, it fails as reported in #918:
What you expected to happen?
kubeadm init should have found the etcd CA certificate at the path specified in my configuration file: /etc/kubernetes/pki/etcd-ca.crt. Instead, it's demanding that I adhere to the hard-coded path /etc/kubernetes/pki/etcd/ca.crt.
How to reproduce it (as minimally and precisely as possible)?
Deny kubeadm init access to the etcd CA key file, but provide it the etcd CA certificate file and the corresponding API server etcd client key and certificate files. In the
ClusterConfiguration
manifest, populate the "etcd.external" mapping—crucially, the "caFile" field—with a non-default but otherwise valid path.Run kubeadm init --conifg , and observe it failing in the "certs" phase due to it not finding the etcd CA certificate file where it expected it to be.
Anything else we need to know?
I diagnosed what I think the cause of the problem is in #918, which I'll reproduce here.
In cmd/kubeadm/app/cmd/phases/certs.go's
newCertSubPhases
function, we use the default certificate set, whether or not etcd is external or local. That default set includes an entry for the API server etcd client triple (CA certificate, client key, and client certificate), and that entry (KubeadmCertEtcdAPIClient
) nominates a CA certificate that has a hard-coded basename path, which is defined as etcd/ca.If we're using an externally hosted etcd, then when we go looking for its CA certificate, we should honor the configuration's
ExternalEtcd.CAFile
field. Doing that is not so simple, given the current data-driven approach in this procedure.Perhaps the
KubeadmCert
type could introduce a "CANameFunc" field of typefunc(*kubeadmapi.InitConfiguration) (string)
(orfunc(*kubeadmapi.InitConfiguration) (string, error)
) that could return a path predicated on whether etcd is hosted locally or externally. Alternately, we could use some interface that delegates toKubeadmCert
, but has an alternate implementation that uses an etcd CA certificate path read from configuration.While we're here, I'll note that the previous path to the etcd CA certificate file that went along with the API server etcd client key pair had been etcd-ca.crt, but now it's etcd/ca.crt. That change warrants a release note given this defect, but if we fix this problem, then the change in the default path wouldn't matter as much.
The text was updated successfully, but these errors were encountered: