Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

k3s change ip address #5787

Closed
Heyz6 opened this issue Jun 30, 2022 · 4 comments
Closed

k3s change ip address #5787

Heyz6 opened this issue Jun 30, 2022 · 4 comments

Comments

@Heyz6
Copy link

Heyz6 commented Jun 30, 2022

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?

@Cnordbo
Copy link

Cnordbo commented Jun 30, 2022

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.

@Hacker-OH
Copy link

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.

@harryzcy
Copy link

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.

@caroline-suse-rancher
Copy link
Contributor

Converting this to a discussion

@k3s-io k3s-io locked and limited conversation to collaborators Apr 20, 2023
@caroline-suse-rancher caroline-suse-rancher converted this issue into discussion #7326 Apr 20, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants