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
|
|
@ -48,7 +48,7 @@ sudo loginctl enable-linger k8s # lets its services keep running after
|
|||
|
||||
# as k8s, from here on (sudo -iu, not su -, since k8s has no password set):
|
||||
sudo -iu k8s
|
||||
ssh-keygen -t ed25519 -C "k3s-homelab" -f ~/.ssh/k3s_homelab # only needed if you'll SSH in as k8s day-to-day
|
||||
ssh-keygen -t ed25519 -C "k3s-homelab" -f ~/.ssh/id_ed25519 # only needed if you'll SSH in as k8s day-to-day
|
||||
virsh -c qemu:///system list --all # sanity check: should run with no permission error, no sudo
|
||||
```
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ references — no placeholder-swapping needed).
|
|||
reuse that same in-cluster Secret) — it's never written to `k8s`'s
|
||||
filesystem at all.
|
||||
|
||||
Using HTTPS tokens instead of `k8s`'s SSH key (`~/.ssh/k3s_homelab`, from
|
||||
Using HTTPS tokens instead of `k8s`'s SSH key (`~/.ssh/id_ed25519`, from
|
||||
step 2) sidesteps an open question: Forgejo's git-SSH port isn't
|
||||
reachable from this desktop through your router (see the SSH
|
||||
troubleshooting earlier in this conversation), and whether it's reachable
|
||||
|
|
@ -136,7 +136,7 @@ chmod 600 ~/.git-credentials
|
|||
|
||||
cd ~/k3s/terraform
|
||||
cp terraform.tfvars.example terraform.tfvars
|
||||
# edit terraform.tfvars: ssh_public_key (contents of ~/.ssh/k3s_homelab.pub
|
||||
# edit terraform.tfvars: ssh_public_key (contents of ~/.ssh/id_ed25519.pub
|
||||
# from step 2), k3s_token. Defaults for network/sizing are fine to start.
|
||||
|
||||
tofu init
|
||||
|
|
@ -154,7 +154,21 @@ each on first boot — give it ~2 minutes after `apply` finishes.
|
|||
|
||||
## 6. Get kubectl talking to the cluster
|
||||
|
||||
`kubectl` itself was never actually installed anywhere earlier in this
|
||||
guide despite being listed as a prerequisite — install it now (as `k8s`,
|
||||
no sudo needed, same pattern as the OpenTofu install):
|
||||
|
||||
```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@$(tofu output -raw server_ip) sudo cat /etc/rancher/k3s/k3s.yaml \
|
||||
| sed "s/127.0.0.1/$(tofu output -raw server_ip)/" > ~/.kube/config-homelab
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue