Skip to content
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

can't get the controlPlaneEndPoint info #2167

Closed
lovexiongmao opened this issue Jun 7, 2020 · 10 comments
Closed

can't get the controlPlaneEndPoint info #2167

lovexiongmao opened this issue Jun 7, 2020 · 10 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@lovexiongmao
Copy link

lovexiongmao commented Jun 7, 2020

BUG REPORT

Versions

kubeadm 1.18

Environment:

  • Kubernetes version (use kubectl version):
    kubernetes 1.18
  • Cloud provider or hardware configuration:
    3U4G
  • OS (e.g. from /etc/os-release):
    centos 7
  • Kernel (e.g. uname -a):
    3.10.0-1127.el7.x86_64 kubeadm join on slave node fails preflight checks #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Others:
    my cluster is setup on bare metal.

What happened?

I config the kubeadm-config.yaml to setup a HA cluster. so I add controlPlaneEndPoint: master01ip:6443 to the kubeadm-config.yaml. And execute "kubeadm init --config=kubeadm-config.yaml --upload-certs |tee kubeadm-init.log" command.
But when the command is done, I can't find the controlPlaneEndPoint info in the configmap of kubeadm by execute "kubectl describe cm kubeadm-config -n kube-system"
Also i can't add a new master to the cluster by the command kubeadm join 172.16.5.181:6443 --token abcdef.0123456789abcdef --discovery-token-ca-cert-hash sha256:4e8b505b63bb06a474e226ced59f762442dbd5a454904974eb8ecc5ed8e52466 --control-plane --certificate-key 357624cba92341cb5350e299dd97f2b379488c9ed352a5249d45cd481a73b0b6 --v=9 I get the error like this "unable to add a new control plane instance a cluster that doesn't have a stable controoint address"

What you expected to happen?

I expected I can see the controlPlaneEndPoint info in the configmap of kubeadm. And I hope I can add new master to the cluster successly.

How to reproduce it (as minimally and precisely as possible)?

just follow the official documentation

Anything else we need to know?

I installed it offline
in the Attached the kubeadm-config.txt is my kubeadm init file. and the kubeadm-configMap.txt is
obtained by command "kubectl describe cm kubeadm-config -n kube-system"
kubeadm-config.txt
kubeadm-configMap.txt

@neolit123
Copy link
Member

hi, are you sure you didn't delete the field controlPlaneEndPoint from the configmap?
as you can see in the kubeadm source code it takes the ClusterConfiguration as YAML and writes to in the config map:
https://github.com/kubernetes/kubernetes/blob/323f34858de18b862d43c40b2cced65ad8e24052/cmd/kubeadm/app/phases/uploadconfig/uploadconfig.go#L105

/priority awaiting-more-evidence

@k8s-ci-robot k8s-ci-robot added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Jun 7, 2020
@lovexiongmao
Copy link
Author

lovexiongmao commented Jun 7, 2020

@neolit123 yes,i'm pretty sure. does somewhere has log the see what going on when it write configuration to the configmap. Maybe is there some reason to make it skip the field

@neolit123
Copy link
Member

neolit123 commented Jun 7, 2020

no, kubeadm just writes the whole ClusterConfiguration.
are you sure you are using the --config file that has the field?

@lovexiongmao
Copy link
Author

@neolit123 yes, you can see that by the attached file. by the way, at the firstly, when I use the command "kubeadm config print init-defaults > kubeadm-config.yaml" to generate the kubeadm-config.yaml. there is no controlPlaneEndPoint in the file. I added this field manually later.

@neolit123
Copy link
Member

@lovexiongmao

when I use the command "kubeadm config print init-defaults > kubeadm-config.yaml" to generate the kubeadm-config.yaml. there is no controlPlaneEndPoint in the file. I added this field manually later.

that is because the print init-defaults commands prints default values and the default value for the control plane endpoint is "".

i tried reproducing the bug:

config:

# config.yaml
kind: ClusterConfiguration
apiVersion: kubeadm.k8s.io/v1beta2
kubernetesVersion: v1.18.2
controlPlaneEndpoint: localhost:6443

command:

kubeadm init ... --config=config.yaml
kubectl get cm kubeadm-config -n kube-system -o yaml | grep controlPlaneEndpoint -C 2
    certificatesDir: /etc/kubernetes/pki
    clusterName: kubernetes
    controlPlaneEndpoint: localhost:6443
    controllerManager: {}
    dns:

as you can see controlPlaneEndpoint: localhost:6443 is present and i don't see a reason why it should not be there.

please verify your setup and let me know if you have more questions.

thanks.
/close

@neolit123 neolit123 added kind/support Categorizes issue or PR as a support question. and removed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Jun 8, 2020
@k8s-ci-robot
Copy link
Contributor

@neolit123: Closing this issue.

In response to this:

@lovexiongmao

when I use the command "kubeadm config print init-defaults > kubeadm-config.yaml" to generate the kubeadm-config.yaml. there is no controlPlaneEndPoint in the file. I added this field manually later.

that is because the print init-defaults commands prints default values and the default value for the control plane endpoint is "".

i tried reproducing the bug:

config:

# config.yaml
kind: ClusterConfiguration
apiVersion: kubeadm.k8s.io/v1beta2
kubernetesVersion: v1.18.2
controlPlaneEndpoint: localhost:6443

command:

kubeadm init ... --config=config.yaml
kubectl get cm kubeadm-config -n kube-system -o yaml | grep controlPlaneEndpoint -C 2
   certificatesDir: /etc/kubernetes/pki
   clusterName: kubernetes
   controlPlaneEndpoint: localhost:6443
   controllerManager: {}
   dns:

as you can see controlPlaneEndpoint: localhost:6443 is present and i don't see a reason why it should not be there.

please verify your setup and let me know if you have more questions.

thanks.
/close

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.

@lovexiongmao
Copy link
Author

@neolit123 I uploaded an operate video to YouTube, and in this video you can see that there is really no controlPlaneEndpoint field.

@neolit123
Copy link
Member

@lovexiongmao thanks for the video. i noticed that you are using controlPlaneEndPoint and not controlPlaneEndpoint, this should fix the problem for you.,

we used to have warnings printed to the user if one of the YAML fields is unknown / malformed but it seems we have a bug that these warnings are no longer printed.

i will log a separate ticket for that.

@neolit123
Copy link
Member

so the issue is already logged and it's in the yaml library that we use:
kubernetes-sigs/yaml#15

@lovexiongmao
Copy link
Author

@neolit123 thank you very much, it work now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

3 participants