k0sproject / k0sctl

A bootstrapping and management tool for k0s clusters.
Other
370 stars 76 forks source link

k0sctl apply fails following the docs' steps #742

Closed iapicca closed 1 week ago

iapicca commented 1 month ago

I'm opening this as a bug, but it's probably my fault since I'm new to this if isn't a bug feel free to close the issue and if you can help me here

anyhow

after installing k0sctl (see environment below)\ and generating k0sctl.yaml (see docs)\ the command k0sctl apply --config k0sctl.yaml fails with the error below

⠀⣿⣿⡇⠀⠀⢀⣴⣾⣿⠟⠁⢸⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀█████████ █████████ ███
⠀⣿⣿⡇⣠⣶⣿⡿⠋⠀⠀⠀⢸⣿⡇⠀⠀⠀⣠⠀⠀⢀⣠⡆⢸⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀███          ███    ███
⠀⣿⣿⣿⣿⣟⠋⠀⠀⠀⠀⠀⢸⣿⡇⠀⢰⣾⣿⠀⠀⣿⣿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀███          ███    ███
⠀⣿⣿⡏⠻⣿⣷⣤⡀⠀⠀⠀⠸⠛⠁⠀⠸⠋⠁⠀⠀⣿⣿⡇⠈⠉⠉⠉⠉⠉⠉⠉⠉⢹⣿⣿⠀███          ███    ███
⠀⣿⣿⡇⠀⠀⠙⢿⣿⣦⣀⠀⠀⠀⣠⣶⣶⣶⣶⣶⣶⣿⣿⡇⢰⣶⣶⣶⣶⣶⣶⣶⣶⣾⣿⣿⠀█████████    ███    ██████████
k0sctl v0.18.1 Copyright 2023, k0sctl authors.
Anonymized telemetry of usage will be sent to the authors.
By continuing to use k0sctl you agree to these terms:
https://k0sproject.io/licenses/eula
INFO ==> Running phase: Set k0s version
INFO Looking up latest stable k0s version
INFO Using k0s version v1.30.2+k0s.0
INFO ==> Running phase: Connect to hosts
INFO ==> Apply failed
FATA apply failed - log file saved to /Users/francesco/Library/Caches/k0sctl/k0sctl.log: failed on 2 hosts:
 - [SSH] 10.0.0.2: retrying aborted
not connected: client connect: can't connect: create config: can't connect: no usable authentication method found
 - [SSH] 10.0.0.1: retrying aborted
not connected: client connect: can't connect: create config: can't connect: no usable authentication method found

here is the content of k0sctl.log


