Skip to content

Karpenter creates nodes with incorrect node names when using resource based naming #2892

Closed

Description

@olemarkus

Version

Karpenter Version: v0.19.1

Kubernetes Version: v1.25.4

Expected Behavior

Karpenter should create node names containing only the instance ID (i-08dd5f2b3538142e9).

This is correct behaviour as documented in the AWS cloud provider documentation: https://cloud-provider-aws.sigs.k8s.io/prerequisites/

Actual Behavior

Karpenter creates node names containing only the instance ID + region domain (i-08dd5f2b3538142e9.eu-north-1.compute.internal)

Steps to Reproduce the Problem

Create a cluster using karpenter + resource based naming

Resource Specs and Logs

Not very relevant

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Activity

  1. bwagner5 commented on Nov 19, 2022

    @bwagner5
    Contributor

    hmm I guess we patched this incorrectly.... although I'm a little confused on how this works.

    Kubelet still uses the hostname as the node name, right? And when you turn on resource based naming on a subnet, the hostname of the instance would be with the domain i-08dd5f2b3538142e9.eu-north-1.compute.internal. Is it expected that we use hostname-override in the kubelet to set the hostname as just the instance-id?

  2. olemarkus commented on Nov 19, 2022

    @olemarkus
    ContributorAuthor

    I think the confusion comes from legacy cloud provider vs external. Legacy uses the metadata service to get the hostname, which contains domain name, while external uses os.Hostname(), which does not.

    We (cloud-provider-aws) decided to drop the domain part specifically to avoid --hostname-override. The domain part also provides no value as part of the domain name.

    So make sure you are using the external cloud provider when using RBN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions