Add TeslaMate deployment for Tesla Model Y data logging #47

Merged
eblume merged 8 commits from feature/teslamate into main 2026-01-22 21:25:45 -08:00
Owner

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

## 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)
- 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
- Create 1Password-templated secrets for encryption key and DB credentials

Requires user action before deployment:
1. Create 1Password items: "TeslaMate DB Password" and "TeslaMate Encryption Key"
2. Apply secrets via op inject
3. Create teslamate database manually

See argocd/manifests/teslamate/README.md for deployment instructions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use single "TeslaMate" item with db_password and api_enc_key fields
instead of separate items.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ -46,3 +46,7 @@ borgmatic_postgresql_databases:
hostname: pg.tail8d86e.ts.net
port: 5432
username: borgmatic
- name: teslamate
Author
Owner

Do we need to update borgmatic user's grants?

Do we need to update borgmatic user's grants?
eblume marked this conversation as resolved
@ -0,0 +30,4 @@
syncPolicy:
syncOptions:
- CreateNamespace=true
# Manual sync only - no automated sync on git push
Author
Owner

useless comment, please remove from other app manifests as well

useless comment, please remove from other app manifests as well
eblume marked this conversation as resolved
@ -0,0 +15,4 @@
spec:
containers:
- name: teslamate
image: teslamate/teslamate:latest
Author
Owner

let's avoid using :latest, use an explicit version tag (the latest at this moment, as it were)

let's avoid using :latest, use an explicit version tag (the latest at this moment, as it were)
eblume marked this conversation as resolved
- Use explicit TeslaMate version v2.2.0 instead of :latest
- Remove redundant "Manual sync only" comments from all app manifests

Note: borgmatic user already has pg_read_all_data role which grants
SELECT on all tables in all databases, so no grant updates needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Docker Hub uses 2.2.0 tag while GitHub release is v2.2.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The password contains @ characters which break URL parsing.
TeslaMate supports separate DATABASE_USER/PASS/NAME/HOST variables.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TeslaMate migrations need to create/drop PostgreSQL extensions
(cube, earthdistance) which requires superuser privileges.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TeslaMate 2.2.0 requires PostgreSQL 17.3+ for the 17.x series.
Upgrading to PostgreSQL 18 instead of minor version bump.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CloudNativePG 1.26+ supports declarative PostgreSQL major version upgrades.
Upgrading from chart v0.23.0 (operator 1.25.0) to v0.27.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
eblume merged commit 272ddb213b into main 2026-01-22 21:25:45 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!47
No description provided.