No description
- Smarty 51.6%
- Shell 48.4%
|
|
||
|---|---|---|
| .github | ||
| .teamcity | ||
| charts/vaultwarden | ||
| .env | ||
| .gitignore | ||
| .helmignore | ||
| appinfo.md | ||
| cf-dns.sh | ||
| install.sh | ||
| k8.sh | ||
| README.md | ||
| remote-bridge.sh | ||
| ssoconfig.sh | ||
🚀 Vaultwarden K8s Automation Suite
Professional automation suite for deploying [Vaultwarden] with full Keycloak SSO integration and Argon2 secured admin panels.
🛠 Requirements
The machine executing the installation must have:
- bash, jq, openssl, argon2
- kubectl/helm
- running an k8 cluster or has direct access over cli to an remote cluster
🚀 Execution Flow
1. Manual / Standard Installation
For most users, the installation is a single-step process after configuration.
- Configure Environment: Create and fill your
.envfile. - Run Install:
source .env && ./install.sh
🔐 Security Architecture
Argon2id & Kubernetes Secrets
To ensure maximum security and compatibility across different shell environments (local vs. remote bridge), this suite uses a decoupled hashing and storage mechanism.
- Local Hashing: The
install.shgenerates a random password and hashes it usingargon2idlocally. This prevents the plain-text password from being sent over the wire during the Kubernetes API calls. - Secret Encapsulation: Instead of passing the hash as a raw environment variable (which often fails due to the
$characters and commas),k8.shcreates a Kubernetes Secret. - Volume Mapping: Vaultwarden consumes this secret as an environment variable (
ADMIN_TOKEN), ensuring the hash remains "literal" and untouched by shell expansion.
📡 Automated DNS & Discovery
The suite includes a smart discovery loop in cf-dns.sh to handle the delay between Helm installation and Cloud Provider LoadBalancer provisioning.
- The Wait Loop: The script polls the Kubernetes API for 120 seconds (12 attempts every 10 seconds).
- Dual Support: It automatically detects both IP-based endpoints (typically Bare Metal/GCP/Azure) and Hostname-based endpoints (typically AWS ELB).
- Cloudflare Integration: Once the endpoint is found, it creates/updates a proxied
AorCNAMErecord to match yourFQDN.
Login
- Go to app FQDN and enter ANY EMAIL address then click on Use single sign-on to be redirected to keycloak login.
- After keycloak you will be asked to setup an master password you must do this and remember it.
Admin Login
- Go to app FQDN/admin and enter the admin password found in the deployment-summary.json
🛠 Troubleshooting
"Invalid Admin Token"
If you cannot log in to /admin despite having the correct password:
- Check the Secret: Run
kubectl get secret vaultwarden-admin-token -n <namespace> -o jsonpath='{.data.token}' | base64 -d. Verify the output starts with$argon2id$. - Shell Expansion: If you see a truncated string (e.g., starting with
=19), it means your shell ate the$during deployment. Ensure you are using the latestk8.shwhich uses thefrom-literalsecret flag.