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

HCCM should work with FQDN Servernames and Private IPs as Node IPs #703

Open
tehnic-take3 opened this issue Jul 22, 2024 · 2 comments
Open
Assignees
Labels
enhancement New feature or request stale

Comments

@tehnic-take3
Copy link

TL;DR

Hello,

first - i prefer to use FQDN servernames like "k8s-control-plane1.mydomain.com", but then i get error messages in the HCCM log like:

I0722 xx:xx:xx.xxxxxx       1 node_controller.go:425] Initializing node k8s-control-plane1 with cloud provider
I0722 xx:xx:xx.xxxxxx       1 node_controller.go:229] error syncing 'k8s-control-plane1': failed to get instance metadata for node k8s-control-plane1: hcloud/instancesv2.InstanceMetadata: failed to get instance metadata: no matching server found for node 'k8s-control-plane1': server not found, requeuing
E0722 xx:xx:xx.xxxxxx       1 node_controller.go:240] error syncing 'k8s-control-plane1': failed to get instance metadata for node k8s-control-plane1: hcloud/instancesv2.InstanceMetadata: failed to get instance metadata: no matching server found for node 'k8s-control-plane1': server not found, requeuing

I suggest to have a HCCM configuration item to use the FQDN of all nodes for cloud provider API.

Second - after changing servername to one without domain, i get error messages like:

I0722 xx:xx:xx.xxxxxx       1 node_controller.go:425] Initializing node k8s-control-plane1 with cloud provider
I0722 xx:xx:xx.xxxxxx       1 node_controller.go:229] error syncing 'k8s-control-plane1': failed to get node modifiers from cloud provider: provided node ip for node "k8s-control-plane1" is not valid: failed to get node address from cloud provider that matches ip: 10.x.x.x, requeuing
E0722 xx:xx:xx.xxxxxx       1 node_controller.go:240] error syncing 'k8s-control-plane1': failed to get node modifiers from cloud provider: provided node ip for node "k8s-control-plane1" is not valid: failed to get node address from cloud provider that matches ip: 10.x.x.x, requeuing

I used "KUBELET_EXTRA_ARGS=--cloud-provider=external --node-ip=10.x.x.x" for kubelet configuration on control-plane (KUBELET_EXTRA_ARGS=--node-ip=10.x.x.x on workers) where 10.x.x.x is the private IP of the node.

Currently i use antrea as CNI with geneve link between the nodes (using the private node IP addresses).

I suggest that the HCCM checks not only a matching primary IP but also the configured private IP(s) - they are anyway available, for example i can extract this way (for FQDN servername):

hcloud server list -o json | jq -r ".[] | select(.name == "$(hostname -f)") | .private_net[].ip"

or for non FQDN servernames:

hcloud server list -o json | jq -r ".[] | select(.name == "$(hostname)") | .private_net[].ip"

Expected behavior

I wish to have the possibility to use FQDN servenames and a private IPs as node IPs with HCCM.

Best regards,
Robert

@tehnic-take3 tehnic-take3 added the enhancement New feature or request label Jul 22, 2024
@apricote apricote self-assigned this Aug 30, 2024
@apricote
Copy link
Member

Hello @tehnic-take3,

FQDN Server Names

where do you use the FQDN server names?

By default hcloud-cloud-controller-manager requires that the name of the Kubernetes Node matches the name of the Server in the Hetzner Cloud / Robot APIs. This is documented here (very hard to find if you do not know that this exists).

Private IPs

If you want to use your private ips, this is already supported in hcloud-cloud-controller-manager.

In the helm chart you can enable this through the option networking.enabled: true.

Copy link
Contributor

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

@github-actions github-actions bot added the stale label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants