Coder Social home page Coder Social logo

Comments (9)

janiskemper avatar janiskemper commented on May 18, 2024 1

Hi @pucilpet!
Quick answer to the hostSelcetor: You don't have to set it at all! You can use labels on your host and let a bm machine select a certain host by its labels. If not, then just any host is chosen. You see in the reference that the hostSelector is optional. You don't have to worry about it at all ;)
Regarding the cluster template: Each host object has to be created in a highly specific way. We have described in the reference what fields have to be specified. We cannot create a cluster-template for this, as this wouldn't work out of the box. Everybody would have to adapt it. If you have another suggestion where we should have an example, then tell us! Here is a template, (which you have to adapt, of course):

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: HetznerBareMetalHost
metadata:
  name: "bm-0"
spec:
  serverID: 1682566
  rootDeviceHints:
    wwn: "eui.0068475201b4egh2"
  maintenanceMode: false
  description: Test Machine 0

from cluster-api-provider-hetzner.

pucilpet avatar pucilpet commented on May 18, 2024 1

Let me think about how to improve it and I will work on a PR.

from cluster-api-provider-hetzner.

pucilpet avatar pucilpet commented on May 18, 2024

Hi @pucilpet! Quick answer to the hostSelcetor: You don't have to set it at all! You can use labels on your host and let a bm machine select a certain host by its labels. If not, then just any host is chosen. You see in the reference that the hostSelector is optional. You don't have to worry about it at all ;) Regarding the cluster template: Each host object has to be created in a specific way.

Thanks for your answer @janiskemper

That is exactly what I am trying to avoid - having a bare metal server selected that is already being used for something else. :) But having read your answer and the docs again, I can see that I had been thinking the relationship between the HetznerBareMetalHost, the HetznerBareMetalTemplate and the bare metal servers purchased on Hetzner - all wrong. So it's my bad.

I understand your point regarding the cluster template. But it might be better to have some skeleton template than nothing at all. :)

Thanks again!

from cluster-api-provider-hetzner.

pucilpet avatar pucilpet commented on May 18, 2024

Also - from what I can see from /docs/reference/hetzner-bare-metal-machine-template.md - the template.spec.hostSelector is actually marked as required. :)

from cluster-api-provider-hetzner.

janiskemper avatar janiskemper commented on May 18, 2024

I think we can maybe put an example into the docs.

I am happy that you understood the relationship between the objects now. Do you have any suggestion on how we can improve the documentation so that it is easier to understand?

And yes, you are absolutely right. hostSelector is marked as required, but it is not. As can be seen in the cluster templates, where we don't use it.

Do you want to make a contribution to the docs? Then you could also update the hostSelector required field. We definitely welcome new contributors ;) If you have no suggestion on how to improve the docs, then I'll update the required=true field.

Anyway, thanks for finding the mistake in the docs!

from cluster-api-provider-hetzner.

janiskemper avatar janiskemper commented on May 18, 2024

Thank you so much @pucilpet! I'm looking forward to it!

from cluster-api-provider-hetzner.

pucilpet avatar pucilpet commented on May 18, 2024

One more thing that I noticed, probably might be a good idea to open a new issue?

In /docs/topics/preparation.md it is stated that

Preparing Hetzner Robot

Generate an SSH key. You can either upload it via Hetzner Robot UI, or you can just rely on the controller to upload a key that it does not find in the robot API. This is possible, as you have to store the public and private key together with the ssh key's name in a secret that the controller reads.

But when I added the ssh key only to a secret and not via Hetzner Robot UI, the hetznerbaremetalhosts stay in "preparing" state, never actually rebooting the servers.

Only after I added the SSH key via Hetzner Robot UI and named it "cluster" I was able to provision the baremetalhosts.

Is this something you have seen, too? Should I include in the docs PR that uploading the SSH key to Hetzner robot UI is required with the name cluster or maybe there needs to be some code change?

from cluster-api-provider-hetzner.

janiskemper avatar janiskemper commented on May 18, 2024

@pucilpet in theory it should work to upload ssh keys to robot API that are not yet registered, see

.
Can you maybe have a look at the logs whether there are error messages related to this?

from cluster-api-provider-hetzner.

janiskemper avatar janiskemper commented on May 18, 2024

If this does not work there should be error logs. And yes, if you find some it would be good to open a new issue for this, as it has nothing to do anymore with the original topic of this issue here. Thank you!

from cluster-api-provider-hetzner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.