mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
Support user defined kubeconfig, fix merging context (#266)
* Support user defined kubeconfig, fix merging context Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
@@ -94,13 +94,16 @@ It is assumed that the control node has access to the internet. The playbook wil
|
||||
|
||||
## Kubeconfig
|
||||
|
||||
After successful bringup, the kubeconfig of the cluster is copied to the control node and set as default (`~/.kube/config`).
|
||||
Assuming you have [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) installed, you to confirm access to your **Kubernetes** cluster use the following:
|
||||
After successful bringup, the kubeconfig of the cluster is copied to the control node and merged with `~/.kube/config` under the `k3s-ansible` context.
|
||||
Assuming you have [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) installed, you can confirm access to your **Kubernetes** cluster with the following:
|
||||
|
||||
```bash
|
||||
kubectl config use-context k3s-ansible
|
||||
kubectl get nodes
|
||||
```
|
||||
|
||||
If you wish for your kubeconfig to be copied elsewhere and not merged, you can set the `kubeconfig` variable in `inventory.yml` to the desired path.
|
||||
|
||||
## Local Testing
|
||||
|
||||
A Vagrantfile is provided that provision a 5 nodes cluster using Vagrant (LibVirt or Virtualbox as provider). To use it:
|
||||
|
||||
Reference in New Issue
Block a user