Skip to content

Commit a5427dd

Browse files
committed
Running kubectl requires using sudo kubectl
Signed-off-by: Anders F Björklund <[email protected]>
1 parent d1d4732 commit a5427dd

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

examples/k3s.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Deploy kubernetes via k3s (which installs a bundled containerd).
2+
# $ limactl start ./k3s.yaml
3+
# $ limactl shell k3s sudo kubectl
24
#
35
# It can be accessed from the host by exporting the kubeconfig file;
46
# the ports are already forwarded automatically by lima:

examples/k8s.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Deploy kubernetes via kubeadm.
2+
# $ limactl start ./k8s.yaml
3+
# $ limactl shell k8s sudo kubectl
24

35
# It can be accessed from the host by exporting the kubeconfig file;
46
# the ports are already forwarded automatically by lima:
@@ -74,13 +76,7 @@ provision:
7476
# Control plane node isolation
7577
kubectl taint nodes --all node-role.kubernetes.io/master-
7678
sed -e "s/${LIMA_CIDATA_SLIRP_IP_ADDRESS:-192.168.5.15}/127.0.0.1/" -i $KUBECONFIG
77-
- mode: user
78-
script: |
79-
#!/bin/bash
80-
set -eux -o pipefail
81-
mkdir -p $HOME/.kube
82-
sudo cp -f /etc/kubernetes/admin.conf $HOME/.kube/config
83-
sudo chown $(id -u):$(id -g) $HOME/.kube/config
79+
mkdir -p ${HOME:-/root}/.kube && cp -f $KUBECONFIG ${HOME:-/root}/.kube/config
8480
probes:
8581
- script: |
8682
#!/bin/bash

0 commit comments

Comments
 (0)