k3s-io / k3s-ansible

Apache License 2.0
1.89k stars 780 forks source link

Completely setup kubectl for ansible_user, with option to disable it #278

Closed dereknola closed 6 months ago

dereknola commented 6 months ago

Signed-off-by: Derek Nola derek.nola@suse.com

Background

Currently even though kubectl is linked to the ansible_user and we copy over the kubectl config from /etc/rancher/k3s/k3s.yaml running kubectl get pods as ansible_user would still fail as by default the kubectl provided by k3s uses /etc/rancher/k3s/k3s.yaml as the default kubeconfig. This requires the user to additional setup extra_server_args: --write-kubeconfig-mode=644 for the whole system to work.

Changes