-
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
Cannot join control plane to existing cluster with automatic copy of certificates (1.18) #2386
Comments
as you can see kubeadm already does that during kubeadm init, when the certs are uploaded. make sure that you are not skipping the "upload-certs" phase of "kubeadm init". this also works fine in all of our e2e tests. /kind support |
i cannot see anything wrong in your steps. make sure that you are not joining the node to a different cluster e.g. a cluster not created by kubeadm. i tried reproducing your problem with the exact steps here https://www.katacoda.com/courses/kubernetes/playground (1.18) and it worked fine. closing as we usually don't provide support in this issue tracker, but feel free to update here with your findings. #kubeadm on k8s slack or the support channels are a good way to get help with kubeadm: |
Thank you for your answer.
I'm 100% positive this is not what happens since the VM I use to make my tests have a short span of life and there isn't anything beside them in the environment they are created.
I did not skip any phase intentionally. The command my ansible role is using is exactly Is it possible the configuration file I provided implicitly skip some phase? I'm not really comfortable with its syntax. I'll try to do some more tests and will join #kubeadm channel on slack. |
skipping phases via the config is not supported yet: given you have:
it should call the "upload-certs" phase. |
I ran the same command again on a new VM only to find in the logs
I created a new VM to try
My bad, I guess this is the intended behavior and I feel stupid for overlooking this. Thanks again for your time. |
no problem. one potential improvement would be on this line: to add the following:
and the user would not have to pass the |
Same issue with kube 1.27.x
Here's how I got that key:
Looks like clusterrolebindings will only be created if upload certs set during init |
but if the certificatekey is in the clusterconfigutation in kube-system/kubeadm-config cm, then join would not skip download of the secret and the rbac is needed. |
What keywords did you search in kubeadm issues before filing this one?
join
control plane
cert
certificate
automatic
Multiple combinations of the above keywords.
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
kubeadm version (use
kubeadm version
):Environment:
kubectl version
):Oracle Cloud VM for each node (Virtual Machine, 2 core OCPU, 16 GB memory)
Oracle Linux Server 8.3
uname -a
):5.4.17-2036.102.0.2.el8uek.x86_64
What happened?
While working on an ansible playbook to initialize, configure and join kubernetes clusters, I created my first control plane with
kubeadm init --config="init.yaml"
using the following configuration file:(not relevant to this issue but I know cgroup-driver information is redundant in this configuration, I'm not sure yet which one to remove and for now it only triggers a warning. I'm in a test phase so I did let both stay.)
I then used the following command to generate a token (and a command) for control planes to be able to join the new cluster:
kubeadm token create --description='ansible generated token for control planes' --ttl=1h --print-join-command --certificate-key='{{ kubernetes_cluster_certificate_key }}'
, giving me the following string:kubeadm join kube.test.local:6443 --token ja3yw2.whwccz9hz7upm6ow --discovery-token-ca-cert-hash sha256:REDACTED --control-plane --certificate-key REDACTED
that I used on a second machine.I verified the token existence with
kubeadm token list
:The output of the given command with
-v=5
is as follow (truncated):I had to add a ClusterRole and ClusterRoleBinding as follow (I used
ClusterRole{,Binding}/kubeadm:get-nodes
as template):I then used the same
kubeadm join ...
command which successfully added this node to the cluster as a control plane.What you expected to happen?
I expected the second control plane to join the first time and not to have to add the ClusterRole and ClusterRoleBinding.
How to reproduce it (as minimally and precisely as possible)?
By using the configuration file and the two or three commands I wrote in this issue.
(Basically, just initialize a cluster where the certificates are uploaded in a secret and try to join other control planes.)
Anything else we need to know?
kube-router
.The text was updated successfully, but these errors were encountered: