https://rancher.com/ logo
Title
a

ancient-raincoat-46356

10/19/2022, 5:11 PM
I have longhorn running as my default storage class for multiple clusters. The original k3s StorageClass of
local-path
was patched to unset it as a "default", but I have noticed that over time the
local-path
comes back as a default storage class. I've unset it several times now but I'd like it to stop reverting back to that state. Does anyone know how I can accomplish this or have you seen this yourself?
c

creamy-pencil-82913

10/19/2022, 5:18 PM
start k3s with --disable=local-storage. If you don’t do that, the local-storage manifest will get re-applied every time you restart a server.
a

ancient-raincoat-46356

10/19/2022, 5:20 PM
where do I put that for a systemd service? In the service file or is there another/better place
I found this just now as well...
/var/lib/rancher/k3s/server/manifests/local-storage.yaml
Is there a recommended way to disable this
local-storage
?
c

creamy-pencil-82913

10/19/2022, 5:55 PM
yes, the way I just said
Adding it to the CLI flags in the systemd unit works. You can also put
disable: local-storage
in /etc/rancher/k3s/config.yaml
a

ancient-raincoat-46356

10/19/2022, 6:08 PM
Are the manifests files located
/var/lib/rancher/k3s/server/manifests/
included in ETCD snapshots? I'm not very familiar with ETCD and how it works. However you helped answer a question I had yesterday related to taking backups. I'm wondering if I update
local-storage.yaml
in the manifests directory if that will be included in my snapshots? Otherwise I'll need to update my backup script to include
/etc/systemd/system/k3s.service
,
/etc/rancher/k3s/config.yaml
, or
/var/lib/rancher/k3s/server/manifests/local-storage.yaml
, depending on what I change to disable the local-storage.
And thanks for all of your help. You've been very kind with assisting me and I'm sure you do this all day with other people as well. I hate to think I'm in here asking stupid questions that I can find answers to online but I do try my best to search before bothering the experts of the community.
c

creamy-pencil-82913

10/19/2022, 6:25 PM
All of the packaged manifests in /var/lib/rancher/k3s/server/manifests come with the product, and are extracted out on startup and applied to the cluster, unless you --disable them. There’s no point in backing them up since they come back on their own. If you add any of your own manifests to that directory then you would probably want to back those up as well, although ideally they would be managed along with the rest of your system configuration. Their contents are also applied (as in
kubectl apply
) to the cluster though, so they would (in a sense) be covered by the etcd snapshots.