Skip to content

k3s change ip address #5787

Closed
Closed

Description

@Heyz6

When I run k3s single node, or a cluster, and the host Ip sends a change, how do I make the change to keep k3s in use?

Activity

  1. Cnordbo commented on Jun 30, 2022

    @Cnordbo

    Do you mean how to get it up and running again after the IP has changed?
    I just struggled with the same thing myself while setting up a cluster at my home network. And then only afterwards thinking of setting up a static IP on the master and nodes.

    In my case, every IP changed on both server and agent.
    So im not sure if this is needed if ever just an agent changes its IP.

    What worked for me was doing the following:

    1. Login to the k3s server
    2. run sudo kubectl delete node <name-of-node> (No need for sudo if your kubeconfig already has 644 as its write permissions)
    3. If the server IP changed - Login to the node
    4. Change k3S_URL in /etc/systemd/system/k3s-agent.service.env file to the correct value

    Restart agent. Im not sure if a service restart will do (systemctl restart k3s-agent) - I just rebooted the entire agent.

  2. Hacker-OH commented on Nov 16, 2022

    @Hacker-OH

    Quick question, are you able to run k3s with a dynamically changing IP address? Say for example you want a worker node to be able to connect to different networks but still talked to the master node.

  3. harryzcy commented on Jan 13, 2023

    @harryzcy

    I managed to just change k3S_URL in /etc/systemd/system/k3s-agent.service.env file, and then run systemctl restart k3s-agent, and I have the nodes connected again.

    I didn't even remove the node, and didn't reboot the system.

  4. caroline-suse-rancher commented on Apr 20, 2023

    @caroline-suse-rancher
    Contributor

    Converting this to a discussion

  5. locked and limited conversation to collaborators on Apr 20, 2023
  6. converted this issue into a discussion #7326 on Apr 20, 2023
  7. moved this from New to Done Issue in K3s Developmenton Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions