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

Issues with known_hosts and kubectl when using k0sctl to create then reset an IPv6 cluster #461

Open
emchristiansen opened this issue Feb 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@emchristiansen
Copy link

I have a config like this:

apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster
metadata:
  name: k0s-cluster
spec:
  - ssh:
      address: 2600:1f13:2fc:8803:76b1:42d7:be29:16f8
      user: ubuntu
      port: 22
      keyPath: <redacted>
    role: controller+worker
  k0s:
    version: 1.26.1+k0s.0
    dynamicConfig: false

When I run k0sctl apply --config k0sctl.yaml and then k0sctl reset -f --config k0sctl.yaml I get this error during the reset:

k0sctl v0.15.0 Copyright 2022, 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: Connect to hosts
ERRO [SSH] 2600:1f13:2fc:8803:76b1:42d7:be29:16f8: failed to connect: not connected: client connect: can't connect: create config: can't connect: create host key validator: check hostkey: knownhosts callback: knownhosts: /home/ubuntu/.ssh/known_hosts:1: address [2600:1f13:2fc:8803:76b1:42d7:be29:16f8]: missing port in address
FATA failed on 1 hosts:
 - [ssh] [2600:1f13:2fc:8803:76b1:42d7:be29:16f8]:22: not connected: client connect: can't connect: create config: can't connect: create host key validator: check hostkey: knownhosts callback: knownhosts: /home/ubuntu/.ssh/known_hosts:1: address [2600:1f13:2fc:8803:76b1:42d7:be29:16f8]: missing port in address

The reset command works if I remove the corresponding line from known_hosts, but I have to do that before each k0sctl command.

Relatedly, the output of k0sctl kubeconfig > ~/.kube/config appears to be incompatible with kubectl.
Here, the server line is server: https://2600:1f13:2fc:8803:76b1:42d7:be29:16f8:6443.
If I run kubectl get pods -A I get timeout errors like:

E0210 18:22:57.065456   66074 memcache.go:238] couldn't get current server API group list: Get "https://2600:1f13:2fc:8803:76b1:42d7:be29:16f8:6443/api?timeout=32s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I believe the correct line would be server: https://[2600:1f13:2fc:8803:76b1:42d7:be29:16f8]:6443 (note the brackets).

@kke kke added the bug Something isn't working label Feb 23, 2023
@kke
Copy link
Contributor

kke commented Feb 23, 2023

The missing port error seems to be a problem in go's knownhosts package: golang/go#53463

The kubeconfig address bug is entirely k0sctl's fault 😁

I'll see what can be done about them.

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

2 participants