cluster-api-provider-hetzner icon indicating copy to clipboard operation
cluster-api-provider-hetzner copied to clipboard

How to Guide for Talos

Open paulwollgast opened this issue 2 years ago • 11 comments

/kind feature

Describe the solution you'd like First and foremost thank you very much for this great work!

I'd like to ask for a Guideline / How to Guide to bootstrap the cluster with Talos as I'm sure many people would appreciate and favor it over standard linux distros like e.g. ubuntu.

paulwollgast avatar Mar 25 '22 11:03 paulwollgast

good point! I will see if we could add one. right now I'm a little bit limited in time... Here a short description how to use talos with caph.

export HCLOUD_TOKEN=<your-token>
packer build templates/node-image/talos-image/image.json

This will build the node-image more information could be found here

Then you could create a cluster as usual but with the talos flavor. Of course you need to start the talos bootstrap and control-plane controller as well.

So right now the easiest way would be to use the tilt setup.

Adding a tilt-settings.json with the following content.

{
  "kustomize_substitutions": {
      "HCLOUD_TOKEN": "<your-token>",
      "HCLOUD_SSH_KEY": "<ssh-name-in-hcloud>",
      "HCLOUD_REGION": "fsn1",
      "CONTROL_PLANE_MACHINE_COUNT": "3",
      "WORKER_MACHINE_COUNT": "3",
      "KUBERNETES_VERSION": "v1.23.4",
      "HCLOUD_IMAGE_NAME": "talos-image",
      "HCLOUD_CONTROL_PLANE_MACHINE_TYPE": "cpx31",
      "HCLOUD_WORKER_MACHINE_TYPE": "cpx31",
      "CLUSTER_NAME": "testing"
  },
  "talos-bootstrap": "true"
}

And then:

make tilt-up

Maybe you need to install the prerequisites listet in the developer docs or alternatively make install-dev-prerequisites

In the tilt UI under http://localhost:10350/ you should see some buttons. One have a description with talos, after clicking it a workload cluster should be bootstrapped.

Feel free to enhance the docs with a PR in the meantime ;)

batistein avatar Mar 25 '22 21:03 batistein

Thank you very much for the guideline @batistein Currently I'm also a little short on time, I'll however try it out asap and see how I can update the docs accordingly!

paulwollgast avatar Mar 26 '22 20:03 paulwollgast

@batistein

Could you also write a comment on how to setup Talos on hetzner dedicated machines? I successfully provisioned my bare-metal server HetznerBareMetalHost with the HetznerBareMetalMachineTemplate (currently Ubuntu 20.04) + bootstrap cluster template KubeadmConfigTemplate, but i would like to use Talos instead of Ubuntu + kubeadm. I guess I need something like the cluster-template-hcloud-talos-packer.yaml but for dedicated servers (cluster-template-hetzner-baremetal-talos-control-planes.yaml or so).

Thanks in advance.

madnight avatar Sep 22 '22 10:09 madnight

@madnight unfortunately that's not possible. The baremetal provider integration uses heavily ssh commands. So you could only use OS Images which supports SSH and you can only use the Kubeadm Bootstrap/Control Plane Provider for Baremetal.

batistein avatar Sep 22 '22 10:09 batistein

@batistein Thanks for your fast response. Talos also provides OS Images https://github.com/siderolabs/talos/releases/download/v1.2.3/metal-amd64.tar.gz wouldn't it be possible to download the OS Image in Hetzner Resuce Mode. Something like

    installImage:
      image: 
        url: https://github.com/siderolabs/talos/releases/download/v1.2.3/metal-amd64.tar.gz
#        path: >-
#          /root/.oldroot/nfs/install/../images/Ubuntu-2004-focal-64-minimal-hwe.tar.gz
      partitions:
        - fileSystem: ext4
          mount: /boot
          size: 1024M
        - fileSystem: ext4
          mount: /
          size: all

According to the Hetzner Docs https://docs.hetzner.com/robot/dedicated-server/operating-systems/installimage/ allows custom OS images.

After installation the dedicated server could just reboot and the bootstrapping of the server would be done. The rest (creating a k8s cluster) could either configured manually with talosctl or with a talosctl script that runs inside the bootstrap cluster.

madnight avatar Sep 22 '22 11:09 madnight

@madnight unfortunately that's not possible. The baremetal provider integration uses heavily ssh commands. So you could only use OS Images which supports SSH and you can only use the Kubeadm Bootstrap/Control Plane Provider for Baremetal.

Would a merge request be accepted that uses the Talos API instead of SSH when using the Talos CAPI providers?

Preisschild avatar Dec 04 '22 13:12 Preisschild

For sure! We are happy to see a PR which adds this functionality ;) It's only relevant that it doesn't break the current cabpk implementation. If you are interested in contributing we can also find a timeslot for doing a planning, QA session. You can find me also in the kubernetes slack workspace.

batistein avatar Dec 04 '22 19:12 batistein

Would a merge request be accepted that uses the Talos API instead of SSH when using the Talos CAPI providers?

@Preisschild do u have any plans to work on this?

a5r0n avatar Feb 20 '23 21:02 a5r0n

Would a merge request be accepted that uses the Talos API instead of SSH when using the Talos CAPI providers?

@Preisschild do u have any plans to work on this?

Not currently, I decided to go another route for now.

Preisschild avatar Feb 23 '23 08:02 Preisschild

Do u have in mind what is needed for this? maybe you or someone else can guide me though?

On Thu, Feb 23, 2023, 10:37 Florian Ströger @.***> wrote:

Would a merge request be accepted that uses the Talos API instead of SSH when using the Talos CAPI providers?

@Preisschild https://github.com/Preisschild do u have any plans to work on this?

Not currently, I decided to go another route for now.

— Reply to this email directly, view it on GitHub https://github.com/syself/cluster-api-provider-hetzner/issues/133#issuecomment-1441376987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXV5VB3V5A6IT4H66EH5RLWY4OTDANCNFSM5RT3UXKA . You are receiving this because you commented.Message ID: @.***>

a5r0n avatar Feb 23 '23 09:02 a5r0n

@paulwollgast Did you get this working?

lieberlois avatar Aug 31 '23 15:08 lieberlois