## Summary - Add TeslaMate k8s deployment with Tailscale ingress at tesla.tail8d86e.ts.net - Add teslamate user to CloudNativePG blumeops-pg cluster - Add TeslaMate PostgreSQL datasource to Grafana - Import 18 TeslaMate Grafana dashboards for charging, drives, efficiency, etc. - Add teslamate database to borgmatic backup configuration ## Deployment and Testing - [ ] Create 1Password items: "TeslaMate DB Password" and "TeslaMate Encryption Key" - [ ] Apply database user secret: `op inject -i argocd/manifests/databases/secret-teslamate.yaml.tpl | kubectl apply -f -` - [ ] Sync blumeops-pg: `argocd app sync blumeops-pg` - [ ] Create teslamate database - [ ] Apply teslamate secrets (encryption key, db connection) - [ ] Apply Grafana datasource secret: `op inject -i argocd/manifests/grafana-config/secret-teslamate-datasource.yaml.tpl | kubectl apply -f -` - [ ] Sync apps and teslamate: `argocd app sync apps teslamate grafana grafana-config` - [ ] Complete Tesla API OAuth flow at https://tesla.tail8d86e.ts.net - [ ] Verify data collection starts - [ ] Verify Grafana dashboards show data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/47 |
||
|---|---|---|
| .. | ||
| blumeops-pg.yaml | ||
| kustomization.yaml | ||
| README.md | ||
| secret-borgmatic.yaml.tpl | ||
| secret-eblume.yaml.tpl | ||
| secret-teslamate.yaml.tpl | ||
| service-metrics-tailscale.yaml | ||
| service-tailscale.yaml | ||
Database Manifests
PostgreSQL clusters managed by CloudNativePG operator.
blumeops-pg
Single-instance PostgreSQL cluster for blumeops services.
Configuration
- Instances: 1 (single-node for minikube)
- Storage: 10Gi on
standardstorage class - Initial database:
minifluxowned byminifluxuser
Users/Roles
| User | Role | Purpose | Password Source |
|---|---|---|---|
| postgres | superuser | CNPG internal (avoid using) | blumeops-pg-superuser secret |
| miniflux | app owner | Owns miniflux database | blumeops-pg-app secret |
| eblume | superuser | Admin access (matches brew pg) | blumeops-pg-eblume secret (manual) |
| borgmatic | pg_read_all_data | Backup access for borgmatic | blumeops-pg-borgmatic secret (manual) |
Manual Secret Setup
Before deploying, create the password secrets:
# Create namespace first
kubectl create namespace databases
# Apply eblume password from 1Password
op inject -i argocd/manifests/databases/secret-eblume.yaml.tpl | kubectl apply -f -
# Apply borgmatic password from 1Password
op inject -i argocd/manifests/databases/secret-borgmatic.yaml.tpl | kubectl apply -f -
The miniflux user password is auto-generated by CloudNativePG and stored in blumeops-pg-app.
Connection Information
After the cluster is healthy:
# Connect via Tailscale (temporary hostname during migration)
psql -h k8s-pg.tail8d86e.ts.net -U eblume -W -d miniflux
# Or with password from 1Password
PGPASSWORD=$(op --vault blumeops item get guxu3j7ajhjyey6xxl2ovsl2ui --fields password --reveal) \
psql -h k8s-pg.tail8d86e.ts.net -U eblume -d miniflux
# Get miniflux app credentials (for applications)
kubectl -n databases get secret blumeops-pg-app -o jsonpath='{.data.uri}' | base64 -d
# Get postgres superuser credentials (emergency only)
kubectl -n databases get secret blumeops-pg-superuser -o jsonpath='{.data.password}' | base64 -d
Connecting via kubectl port-forward
Alternative if Tailscale service is unavailable:
# Terminal 1: Port-forward to the primary
kubectl -n databases port-forward svc/blumeops-pg-rw 5432:5432
# Terminal 2: Connect as eblume
PGPASSWORD=$(op --vault blumeops item get guxu3j7ajhjyey6xxl2ovsl2ui --fields password --reveal) \
psql -h localhost -U eblume -d miniflux
Status
# Check cluster health
kubectl -n databases get cluster blumeops-pg
# Check pods
kubectl -n databases get pods -l cnpg.io/cluster=blumeops-pg
# Check managed roles status
kubectl -n databases get cluster blumeops-pg -o jsonpath='{.status.managedRolesStatus}' | jq
# Operator logs
kubectl -n databases logs -l cnpg.io/cluster=blumeops-pg
Tailscale Exposure
Current: Temporary Service
k8s-pg.tail8d86e.ts.net - LoadBalancer service for testing during migration.
Phase 4: Production Service
After miniflux migrates to k8s, the pg.tail8d86e.ts.net Tailscale service will switch
from brew PostgreSQL (indri) to this k8s cluster. At that point:
- Delete
service-tailscale.yaml(thek8s-pgservice) - Update/create a service with
tailscale.com/hostname: "pg" - Verify the orphaned
k8s-pgdevice is removed from tailnet