vitobotta / hetzner-k3s

The easiest and fastest way to create and manage Kubernetes clusters in Hetzner Cloud using the lightweight distribution k3s by Rancher.
MIT License
1.9k stars 141 forks source link

hetzner-k3s Failed to create private network JSON error A valid JSON document is required #426

Closed LarvePoire closed 2 months ago

LarvePoire commented 2 months ago

Hello,

I'm encountering an issue while using hetzner-k3s to create a Kubernetes cluster. The process fails during the private network creation with the following error message:

[Configuration] Validating configuration...
[Configuration] ...configuration seems valid.
[Private Network] Creating private network...
[Private Network] Failed to create private network: {
    "error": {
        "code": "json_error",
        "message": "A valid JSON document is required."
    }
}

I am currently on Step 5 of the Setting up a Cluster guide. Although the configuration is validated, the error persists when I run the following command:

hetzner-k3s create --config hetzner-k3s_cluster_config.yaml

Below is the YAML configuration file I am using:

hetzner_token: 'secret'
cluster_name: hello-world
kubeconfig_path: "./kubeconfig"
k3s_version: v1.30.4+k3s1
public_ssh_key_path: "~/.ssh/id_rsa.pub"
private_ssh_key_path: "~/.ssh/id_rsa"
use_ssh_agent: true
ssh_allowed_networks:
  - 0.0.0.0/0
api_allowed_networks:
  - 0.0.0.0/0
schedule_workloads_on_masters: false
masters_pool:
  instance_type: cx22
  instance_count: 3
  location: hel1
worker_node_pools:
  - name: small
    instance_type: ccx13
    instance_count: 1
    location: hel1

I'm wondering if this issue might be due to a configuration mistake or if it could be a bug in the current version of hetzner-k3s.

If anyone has encountered this issue before or can provide advice on how to resolve this error, I would greatly appreciate your help.

Thank you in advance!

vitobotta commented 2 months ago

Hi, I need to update that page because it refers to the config format of the old version of the tool. Please refer to the installation doc page for an example of the new configuration. I will update the page you were looking at as soon as I have a chance.

LarvePoire commented 2 months ago

Hi, I need to update that page because it refers to the config format of the old version of the tool. Please refer to the installation doc page for an example of the new configuration. I will update the page you were looking at as soon as I have a chance.

Thank you for the clarification! I appreciate the update and look forward to the revised documentation when it's available.

I have a couple of questions to make sure I'm on the right track:

  1. I’m not entirely sure which page I should check. Should I refer to this one:
    Creating a Cluster
    or this one:
    Installation?
    Could you please provide the specific link you mentioned?

  2. Could you also let me know what I might have missed in the process? Have there been more complex changes to the configuration that I should be aware of?

Thank you again for your help!

vitobotta commented 2 months ago

This is the page where you can see an example of the configuration file in the new format: https://github.com/vitobotta/hetzner-k3s/blob/main/docs/Creating_a_cluster.md

Create a cluster first, then for the rest you should be able to follow the guide you were looking at. The only thing that has changed is the config file format. :)

LarvePoire commented 2 months ago

Thank you so much for the link and clarification! 🙏 I'll go ahead and create the cluster with the new configuration format. I really appreciate your help! 😊

vitobotta commented 2 months ago

Np! Happy to help. Have fun with your cluster :)