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

Still consuming space in default data directory after configured new --data-dir #10586

Closed
James4Ever0 opened this issue Jul 27, 2024 · 1 comment

Comments

@James4Ever0
Copy link

James4Ever0 commented Jul 27, 2024

Environmental Info:
K3s version:
k3s version v1.29.6+k3s2 (b4b156d)
go version go1.21.11

Node(s) CPU architecture, OS, and Version:
Linux redacted 5.16.0-kali7-amd64 #1 SMP PREEMPT Debian 5.16.18-1kali1 (2022-04-01) x86_64 GNU/Linux

Cluster Configuration:
1 server

Describe the bug:
After I configured new custom --data-dir in /etc/systemd/system/k3s.service at line ExecStart, it still saves some data under path /var/lib/rancher/k3s/data/current

4.0K	./etc
1.5M	./bin/aux
195M	./bin
195M	.

Steps To Reproduce:

  • Normally use official command line to install K3s using default data directory
  • Configure to the new data directory
  • Rerun service
  • Data mostly in new directory but left some under default directory

Expected behavior:

All data shall be stored in new directory.

Actual behavior:
Data being partly stored in old directory and mainly in new directory.

Additional context / logs:

After I used rsync -avh --progress /var/lib/rancher/k3s <new_data_directory> to migrate data, K3s still treats the old data like if it does not exist. K3s will download init data, pull kube-system images and create init containers.

This behavior is expected because Docker has similar bevariors too. I just want some explaination over this and how to reuse old data if possible.

@James4Ever0 James4Ever0 changed the title Still consuming default data directory space after configured new --data-dir Still consuming space in default data directory after configured new --data-dir Jul 27, 2024
@brandond
Copy link
Member

I'm confused, did you expect k3s to move things for you when you changed the data-dir? It is not generally recommended to change the data-dir after the node has beens started once, but it should work OK if you move things yourself. I'm not sure why you'd use rsync to copy things over instead of moving?

@k3s-io k3s-io locked and limited conversation to collaborators Jul 29, 2024
@brandond brandond converted this issue into discussion #10604 Jul 29, 2024
@github-project-automation github-project-automation bot moved this from New to Done Issue in K3s Development Jul 29, 2024

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

2 participants