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

Can not create worker nodes #572

Closed
AndrukhivAndriy opened this issue Apr 1, 2025 · 15 comments
Closed

Can not create worker nodes #572

AndrukhivAndriy opened this issue Apr 1, 2025 · 15 comments

Comments

@AndrukhivAndriy
Copy link

Hi. I am trying to create k3s cluster. But I am stuck on creating worker nodes. I am not using a passphrase in SSH keys. Tried to connect via the id_ed25519 key to the server - success. This is my config:

hetzner_token: M2bk…….
cluster_name: nice
kubeconfig_path: "./kubeconfig"
k3s_version: v1.32.3+k3s1

networking:
ssh:
port: 22
use_agent: false # set to true if your key has a passphrase
public_key_path: "/root/.ssh/id_ed25519.pub"
private_key_path: "/root/.ssh/id_ed25519"
allowed_networks:
ssh:
- 0.0.0.0/0
api: # this will firewall port 6443 on the nodes
- 0.0.0.0/0
public_network:
ipv4: true
ipv6: false
private_network:
enabled: true
subnet: 10.0.0.0/16
existing_network_name: ""
cni:
enabled: true
encryption: false
mode: flannel
datastore:
mode: etcd # etcd (default) or external
schedule_workloads_on_masters: false
masters_pool:
instance_type: cx22

image: ubuntu-22.04

instance_count: 1 # for HA; you can also create a single master cluster for dev and testing (not recommended for prod
locations: # You can choose a single location for single master clusters or if you prefer to have all masters in the
- fsn1

worker_node_pools:

  • name: small-static
    instance_type: cpx11
    instance_count: 2
    location: fsn1

image: debian-11

mbedded_registry_mirror:
enabled: false
protect_against_deletion: false
create_load_balancer_for_the_kubernetes_api:

So, the result was created on Hetzner: master node, SSH key, network. Firewall and worker nodes were not created. The output of the hetzner-k3s create --config cluster_config.yaml

.....
[Instance nice-master1] Instance status: running
Error creating instance: timeout after 00:00:05
Instance creation for nice-master1 failed. Try rerunning the create command.

I am using Version: 2.2.6. 2.2.7 - have the same issue for me. Also changed ssh key algorithms - rsa and ed25519

@vitobotta
Copy link
Owner

Hi, please use code snippets next time to make the code/config more readable.

Which OS are you using hetzner-k3s on? Have you tried with the agent enabled?

@AndrukhivAndriy
Copy link
Author

Thanks. I am using Ubuntu 22 and 24. Yes, i tried agent enabled -- no result

@vitobotta
Copy link
Owner

Please rerun the create command with DEBUG=true as that might show useful information to figure out the problem.

@AndrukhivAndriy
Copy link
Author

[Configuration] Validating configuration...
[Configuration] ...configuration seems valid.
[Placement groups] Deleting unused placement group nicely-small-static-1...
[Placement groups] ...placement group nicely-small-static-1 deleted
[Placement groups] Creating placement group nicely-small-static-1...
[Placement groups] ...placement group nicely-small-static-1 created
[Instance nicely-master1] Instance status: running
Error creating instance: timeout after 00:00:05
Instance creation for nicely-master1 failed. Try rerunning the create command.

@vitobotta
Copy link
Owner

You need to set the environment variable DEBUG to true.

@AndrukhivAndriy
Copy link
Author

ssh: connect to host 159.69.50.XX port 22: Connection timed out
[Instance nicely-master1] debug1: Reading configuration data /etc/ssh/ssh_config
[Instance nicely-master1] debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/.conf matched no files
[Instance nicely-master1] debug1: /etc/ssh/ssh_config line 21: Applying options for *
[Instance nicely-master1] debug1: Connecting to 159.69.50.XX [159.69.50.XX] port 22.
[Instance nicely-master1] debug1: connect to address 159.69.50.XX port 22: Connection timed out
[Instance nicely-master1] ssh: connect to host 159.69.50.XX port 22: Connection timed out
[Instance nicely-master1] SSH command failed: debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/
.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 159.69.50.XX [159.69.50.XX] port 22.
debug1: connect to address 159.69.50.XX port 22: Connection timed out
ssh: connect to host 159.69.50.XX port 22: Connection timed out

The same thing with use_agent: true or use_agent: false

@vitobotta
Copy link
Owner

That's super weird. The connection time out seems to suggest the firewall is blocking the connection, but you have specified 0.0.0.0/0 as allowed network. Out of curiosity, can you try using hetzner-k3s with the exact same configuration but from another connection? You could use a temp hetzner instance for example.

Also please share the full config (without your token) in a code snippet so I can check it better.

I haven't come across this issue and it hasn't been reported before so it's weird. Also can you confirm the firewall has been configured when you created the cluster?

@AndrukhivAndriy
Copy link
Author

Yep. I created VM on Hetzner (ubuntu-22). There, I tried to run your script. No result. Today, I installed it on my Mac - it works very well.

@vitobotta
Copy link
Owner

Can you share your config properly formatted?

@AndrukhivAndriy
Copy link
Author

hetzner_token:
cluster_name: nicely
kubeconfig_path: "./kubeconfig"
k3s_version: v1.32.3+k3s1

networking:
ssh:
port: 22
use_agent: true # I have not tried false, but in Ubuntu I have tried true and false.
public_key_path: "./id_ed25519.pub"
private_key_path: "./id_ed25519"
allowed_networks:
ssh:
- 0.0.0.0/0
api:
- 0.0.0.0/0
public_network:
ipv4: true
ipv6: false
private_network:
enabled: true
subnet: 10.0.0.0/16
existing_network_name: ""
cni:
enabled: true
encryption: false
mode: flannel
atastore:
mode: etcd
schedule_workloads_on_masters: false

masters_pool:
instance_type: cx22
image: ubuntu-22.04
instance_count: 3
locations:
- fsn1
- hel1
- nbg1
worker_node_pools:

  • name: small-static
    instance_type: cx32
    instance_count: 2
    location: fsn1
    image: ubuntu-22.04
  • name: medium-autoscaled
    instance_type: cx22
    location: fsn1
    autoscaling:
    enabled: true
    min_instances: 0
    max_instances: 3
    mbedded_registry_mirror:
    enabled: false

protect_against_deletion: false

create_load_balancer_for_the_kubernetes_api: true

-------- This configuration works fine on the Mac, but doesn't work on Ubuntu 22. ------

@vitobotta
Copy link
Owner

Are the ubuntu computer and the mac in the same network?

@AndrukhivAndriy
Copy link
Author

No. Ubuntu - Hetzner, Mac - home

@vitobotta
Copy link
Owner

Can you please share your config in a formatted code snippet (between triple backticks) so it's more readable? I will do a test using Ubuntu 22 from a Hetzner server. Your issue is very weird and I am not sure what's happening.

@AndrukhivAndriy
Copy link
Author

Sorry. My mistake. Port 22 on the Hetzner Firewall (outbound) was closed. I forgot about outbound traffic.

@vitobotta
Copy link
Owner

Thanks for the update.

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