rancher / rke2

https://docs.rke2.io/
Apache License 2.0
1.56k stars 268 forks source link

Use of `data-dir` does not place CLIs (e.g. `kubectl`) on the file system #6474

Closed aceeric closed 2 months ago

aceeric commented 2 months ago

Environmental Info: rke2 version v1.28.5+rke2r1 (adcd936ed6d7280080fba3670208cdea532de453) go version go1.20.12 X:boringcrypto

Node(s) CPU architecture, OS, and Version: Linux 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Fri Jun 14 03:19:37 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux

Cluster Configuration: single-node

Describe the bug: Overriding data-dir does not result in CLIs being installed in the overridden directory.

Steps To Reproduce: cat /etc/rancher/rke2/config.yaml has:

data-dir: /var/foo
selinux: false

Then yum install rke2-server .... Observe there is no /var/foo/rke2/bin/kubectl. But if you omit the data-dir configuration then /var/lib/rancher/rke2/bin/kubectl is present.

Expected behavior: /var/foo/rke2/bin/kubectl(and crictl, and ctr etc.) should exist

Actual behavior: Does not exist.

Additional context / logs: Note that this is not a problem for RKE2 per se but it affects https://github.com/rancherfederal/rke2-ansible - which expects kubectl in order to complete.

aceeric commented 2 months ago

Operator error. Works correctly.