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

#186 broke k0sctl kubeconfig #196

Closed
rgl opened this issue Aug 29, 2021 · 6 comments
Closed

#186 broke k0sctl kubeconfig #196

rgl opened this issue Aug 29, 2021 · 6 comments

Comments

@rgl
Copy link

rgl commented Aug 29, 2021

I had to revert #186 to be able to use k0sctl kubeconfig (it hangs and never returns anything).

Can you please verify what is going on?

Using 658cd39 (which is v0.10.0-beta.2) and reverting #186 works fine here.

I'm using this with k0s v1.21.3+k0s.0.

@kke
Copy link
Contributor

kke commented Aug 30, 2021

Odd, I don't see how it could break kubeconfig as it doesn't use the spec.api.port for anything but to replace the port number in the api url. I updated #182 to use main to verify.

@kke
Copy link
Contributor

kke commented Aug 30, 2021

Now it seems to give level=fatal msg="PANIC: interface conversion: interface {} is nil, not int"

@kke
Copy link
Contributor

kke commented Aug 30, 2021

Fixed that panic with a typecheck, and the tests pass fine. I don't see where it could hang. Can you get any clue from --debug where it's blocking?

@rgl
Copy link
Author

rgl commented Aug 30, 2021

Here's the --debug output with 658cd39:

time="2021-08-30T14:41:51+01:00" level=debug msg="Preparing phase 'Connect to hosts'"
time="2021-08-30T14:41:51+01:00" level=info msg="==> Running phase: Connect to hosts"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: executing `uname | grep -q Linux`"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: executing `cat /etc/os-release || cat /usr/lib/os-release`"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: NAME=\"Ubuntu\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: VERSION=\"20.04.2 LTS (Focal Fossa)\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: ID=ubuntu"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: ID_LIKE=debian"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: PRETTY_NAME=\"Ubuntu 20.04.2 LTS\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: VERSION_ID=\"20.04\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: HOME_URL=\"https://www.ubuntu.com/\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: SUPPORT_URL=\"https://help.ubuntu.com/\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: BUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: PRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\""
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: VERSION_CODENAME=focal"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: UBUNTU_CODENAME=focal"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: executing `[ \"$(id -u)\" = 0 ]`"
time="2021-08-30T14:41:51+01:00" level=info msg="[ssh] 10.10.0.10:22: connected"
time="2021-08-30T14:41:51+01:00" level=debug msg="Preparing phase 'Detect host operating systems'"
time="2021-08-30T14:41:51+01:00" level=info msg="==> Running phase: Detect host operating systems"
time="2021-08-30T14:41:51+01:00" level=info msg="[ssh] 10.10.0.10:22: is running Ubuntu 20.04.2 LTS"
time="2021-08-30T14:41:51+01:00" level=debug msg="Preparing phase 'Get admin kubeconfig'"
time="2021-08-30T14:41:51+01:00" level=info msg="==> Running phase: Get admin kubeconfig"
time="2021-08-30T14:41:51+01:00" level=debug msg="[ssh] 10.10.0.10:22: executing `cat /var/lib/k0s/pki/admin.conf 2> /dev/null`"
time="2021-08-30T14:41:51+01:00" level=fatal msg="PANIC: interface conversion: interface {} is nil, not int"

BTW, it would be nice that the logging would be written to stderr, that way we could always use --debug while redirect stdout to the kubeconfig file.

I will try with the latest revision.

@kke
Copy link
Contributor

kke commented Aug 30, 2021

The debug log always goes to the cache dir (~/.k0sctl/cache/k0sctl.log or /var/cache/k0sctl/k0sctl.log) even if you don't use --debug.

The panic is what I fixed in the beta.3. You mentioned that something froze forever?

@rgl
Copy link
Author

rgl commented Aug 30, 2021

nice to known about the k0sctl.log files!

590faf6 (aka beta.3) fixed the problem I was having! :-)

for some reason, k0sctl kubeconfig --config /vagrant/shared/k0sctl.yaml seemed to never return to the prompt. but whatever it was, now worked :-)

Thank you!

@rgl rgl closed this as completed Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants