diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-03-15 20:41:19 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-03-16 09:30:48 -0400 |
commit | a50389a985f98ab6fd194fb045796111872efd4a (patch) | |
tree | 3d432e1651f5e24e5ec2255254be57d192b5542a | |
parent | 5d7d39943f02b74be6d77f706d06323fda998c4e (diff) | |
download | meta-virtualization-a50389a985f98ab6fd194fb045796111872efd4a.tar.gz |
k3s: clean up README
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/k3s/README.md | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/recipes-containers/k3s/README.md b/recipes-containers/k3s/README.md index e4cb3e33..d167bcdb 100644 --- a/recipes-containers/k3s/README.md +++ b/recipes-containers/k3s/README.md | |||
@@ -25,7 +25,6 @@ The convenience script `k3s-agent` can be used to set up a k3s agent (service): | |||
25 | ```shell | 25 | ```shell |
26 | k3s-agent -t <token> -s https://<master>:6443 | 26 | k3s-agent -t <token> -s https://<master>:6443 |
27 | ``` | 27 | ``` |
28 | |||
29 | (Here `<token>` is found in `/var/lib/rancher/k3s/server/node-token` at the | 28 | (Here `<token>` is found in `/var/lib/rancher/k3s/server/node-token` at the |
30 | k3s master.) | 29 | k3s master.) |
31 | 30 | ||
@@ -34,22 +33,55 @@ Example: | |||
34 | k3s-agent -t /var/lib/rancher/k3s/server/node-token -s https://localhost:6443 | 33 | k3s-agent -t /var/lib/rancher/k3s/server/node-token -s https://localhost:6443 |
35 | ``` | 34 | ``` |
36 | 35 | ||
36 | If you are running an all in one node (both the server and agent) for testing | ||
37 | purposes, do not run the above script. It will perform cleanup and break flannel | ||
38 | networking on your host. | ||
39 | |||
40 | Instead, run the following (note the space between 'k3s' and 'agent'): | ||
41 | |||
42 | ```shell | ||
43 | k3s agent -t /var/lib/rancher/k3s/server/token --server http://localhost:6443/ | ||
44 | ``` | ||
45 | |||
37 | ## Notes: | 46 | ## Notes: |
38 | 47 | ||
39 | if running under qemu, the default of 256M of memory is not enough, k3s will | 48 | Memory: |
40 | OOM and exit. | 49 | |
50 | if running under qemu, the default of 256M of memory is not enough, k3s will | ||
51 | OOM and exit. | ||
41 | 52 | ||
42 | Boot with qemuparams="-m 2048" to boot with 2G of memory (or choose the | 53 | Boot with qemuparams="-m 2048" to boot with 2G of memory (or choose the |
43 | appropriate amount for your configuration) | 54 | appropriate amount for your configuration) |
44 | 55 | ||
45 | Disk: if using qemu and core-image* you'll need to add extra space in your disks | 56 | Disk: |
46 | to ensure containers can start. The following in your image recipe, or local.conf | 57 | |
47 | would add 2G of extra space to the rootfs: | 58 | if using qemu and core-image* you'll need to add extra space in your disks |
59 | to ensure containers can start. The following in your image recipe, or | ||
60 | local.conf would add 2G of extra space to the rootfs: | ||
48 | 61 | ||
49 | ```shell | 62 | ```shell |
50 | IMAGE_ROOTFS_EXTRA_SPACE = "2097152" | 63 | IMAGE_ROOTFS_EXTRA_SPACE = "2097152" |
51 | ``` | 64 | ``` |
52 | 65 | ||
66 | ## Example qemux86-64 boot line: | ||
67 | |||
68 | ```shell | ||
69 | runqemu qemux86-64 nographic kvm slirp qemuparams="-m 2048" | ||
70 | ``` | ||
71 | |||
72 | k3s logs can be seen via: | ||
73 | |||
74 | |||
75 | ```shell | ||
76 | % journalctl -u k3s | ||
77 | ``` | ||
78 | |||
79 | or | ||
80 | |||
81 | ```shell | ||
82 | % journalctl -xe | ||
83 | ``` | ||
84 | |||
53 | ## Example output from qemux86-64 running k3s server: | 85 | ## Example output from qemux86-64 running k3s server: |
54 | 86 | ||
55 | ```shell | 87 | ```shell |
@@ -57,7 +89,6 @@ root@qemux86-64:~# kubectl get nodes | |||
57 | NAME STATUS ROLES AGE VERSION | 89 | NAME STATUS ROLES AGE VERSION |
58 | qemux86-64 Ready master 46s v1.18.9-k3s1 | 90 | qemux86-64 Ready master 46s v1.18.9-k3s1 |
59 | 91 | ||
60 | |||
61 | root@qemux86-64:~# kubectl get pods -n kube-system | 92 | root@qemux86-64:~# kubectl get pods -n kube-system |
62 | NAME READY STATUS RESTARTS AGE | 93 | NAME READY STATUS RESTARTS AGE |
63 | local-path-provisioner-6d59f47c7-h7lxk 1/1 Running 0 2m32s | 94 | local-path-provisioner-6d59f47c7-h7lxk 1/1 Running 0 2m32s |
@@ -234,5 +265,4 @@ Events: | |||
234 | Normal NodeHasNoDiskPressure 10m (x2 over 10m) kubelet Node qemux86-64 status is now: NodeHasNoDiskPressure | 265 | Normal NodeHasNoDiskPressure 10m (x2 over 10m) kubelet Node qemux86-64 status is now: NodeHasNoDiskPressure |
235 | Normal NodeHasSufficientPID 10m (x2 over 10m) kubelet Node qemux86-64 status is now: NodeHasSufficientPID | 266 | Normal NodeHasSufficientPID 10m (x2 over 10m) kubelet Node qemux86-64 status is now: NodeHasSufficientPID |
236 | Normal NodeReady 10m kubelet Node qemux86-64 status is now: NodeReady | 267 | Normal NodeReady 10m kubelet Node qemux86-64 status is now: NodeReady |
237 | 268 | ``` | |
238 | ```shell | ||