microk8s icon indicating copy to clipboard operation
microk8s copied to clipboard

Environment variable in /etc/environment ignored

Open gaetanquentin opened this issue 8 months ago • 3 comments

Summary

in /var/snap/microk8s/current/args/containerd-template.toml then environment SNAPSHOTTER is used:

[plugins."io.containerd.grpc.v1.cri".containerd]

# snapshotter is the snapshotter used by containerd.
snapshotter = "${SNAPSHOTTER}"

I wanted to set it in /etc/environment but it is ignored.

What Should Happen Instead?

SNAPSHOTTER="btrfs" env var should be used

Reproduction Steps

  1. Setting environment file: cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" SNAPSHOTTER="btrfs"

  2. systemctl daemon-reload

  3. sudo microk8s start

Introspection Report

useless

Can you suggest a fix?

no

Are you interested in contributing with a fix?

no

gaetanquentin avatar Apr 07 '25 18:04 gaetanquentin

Hi @gaetanquentin,

thanks for reporting your issue.

I would like to point you to our documentation page on properly configuring the containerd service: https://microk8s.io/docs/configuring-services.

Please reach out if you continue experiencing troubles setting the snapshotter variable after following our docs.

Best regards, Louise

louiseschmidtgen avatar Apr 08 '25 09:04 louiseschmidtgen

Hi [@louiseschmidtgen ],

thanks for reporting your issue.

I would like to point you to our documentation page on properly configuring the containerd service: https://microk8s.io/docs/configuring-services.

Please reach out if you continue experiencing troubles setting the snapshotter variable after following our docs.

Best regards, Louise

h @louiseschmidtgen , could you please point me to the part where environment variable topic is covered? i have read it, and there is no answer about that. in args files, only option are set (--option).

gaetanquentin avatar Apr 08 '25 13:04 gaetanquentin

Hi @gaetanquentin,

We made a decision to override the snapshot parameter for containerd to support ZFS systems.

Unfortunately, this means that your setting gets overridden. As a workaround you can set the "${SNAPSHOTTER}" in /var/snap/microk8s/current/args/containerd. You will need to perform a stop and start for microk8s for this change to take effect.

Best regards, Louise

louiseschmidtgen avatar Apr 09 '25 12:04 louiseschmidtgen