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

k8s: stop using sudo kubectl for kubeconfig #2102

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Dec 28, 2023

Applies change from 0aed871

The connection to the server localhost:8080 was refused - did you specify the right host or port?

Reverts the previous a5427dd

Still need to run sudo crictl

cmd/kubectl.lima Outdated Show resolved Hide resolved
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@AkihiroSuda
Copy link
Member

What's current status?

@afbjorklund
Copy link
Member Author

afbjorklund commented Jan 9, 2024

I restored the old code, for backwards functionality with existing instances, so now it should work for both.

  exec lima sudo kubectl "$@"
    mkdir -p ${HOME:-/root}/.kube && cp -f $KUBECONFIG ${HOME:-/root}/.kube/config

We could do a symlink or something, if we wanted to avoid the copy (for root) user. Or just have it fail (as intended*).

* k3s comes with a default, but k8s comes with an old default that is not supported anymore (http:8080, not https:6443)

The connection to the server localhost:8080 was refused - did you specify the right host or port?

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#more-information

It wouldn't have worked anyway (without the cert), but it won't find /etc/kubernetes/admin.conf either

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed again that the code had been updated.

Everything looks good to me and can be merged.

@jandubois jandubois merged commit 2d36601 into lima-vm:master Jan 10, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants