HashiCorp Vault on K3s on RPi4
To learn Kubernetes with a Raspberry Pi 4 and K3s.
I copied this section from the k3sup README go check it out.
k3sup
is distributed as a static Go binary. You can use the installer on MacOS and Linux, or visit the Releases page to download the executable for Windows.
curl -sLS https://get.k3sup.dev | sh
sudo install k3sup /usr/local/bin/
k3sup --help
k3sup
is made available free-of-charge, but you can support its ongoing development through GitHub Sponsors 💪
I would also suggest you check out Alex Ellis on Twitter
His Twitter account has inspired me to learn lots of fun stuff with Kubernetes FaaS and RPIs.
Note: You can copy ssh keys to a remote VM with
ssh-copy-id user@IP
.
Imagine the IP was 192.168.161.104
and the username was pi
, then you would run this:
- Run
k3sup
:
export IP=192.168.161.104
k3sup install --ip $IP --user pi --k3s-extra-args --no-deploy traefik
Use the optional argument to not deploy Traefik as the http port will overlap.
--k3s-extra-args
- Optional extra arguments to pass to k3s installer, wrapped in quotes, i.e.--k3s-extra-args '--no-deploy traefik'
.
I made a NodePort Service for port 30007
kubectl apply -f svc-vault-tcp-nodeport.yml
I made a ConfigMap to hold the Env vars.
kubectl apply -f configmap-vault-vars.yml
There are many ways to inject variables into the pod, I have some notes on the different patterns.
I made a Pod to stand up Vault with the littlest amount of complexity.
kubectl apply -f pod-vault.yml
I made a Deployment to stand up Vault with replicas and an update strategy.
kubectl apply -f deployment-vault.yml
Coming soon