time="22 Jul 24 18:10 EEST" level=info msg="###### New session ######"
time="22 Jul 24 18:17 EEST" level=info msg="###### New session ######"
time="22 Jul 24 18:17 EEST" level=debug msg="Loaded configuration:\napiVersion: k0sctl.k0sproject.io/v1beta1\nkind: Cluster\nmetadata:\n  name: k0s-cluster\nspec:\n  hosts:\n  - ssh:\n      address: 10.0.0.1\n      user: root\n      port: 22\n      keyPath: null\n    role: controller\n  - ssh:\n      address: 10.0.0.2\n      user: root\n      port: 22\n      keyPath: null\n    role: worker"
time="22 Jul 24 18:17 EEST" level=debug msg="Preparing phase 'Set k0s version'"
time="22 Jul 24 18:17 EEST" level=info msg="\x1b[32m==> Running phase: Set k0s version\x1b[0m"
time="22 Jul 24 18:17 EEST" level=info msg="Looking up latest stable k0s version"
time="22 Jul 24 18:17 EEST" level=info msg="Using k0s version v1.30.2+k0s.0"
time="22 Jul 24 18:17 EEST" level=debug msg="Preparing phase 'Connect to hosts'"
time="22 Jul 24 18:17 EEST" level=info msg="\x1b[32m==> Running phase: Connect to hosts\x1b[0m"
time="22 Jul 24 18:17 EEST" level=debug msg="[ssh] 10.0.0.1:22: HashKnownHosts is set to \"no\", won't hash newly added keys"
time="22 Jul 24 18:17 EEST" level=debug msg="using SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TWJWMxxKwR/Listeners"
time="22 Jul 24 18:17 EEST" level=debug msg="[ssh] 10.0.0.2:22: HashKnownHosts is set to \"no\", won't hash newly added keys"
time="22 Jul 24 18:17 EEST" level=debug msg="using SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TWJWMxxKwR/Listeners"
time="22 Jul 24 18:17 EEST" level=debug msg="[SSH] 10.0.0.2: failed to connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:17 EEST" level=debug msg="[SSH] 10.0.0.1: failed to connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:17 EEST" level=info msg="\x1b[31m==> Apply failed\x1b[0m"
time="22 Jul 24 18:17 EEST" level=fatal msg="apply failed - log file saved to /Users/francesco/Library/Caches/k0sctl/k0sctl.log: failed on 2 hosts:\n - [SSH] 10.0.0.2: retrying aborted\nnot connected: client connect: can't connect: create config: can't connect: no usable authentication method found\n - [SSH] 10.0.0.1: retrying aborted\nnot connected: client connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:25 EEST" level=info msg="###### New session ######"
time="22 Jul 24 18:25 EEST" level=debug msg="Loaded configuration:\napiVersion: k0sctl.k0sproject.io/v1beta1\nkind: Cluster\nmetadata:\n  name: k0s-cluster\nspec:\n  hosts:\n  - ssh:\n      address: 10.0.0.1\n      user: root\n      port: 22\n      keyPath: null\n    role: controller\n  - ssh:\n      address: 10.0.0.2\n      user: root\n      port: 22\n      keyPath: null\n    role: worker\n"
time="22 Jul 24 18:25 EEST" level=debug msg="[ssh] 10.0.0.1:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:25 EEST" level=debug msg="[ssh] 10.0.0.2:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:25 EEST" level=debug msg="Preparing phase 'Set k0s version'"
time="22 Jul 24 18:25 EEST" level=info msg="\x1b[32m==> Running phase: Set k0s version\x1b[0m"
time="22 Jul 24 18:25 EEST" level=info msg="Looking up latest stable k0s version"
time="22 Jul 24 18:25 EEST" level=info msg="Using k0s version v1.30.2+k0s.0"
time="22 Jul 24 18:25 EEST" level=debug msg="Preparing phase 'Connect to hosts'"
time="22 Jul 24 18:25 EEST" level=info msg="\x1b[32m==> Running phase: Connect to hosts\x1b[0m"
time="22 Jul 24 18:25 EEST" level=debug msg="[ssh] 10.0.0.2:22: HashKnownHosts is set to \"no\", won't hash newly added keys"
time="22 Jul 24 18:25 EEST" level=debug msg="using SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TWJWMxxKwR/Listeners"
time="22 Jul 24 18:25 EEST" level=debug msg="[ssh] 10.0.0.1:22: HashKnownHosts is set to \"no\", won't hash newly added keys"
time="22 Jul 24 18:25 EEST" level=debug msg="using SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TWJWMxxKwR/Listeners"
time="22 Jul 24 18:25 EEST" level=debug msg="[ssh] 10.0.0.2:22: key /Users/francesco/.ssh/id_ed25519 is encrypted"
time="22 Jul 24 18:25 EEST" level=debug msg="[ssh] 10.0.0.2:22: failed to obtain a signer for identity /Users/francesco/.ssh/id_ed25519: can't connect: can't parse keyfile: /Users/francesco/.ssh/id_ed25519: ssh: this private key is passphrase protected"
time="22 Jul 24 18:25 EEST" level=debug msg="[SSH] 10.0.0.2: failed to connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:25 EEST" level=debug msg="[SSH] 10.0.0.1: failed to connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:25 EEST" level=info msg="\x1b[31m==> Apply failed\x1b[0m"
time="22 Jul 24 18:25 EEST" level=fatal msg="apply failed - log file saved to /Users/francesco/Library/Caches/k0sctl/k0sctl.log: failed on 2 hosts:\n - [SSH] 10.0.0.2: retrying aborted\nnot connected: client connect: can't connect: create config: can't connect: no usable authentication method found\n - [SSH] 10.0.0.1: retrying aborted\nnot connected: client connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:57 EEST" level=info msg="###### New session ######"
time="22 Jul 24 18:57 EEST" level=debug msg="[ssh] 10.0.0.1:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:57 EEST" level=debug msg="[ssh] 10.0.0.2:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:58 EEST" level=info msg="###### New session ######"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.1:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.2:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:58 EEST" level=info msg="###### New session ######"
time="22 Jul 24 18:58 EEST" level=debug msg="Loaded configuration:\napiVersion: k0sctl.k0sproject.io/v1beta1\nkind: Cluster\nmetadata:\n  name: k0s-cluster\nspec:\n  hosts:\n  - ssh:\n      address: 10.0.0.1\n      user: root\n      port: 22\n      keyPath: null\n    role: controller\n  - ssh:\n      address: 10.0.0.2\n      user: root\n      port: 22\n      keyPath: null\n    role: worker\n"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.1:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.2:22: using identity file /Users/francesco/.ssh/id_ed25519"
time="22 Jul 24 18:58 EEST" level=debug msg="Preparing phase 'Set k0s version'"
time="22 Jul 24 18:58 EEST" level=info msg="\x1b[32m==> Running phase: Set k0s version\x1b[0m"
time="22 Jul 24 18:58 EEST" level=info msg="Looking up latest stable k0s version"
time="22 Jul 24 18:58 EEST" level=info msg="Using k0s version v1.30.2+k0s.0"
time="22 Jul 24 18:58 EEST" level=debug msg="Preparing phase 'Connect to hosts'"
time="22 Jul 24 18:58 EEST" level=info msg="\x1b[32m==> Running phase: Connect to hosts\x1b[0m"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.2:22: HashKnownHosts is set to \"no\", won't hash newly added keys"
time="22 Jul 24 18:58 EEST" level=debug msg="using SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TWJWMxxKwR/Listeners"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.1:22: HashKnownHosts is set to \"no\", won't hash newly added keys"
time="22 Jul 24 18:58 EEST" level=debug msg="using SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.TWJWMxxKwR/Listeners"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.2:22: key /Users/francesco/.ssh/id_ed25519 is encrypted"
time="22 Jul 24 18:58 EEST" level=debug msg="[ssh] 10.0.0.2:22: failed to obtain a signer for identity /Users/francesco/.ssh/id_ed25519: can't connect: can't parse keyfile: /Users/francesco/.ssh/id_ed25519: ssh: this private key is passphrase protected"
time="22 Jul 24 18:58 EEST" level=debug msg="[SSH] 10.0.0.2: failed to connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:58 EEST" level=debug msg="[SSH] 10.0.0.1: failed to connect: can't connect: create config: can't connect: no usable authentication method found"
time="22 Jul 24 18:58 EEST" level=info msg="\x1b[31m==> Apply failed\x1b[0m"
time="22 Jul 24 18:58 EEST" level=fatal msg="apply failed - log file saved to /Users/francesco/Library/Caches/k0sctl/k0sctl.log: failed on 2 hosts:\n - [SSH] 10.0.0.2: retrying aborted\nnot connected: client connect: can't connect: create config: can't connect: no usable authentication method found\n - [SSH] 10.0.0.1: retrying aborted\nnot connected: client connect: can't connect: create config: can't connect: no usable authentication method found"

any idea what's the issue?

Environment

k0sctl version
version: v0.18.1
commit: 53248d6
                    'c.          francesco@Francescos-MacBook-Air.local
                 ,xNMM.          --------------------------------------
               .OMMMMo           OS: macOS 14.5 23F79 arm64
               OMMM0,            Host: MacBookAir10,1
     .;loddo:' loolloddol;.      Kernel: 23.5.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 4 days, 11 hours, 43 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 108 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1440x900
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: WarpTerminal
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   CPU: Apple M1
    kMMMMMMMMMMMMMMMMMMMMMMd     GPU: Apple M1
     ;KMMMMMMMWXXWMMMMMMMk.      Memory: 1577MiB / 8192MiB
       .cooc,.    .,coo:.
twz123 commented 1 month ago

no usable authentication method found

Does logging in via plain ssh work?

till commented 1 month ago

I think I tried this before but got stuck on passphrases as well. If you use another key, it should work? Or add it to the agent?