-
Notifications
You must be signed in to change notification settings - Fork 716
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
Selfhosting pivoting fails when using --store-certs-in-secrets #1281
Selfhosting pivoting fails when using --store-certs-in-secrets #1281
Comments
I'm fine with waiting till 1.14 on this one. |
I thought this feature was being removed? The issue is likely due to kubernetes/kubernetes#61322. |
@andrewrynhard thanks for pointing this out!
self-hosting was removed from kubeadm init and kubeadm upgrade workflows (both of them in some way not working properly), but it was agreed to leave an alpha command with the pivoting logic that you can call after init; however, be aware that once the cluster is turned to self-hosting you are on your own (e.g. for solving checkpointing / cold restart). |
It looks like api server can't start as etc-client certificates are not created/copied:
What I don't understand is why those certificates are not needed when -store-certs-in-secrets is not used. @neolit123, @fabriziopandini any ideas? |
@bart0sh So
|
@fabriziopandini Thank you for the explanations. I tried to add all etcd certificates, but generating secrets for them fails as their names contain '/', e.g. "etcd/ca". Changing names didn't work either as probably some other piece[s] of this puzzle require names with slashes. I'll dig deeper into this. Any ideas on how to better solve this are appreciated. |
@bart0sh I see your problem. but this is not enough, it is necessary to the corresponding volume projection that places the cert in the expected place as well. If I'm right, this should be done here PS. pay attention to external etcd mode vs local etcd mode |
I did change it in both places, but this was not enough. Changes that you've proposed would trigger errors in generating secrets, as secret names should not contain slashes. Changing name in constants from etc/ca to etc-ca would make api server stuck on start. |
@bart0sh if you can share the generated yaml for the kube-apiserver deamonset might be I can help... |
Selfhosting pivoting fails when using --store-certs-in-secrets as api-server fails to start because of missing etcd/ca and apiserver-etcd-client certificates: F1227 16:01:52.237352 1 storage_decorator.go:57] Unable to create storage backend: config (&{ /registry [https://127.0.0.1:2379] /etc/kubernetes/pki/apiserver-etcd-client.key /etc/kubernetes/pki/apiserver-etcd-client.crt /etc/kubernetes/pki/etcd/ca.crt true 0xc000884120 <nil> 5m0s 1m0s}), err (open /etc/kubernetes/pki/apiserver-etcd-client.crt: no such file or directory) Added required certificates to fix this. Secret name for etc/ca certifcate has been converted to conform RFC-1123 subdomain naming conventions to prevent this TLS secret creation failure: unable to create secret: Secret "etcd/ca" is invalid: metadata.name: Invalid value: "etcd/ca": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*') Related issue: kubernetes/kubeadm#1281
/assign |
/lifecycle active |
@fabriziopandini I've got api server running with the above fix. Thank you for the help! next thing: kube-controller-manager is crashlooping, but kubeadm WaitForPodsWithLabel API manages to catch short moment when it's in running state (not sure how that could be though):
The reason for CrashLoop doesn't matter yet. The issue is that at some point pod status is 'Running'. Do you have any idea why and how to fix this? |
/reopen |
@bart0sh: Reopened 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. |
@neolit123 @kad @rosti do you have any idea why this could happen? |
Modified command line options --authentication-kubeconfig and --authorization-kubeconfig to point out to the correct location of the controller-manager.conf This should fix this controller-manager crash: failed to get delegated authentication kubeconfig: failed to get delegated authentication kubeconfig: stat /etc/kubernetes/controller-manager.conf: no such file or directory Related issue: kubernetes/kubeadm#1281
@bart0sh if I'm not wrong this is fixed now... can you confirm? |
@fabriziopandini not yet. I'm working on it. btw. Can you answer above question, please? |
@bart0sh Instead, I think we should investigate why kube-controller-manager is crashlooping, and make sure this condition is not generated by the self-hosting pivoting logic. Once we are sure the pivoting logic doesn't introduce "regressions" that we can eventually discuss if/how to make the whole process more robust (e.g. by implementig preflight checks or rollback logic). |
…ager Selfhosting pivoting fails when using --store-certs-in-secrets as controller-manager fails to start because of missing front-proxy CA certificate: unable to load client CA file: unable to load client CA file: open /etc/kubernetes/pki/front-proxy-ca.crt: no such file or directory Added required certificate to fix this. This should fix kubernetes/kubeadm#1281
kubeadm alpha selfhosting pivot
(kubeadm v1.13.0-beta.2) fails when invoked with--store-certs-in-secrets
with the following error message:The text was updated successfully, but these errors were encountered: