Skip to content

Commit fd6a10d

Browse files
committed
Add message on how to run kubectl remotely
Currently this information is hidden in the YAML file. Show "actionable" output, similar to docker and podman. Signed-off-by: Anders F Björklund <[email protected]>
1 parent 2d0feb5 commit fd6a10d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

examples/k3s.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ probes:
4646
The k3s kubeconfig file has not yet been created.
4747
Run "limactl shell k3s sudo journalctl -u k3s" to check the log.
4848
If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log".
49+
message: |
50+
To run `kubectl` on the host (assumes kubectl is installed):
51+
$ mkdir -p "{{.Dir}}/conf"
52+
$ export KUBECONFIG="{{.Dir}}/conf/kubeconfig.yaml"
53+
$ limactl shell {{.Name}} sudo cat /etc/rancher/k3s/k3s.yaml >$KUBECONFIG
54+
$ kubectl ...

examples/k8s.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,9 @@ probes:
103103
echo >&2 "kubernetes cluster is not up and running yet"
104104
exit 1
105105
fi
106+
message: |
107+
To run `kubectl` on the host (assumes kubectl is installed):
108+
$ mkdir -p "{{.Dir}}/conf"
109+
$ export KUBECONFIG="{{.Dir}}/conf/kubeconfig.yaml"
110+
$ limactl shell {{.Name}} sudo cat /etc/kubernetes/admin.conf >$KUBECONFIG
111+
$ kubectl ...

0 commit comments

Comments
 (0)