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

kubeone fails when nodes have hostname in all caps #3071

Closed
SimonTheLeg opened this issue Mar 6, 2024 · 3 comments
Closed

kubeone fails when nodes have hostname in all caps #3071

SimonTheLeg opened this issue Mar 6, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.

Comments

@SimonTheLeg
Copy link
Member

What happened?

When creating a cluster it fails with the following error message:

INFO[16:03:22 CET] Applying addon nodelocaldns...               
WARN[16:03:24 CET] Task failed, error was: kubernetes: updating NUC-1 Node
nodes "NUC-1" not found 
WARN[16:03:34 CET] Retrying task...                             
WARN[16:03:34 CET] Task failed, error was: kubernetes: updating NUC-1 Node
nodes "NUC-1" not found 

When running kubectl get nodes we can see that the nodes are named "nuc-1" and "nuc-2, so all lowercase, not uppercase like in the log output above.

Indeed after resetting the cluster and changing all hostnames to lowercase on the nodes, the next kubeone run finishes successfully.

Expected behavior

Cluster to be provisioned successfully.

How to reproduce the issue?

  1. Create some VMs/Baremetal machines, that have a hostname in all caps. E.g. "NUC-1"
  2. Create a kubeone cluster, with a kubeone similar to this (unfortunately I don't have the exact kubeone, but it is fairly similar to this). Basically just a standard cluster with maybe one or two nodes. Issue should occur regardless of the number of nodes I think
apiVersion: kubeone.k8c.io/v1beta2
kind: KubeOneCluster
name: lab
versions:
  kubernetes: "1.27.7"
cloudProvider:
  none: {}

controlPlane:
  hosts:
    - publicAddress: "192.168.5.42"
      privateAddress: "192.168.5.42"
      sshUsername: kubermatic
      # by setting empty taints, the controlPlane node is also being used to schedule regular workloads
      taints: []
      labels:
        location: proxmox
        pool: 5gcore

staticWorkers:
  hosts:
    - publicAddress: "192.168.5.80"
      privateAddress: "192.168.5.80"
      sshUsername: hhi
      labels:
        location: lab
        pool: 5gcore
    - publicAddress: "192.168.5.26"
      privateAddress: "192.168.5.26"
      sshUsername: fokus
      labels:
        location: lab
        pool: gnb

apiEndpoint:
  host: "192.168.5.42"
  port: 6443

machineController:
  deploy: false

What KubeOne version are you using?

$ kubeone version
{
  "kubeone": {
    "major": "1",
    "minor": "7",
    "gitVersion": "1.7.0",
    "gitCommit": "1195366fd0cf11f314d194a3b29b6a782afde9a8",
    "gitTreeState": "",
    "buildDate": "2023-09-08T14:02:33Z",
    "goVersion": "go1.20.5",
    "compiler": "gc",
    "platform": "darwin/amd64"
  },
  "machine_controller": {
    "major": "1",
    "minor": "57",
    "gitVersion": "v1.57.3",
    "gitCommit": "",
    "gitTreeState": "",
    "buildDate": "",
    "goVersion": "",
    "compiler": "",
    "platform": "linux/amd64"
  }
}

What cloud provider are you running on?

baremetal

What operating system are you running in your cluster?

Ubuntu 20.04

@SimonTheLeg SimonTheLeg added kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. labels Mar 6, 2024
@kron4eg
Copy link
Member

kron4eg commented Mar 6, 2024

@SimonTheLeg well... the the hostname have to be lowercase. You can override it however with the hostname: "nuc-1"

Please see more: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

@kron4eg kron4eg closed this as completed Mar 6, 2024
@SimonTheLeg
Copy link
Member Author

Yes I fully agree, the hostnames should not be all caps. But the problem is that operating systems like Ubuntu allow you to have the hostname in all caps (for whatever reason).
And unfortunately I feel like this becomes our problem in the end. Even though we are in the right. For example like in this case, where a partner configured their hostnames in all caps and then run into a kubeone error that is difficult for them to understand And then they think it's an issue with kubeone.

From my perspective I would find it better if we were able to handle it, even if we are technically in the right and hostnames should be lowercased. Maybe we can just have a pre-flight check that fails if one of the hostnames is in all caps and sends an error message to the user telling them about it. How would you feel about this? Also I think we need to document this in our requirements

@kron4eg
Copy link
Member

kron4eg commented Mar 6, 2024

Maybe we can just have a pre-flight check that fails if one of the hostnames is in all caps and sends an error message to the user telling them about it. How would you feel about this?

Sounds good! Just one amend: s/is in all caps/has any caps/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.
Projects
None yet
Development

No branches or pull requests

2 participants