k3d icon indicating copy to clipboard operation
k3d copied to clipboard

[FEATURE] Add ability to name agents/servers

Open nadenf opened this issue 2 years ago • 4 comments

Problem

I would like to be able to have different names for my node to help with discovery in tools like k9s.

If I (a) create the cluster and then (b) create the nodes I can achieve this.

But if I need to create the cluster and nodes at the same time i.e. via -agents flag then this is not possible. And some use cases e.g. per-node volumes are only possible using this approach

Solution

Either:

  • Add a "k3d node rename" command.
  • Add a new flag to k3d create cluster "--name KEY=VALUE[@NODE]"

nadenf avatar Nov 11 '21 08:11 nadenf

Hi @nadenf , thanks for opening this issue! So since you're talking about k9s, you're referring to the Kubernetes Node Name, right? k3d only sets the "hostname" of the nodes (i.e. the container name), which is the default used by Kubernetes (K3s) as node name. So you can use e.g. --k3s-arg "--node-name=mynode"@agent:0 to name the first agent (didn't test this).

iwilltry42 avatar Nov 11 '21 19:11 iwilltry42

@iwilltry42 .. That does indeed work.

Would be nice still to have a friendly config option.

nadenf avatar Nov 13 '21 06:11 nadenf

Hi @iwilltry42, I'm new to k3d. Can i try this issue? I'll inform if i couldn't finish it.

ksankeerth avatar Jan 23 '22 05:01 ksankeerth

Hi @shankeerthan-kasilingam, welcome to the project 🙂 Sure, go for it! Let me know if you need any help or insights.

iwilltry42 avatar Jan 23 '22 08:01 iwilltry42