Skip to content

[BUG] Cannot find kubeconfig for some environments #301

@nayutah

Description

@nayutah

Describe the bug
For k8s env created by k3s, get error when install kubeblocks
slc@kata-1:~$ kbcli kubeblocks install --version="0.8.2"
The connection to the server localhost:8080 was refused - did you specify the right host or port?

kbcli cannot find the kubeconfig file when traversing all possible config paths:
openat(AT_FDCWD, "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", O_RDONLY) = 3
openat(AT_FDCWD, "/etc/localtime", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/local/bin/kbcli", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/sys/kernel/cap_last_cap", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/stat", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/stat", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/slc/.kbcli/cluster_types", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/home/slc/.kbcli/charts", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/home/slc/.kbcli/cluster_types", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 7
openat(AT_FDCWD, "/home/slc/.kube/config", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/etc/hosts", O_RDONLY|O_CLOEXEC) = 7

Then at last, it uses the 'localhost:8080' to have another try.

Please give more suggestions when no kubeconfig is available.
For e.g, "Please set the right kubeconfig file to /home/$user/.kube/.kubeconfig"
Or adapt to other k8s envs like k3s/k0s/minikube....

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions