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

'kubeadm join' fails if apiServerEndpoint use [IPv6]:port notation #3101

Closed
doka380 opened this issue Aug 22, 2024 · 2 comments
Closed

'kubeadm join' fails if apiServerEndpoint use [IPv6]:port notation #3101

doka380 opened this issue Aug 22, 2024 · 2 comments
Labels
kind/support Categorizes issue or PR as a support question.
Milestone

Comments

@doka380
Copy link

doka380 commented Aug 22, 2024

What keywords did you search in kubeadm issues before filing this one?

apiServerEndpoint, IPv6

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version: 1.31.0

Environment:

  • Kubernetes version: 1.31.0
  • Cloud provider or hardware configuration: on-premises QEMU-based virtualization
  • OS (e.g. from /etc/os-release): Ubuntu 24.04
  • Kernel (e.g. uname -a): 6.8.0.41
  • Container runtime (CRI): containerd
  • Container networking plugin (CNI): Flannel

What happened?

When joining cluster with custom YAML file, the following configuration (specifically - apiServerEndpoint) fails:

apiVersion: kubeadm.k8s.io/v1beta4
kind: JoinConfiguration
nodeRegistration:
  criSocket: "unix:///run/containerd/containerd.sock"
  kubeletExtraArgs:
  - name: node-ip
    value: "x.x.x.x,,2a01:xxxx:xxxx:xxxx:1715::1ea"
discovery:
  bootstrapToken:
    apiServerEndpoint: [2a01:xxxx:xxxx:xxxx:1715::19e]:6443
    token: "nyb6dc.s58lqvo1c02tje0w"
    caCertHashes:
    - "sha256:828b7916ec2e27717e1956d10ed2a4c3dca66516dc6e3a0ea919153657757aef"
	[ ... ]

with the message

I0822 10:43:21.602530   42333 joinconfiguration.go:83] loading configuration from "gen-join-kw1.yml"
could not interpret GroupVersionKind; unmarshal error: error converting YAML to JSON: yaml: line 9: did not find expected key

but if I change apiServerEndpoint parameter to fqdn:6443, it passes through this step. At the same time, the following CLI command (using the same syntax [IPv6]:port) do not produce error messages:

sudo kubeadm join [2a01:xxxx:xxxx:xxxx:1715::19e]:6443 --token nyb6dc.s58lqvo1c02tje0w \
        --discovery-token-ca-cert-hash sha256:828b7916ec2e27717e1956d10ed2a4c3dca66516dc6e3a0ea919153657757aef

and, using the same notation for controlPlaneEndpoint in ClusterConfiguration during kubeadm init :

apiVersion: kubeadm.k8s.io/v1beta4
kind: ClusterConfiguration
networking:
  podSubnet: fd53:ba5e:ba11::/48
  serviceSubnet: fd53:babe:c001::/112
controlPlaneEndpoint: "[2a01:xxxx:xxxx:xxxx:1715::19e]:6443"

passed successfully.

What you expected to happen?

I'm expecting that using notation [IPv6]:port should not produce errors, if this notation works in CLI and in other configurations of kubeadm.

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

Try to initialize single controller and join single worker in IPv6-based environment, using IP addresses instead of FQDNs.

Anything else we need to know?

I like Kubernetes :-)

@neolit123
Copy link
Member

could not interpret GroupVersionKind; unmarshal error: error converting YAML to JSON: yaml: line 9: did not find expected key

this is a problem from the sigs.k8s.io/yaml library which core k8s and kubeadm use.

i think it's a matter of quoting the value. please try:
apiServerEndpoint: "[2a01:xxxx:xxxx:xxxx:1715::19e]:6443"

notice how the quoted one works on init:
controlPlaneEndpoint: "[2a01:xxxx:xxxx:xxxx:1715::19e]:6443"

@neolit123 neolit123 added the kind/support Categorizes issue or PR as a support question. label Aug 22, 2024
@neolit123 neolit123 added this to the v1.31 milestone Aug 22, 2024
@doka380
Copy link
Author

doka380 commented Aug 22, 2024

Yup, thank you very much, it was about quoting. Thanks again :)

@doka380 doka380 closed this as completed Aug 22, 2024
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

2 participants