question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microk8s 1.18 Change default host path storage location

See original GitHub issue

Hi all, I want to use my usb drive as default storage location. I set the usb drive mount point to /mnt/microk8s_usb. I followed this https://github.com/ubuntu/microk8s/issues/463#issuecomment-491285745 to change /var/snap/microk8s/current/args/containerd as follow:

--config ${SNAP_DATA}/args/containerd.toml
--root /mnt/microk8s_usb/var/lib/containerd
--state /mnt/microk8s_usb/run/containerd
--address ${SNAP_COMMON}/run/containerd.sock

After restarted Microk8s, pods status are always ContainerCreating, but the node is on Ready state When I describe the pods, it shows the following message:

Warning  FailedCreatePodSandBox  2m54s (x17 over 6m41s)  kubelet            (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container: failed to create containerd task: failed to mount rootfs component &{overlay overlay [workdir=/mnt/microk8s_usb/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/152/work upperdir=/mnt/microk8s_usb/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/152/fs lowerdir=/mnt/microk8s_usb/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs]}: invalid argument: unknown

Am I did something wrong? Thank you. inspection-report-20210131_070151.tar.gz

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
skol101commented, Jan 18, 2022

Is there a way to change not only the path but actually type of storage? Because hostPath isn’t support by Velero backup.

0reactions
jinjin123commented, Jul 6, 2022

version: ubuntu22.04 change host path happen error… same partition with the old disk

Jul 6 18:46:42 jin microk8s.daemon-containerd[19905]: + exec /snap/microk8s/3272/bin/containerd --config /var/snap/microk8s/3272/args/containerd.toml --address /var/snap/microk8s/common/run/containerd.sock --root /mnt/raid1/microk8s/var/lib/containerd --state /mnt/raid1/microk8s/run/containerd

Jul 6 18:46:42 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:42.996927642+08:00” level=info msg=“starting containerd” revision=3df54a852345ae127d1fa3092b95168e4a88e2f8 version=v1.5.11 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.052813404+08:00” level=info msg=“loading plugin "io.containerd.content.v1.content"…” type=io.containerd.content.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.052931882+08:00” level=info msg=“loading plugin "io.containerd.snapshotter.v1.aufs"…” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.055696445+08:00” level=info msg=“skip loading plugin "io.containerd.snapshotter.v1.aufs"…” error=“aufs is not supported (modprobe aufs failed: exit status 1 "modprobe: FATAL: Module aufs not found in directory /lib/modules/5.15.0-39-generic\n"): skip plugin” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.055774026+08:00” level=info msg=“loading plugin "io.containerd.snapshotter.v1.btrfs"…” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.056245366+08:00” level=info msg=“skip loading plugin "io.containerd.snapshotter.v1.btrfs"…” error=“path /mnt/raid1/microk8s/var/lib/containerd/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.056294506+08:00” level=info msg=“loading plugin "io.containerd.snapshotter.v1.devmapper"…” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.056349049+08:00” level=warning msg=“failed to load plugin io.containerd.snapshotter.v1.devmapper” error=“devmapper not configured” Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.056376198+08:00” level=info msg=“loading plugin "io.containerd.snapshotter.v1.native"…” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.056429905+08:00” level=info msg=“loading plugin "io.containerd.snapshotter.v1.overlayfs"…” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.056671386+08:00” level=info msg=“loading plugin "io.containerd.snapshotter.v1.zfs"…” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.057108948+08:00” level=info msg=“skip loading plugin "io.containerd.snapshotter.v1.zfs"…” error=“path /mnt/raid1/microk8s/var/lib/containerd/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin” type=io.containerd.snapshotter.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.057158042+08:00” level=info msg=“loading plugin "io.containerd.metadata.v1.bolt"…” type=io.containerd.metadata.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.057196126+08:00” level=warning msg=“could not use snapshotter devmapper in metadata plugin” error=“devmapper not configured” Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.057221884+08:00” level=info msg=“metadata content store policy set” policy=shared Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.057455420+08:00” level=info msg=“loading plugin "io.containerd.differ.v1.walking"…” type=io.containerd.differ.v1 Jul 6 18:46:43 jin microk8s.daemon-containerd[19905]: time=“2022-07-06T18:46:43.057502121+08:00” level=info msg=“loading plugin "io.containerd.gc.v1.scheduler"…” type=io.containerd.gc.v1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microk8s 1.18 Change default host path storage location
Hi all, I want to use my usb drive as default storage location. I set the usb drive mount point to /mnt/microk8s_usb.
Read more >
Addon: Hostpath Storage
By default, the hostpath provisioner will store all volume data under /var/snap/microk8s/common/default-storage . It is possible that a cluster administrator ...
Read more >
How to change microk8s kubernetes storage location
But the simplest answer is to specify host path directly in your PV yaml spec - perfect for single node microk8s.
Read more >
microk8s - change location of hostpath storage
This easy change is shown in this post. From time to time we need small container hosts - very small, single hosts.
Read more >
Microk8s storage configuration - General Discussions
I enabled the storage with microk8s.enable storage, and by default it uses /var/snap/microk8s/common/default-storage. I would like to change it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found