docs: use default SSH key name, install kubectl, fix .kube dir
Some checks failed
terraform / validate (push) Has been cancelled
Some checks failed
terraform / validate (push) Has been cancelled
Rename k8s's key from the custom k3s_homelab to the default id_ed25519 - the custom name had no real justification (k8s is a fresh account with nothing to collide with) and caused a real bug: OpenSSH only auto-offers default-named keys, so ssh commands lacking an explicit -i silently failed to authenticate. Also add the never-actually-documented kubectl install step, and mkdir -p ~/.kube before the first redirect into it, in both SETUP.md and QUICKSTART.md.
This commit is contained in:
parent
a6123398bc
commit
73d9f92a2e
3 changed files with 36 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ and provision the "real" 3-node cluster properly instead.
|
|||
Shares steps 1–4 of `docs/SETUP.md` as prerequisites — do those first if you
|
||||
haven't:
|
||||
- Step 1: KVM/libvirt installed on the T630.
|
||||
- Step 2: the unprivileged `k8s` user exists, with `~/.ssh/k3s_homelab`
|
||||
- Step 2: the unprivileged `k8s` user exists, with `~/.ssh/id_ed25519`
|
||||
generated.
|
||||
- Step 3: `openssl rand -hex 32` isn't needed here (no agents joining, so no
|
||||
cluster token) — skip it.
|
||||
|
|
@ -92,7 +92,7 @@ virsh -c qemu:///system vol-list --pool default # should list both volumes
|
|||
```
|
||||
|
||||
Write the cloud-init user-data — paste in the contents of
|
||||
`~/.ssh/k3s_homelab.pub` where marked:
|
||||
`~/.ssh/id_ed25519.pub` where marked:
|
||||
|
||||
```sh
|
||||
mkdir -p ~/vms
|
||||
|
|
@ -107,7 +107,7 @@ users:
|
|||
shell: /bin/bash
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
ssh_authorized_keys:
|
||||
- PASTE ~/.ssh/k3s_homelab.pub CONTENTS HERE
|
||||
- PASTE ~/.ssh/id_ed25519.pub CONTENTS HERE
|
||||
|
||||
package_update: true
|
||||
packages:
|
||||
|
|
@ -162,7 +162,22 @@ Give cloud-init ~2 minutes to finish installing k3s after the VM boots.
|
|||
|
||||
```sh
|
||||
virsh -c qemu:///system domifaddr k3s-manual # note the IP under the default network
|
||||
```
|
||||
|
||||
If you haven't installed `kubectl` on the T630 yet (as `k8s`, no sudo
|
||||
needed):
|
||||
|
||||
```sh
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl
|
||||
mkdir -p ~/.local/bin
|
||||
mv kubectl ~/.local/bin/
|
||||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
```
|
||||
|
||||
```sh
|
||||
mkdir -p ~/.kube
|
||||
ssh k3s@<VM_IP> sudo cat /etc/rancher/k3s/k3s.yaml \
|
||||
| sed "s/127.0.0.1/<VM_IP>/" > ~/.kube/config-manual
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue