-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 does not respect data-dir
set via config file drop-in, or via env var
#10589
Comments
It looks like K3S_DATA_DIR was used by the strongswan ipsec flannel backend to pass through the bin dir to the This has been gone for quite some time so there is no need for this to be set any longer:
|
Closing this issue as validated |
The multicall wrapper script does not honor config file drop-ins for the
--data-dir
flag. The flag will be found if set in the CLI args, or in /etc/rancher/k3s/config.yaml, but not if it is set in any file in /etc/rancher/k3s/config.yaml.d (or the equivalent drop-in dir if the--config
flag is used to change the path to config.yaml).The K3S_DATA_DIR env var does not map to the --data-dir CLI flag. It probably should. The multicall wrapper sets the K3S_DATA_DIR env var when it runs wrapped commands, but it appears that this is no longer used for anything - as there are no references to it anywhere else in the code base:
k3s/cmd/k3s/main.go
Line 196 in 59e0761
To reproduce:
mkdir -p /etc/rancher/k3s; echo "data-dir: /k8s" >> /etc/rancher/k3s/config.yaml; curl -sL get.k3s.io | sh -s - server
curl -sL get.k3s.io | sh -s - server --data-dir=/k8s
mkdir -p /etc/rancher/k3s/config.yaml.d; echo "data-dir: /k8s" >> /etc/rancher/k3s/config.yaml.d/99-data-dir.yaml; curl -sL get.k3s.io | sh -s - server
curl -sL get.k3s.io | K3S_DATA_DIR=/k8s sh -s - server
Note that for the case where
data-dir
is set in /etc/rancher/k3s/config.yaml.d/, the value is PARTIALLY respected. The stage 2k3s server
command honors the setting, but the binaries and packaged manifests are extracted out to the default path by the stage 1 multicall wrapper.The text was updated successfully, but these errors were encountered: