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

panic: runtime error: index out of range [0] with length 0 with ipv6 calico config file #2452

Open
haodengeke opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@haodengeke
Copy link

haodengeke commented Nov 5, 2024

What is version of KubeKey has the issue?

v3.1.7

What is your os environment?

Ubuntu22.04

KubeKey config file

cat config.yaml
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
  name: sample
spec:
  hosts:
    - {name: ubuntu, address: "127.0.0.1", internalAddress: "127.0.0.1", privateKeyPath: "~/.ssh/id_ed25519"}
  roleGroups:
    etcd:
    - ubuntu
    control-plane:
    - ubuntu
    worker:
    - ubuntu
  controlPlaneEndpoint:
    ## Internal loadbalancer for apiservers
    # internalLoadbalancer: haproxy

    domain: ::1
    address: ""
    port: 6443
  kubernetes:
    version: v1.28.6
    clusterName: cluster.local
    autoRenewCerts: true
    containerManager: containerd
    # apiserverArgs:
    # - service-node-port-range=1-65535
  etcd:
    type: kubekey
  network:
    plugin: calico
    kubePodsCIDR: "fd00:10:244::/48"
    kubeServiceCIDR: "fd00:10:245::/112"
    ## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
    multusCNI:
      enabled: true
  addons: []

A clear and concise description of what happend.

I want to deploy a standalone cluster of k8s and with calico's ipv6, but I found index out of range [0] with length 0 error. May i ask does kubekey support ipv6? or is my configuration wrong? I would be delighted to receive a response,thx

Relevant log output

11:18:37 CST [InstallKubeBinariesModule] Enable kubelet service
11:18:37 CST success: [ubuntu]
11:18:37 CST [InstallKubeBinariesModule] Generate kubelet env
11:18:37 CST success: [ubuntu]
11:18:37 CST [InitKubernetesModule] Generate kubeadm config
panic: runtime error: index out of range [0] with length 0

goroutine 633 [running]:
github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util.networkRange(0xc00063f890)
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util/ip.go:125 +0x14e
github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util.GetAvailableIP({0xc00051bc50?, 0x11?})
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util/ip.go:79 +0x4a
github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util.ParseIp({0xc00051bc50?, 0x11?})
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/util/ip.go:40 +0xfd
github.com/kubesphere/kubekey/v3/cmd/kk/apis/kubekey/v1alpha2.(*ClusterSpec).GenerateCertSANs(0xc0002c3800)
	github.com/kubesphere/kubekey/v3/cmd/kk/apis/kubekey/v1alpha2/cluster_types.go:157 +0x2b8
github.com/kubesphere/kubekey/v3/cmd/kk/pkg/kubernetes.(*GenerateKubeadmConfig).Execute(0xc000a686e0, {0x2890ed0, 0xc0002e6a80})
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/kubernetes/tasks.go:294 +0x14bb
github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/task.(*RemoteTask).ExecuteWithRetry(0xc000afea80, {0x2890ed0, 0xc0002e6a80})
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/task/remote_task.go:216 +0x119
github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/task.(*RemoteTask).Run(0xc000afea80, {0x2890ed0, 0xc0002e6a80}, {0x2897cb0, 0xc00071c9f0}, 0x9a3e06?, 0xc000534780?)
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/task/remote_task.go:152 +0x1c5
created by github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/task.(*RemoteTask).RunWithTimeout
	github.com/kubesphere/kubekey/v3/cmd/kk/pkg/core/task/remote_task.go:109 +0x16d

Additional information

No response

@haodengeke haodengeke added the bug Something isn't working label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant