Create a namespace and add your Rivian Credentials as a secret:
kubectl create ns rivian
kubectl create secret generic rivian-user-pass -n rivian \
--from-literal=rivian_username='ron.sweeney+api@hotmale.com' \
--from-literal=rivian_password='12345' # same as your luggage
Apply the Deployment and LoadBalancer (or NodePort)
kubectl apply -f deploy/* -n rivian
If everything worked out, we should see a pair of fonzies running on our cluster for the deployment and the MetalLB LoadBalancer Service.
Data Inspection
Now hit the MetalLB Load balancer on port 5000 and bask in the glory of the exported metrics.
Though, awesome, most arent impressed by metrics endpoints, but get set to get even more unimpressed looking at a round trip of errands using prometheus to explore the data.
You need to define a simple prometheus.yml
# Sample config for Prometheus.
global:
scrape_interval: 30s # By default, scrape targets every 15 seconds.
evaluation_interval: 30s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'deezwatts'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'deezwatts'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 30s
scrape_timeout: 30s
static_configs:
- targets: ['192.168.1.92:5000']
metrics_path: /
Then run it and hit http://localhost:9090 to explore the data time series in Prometheus.
docker run \
-p 9090:9090 \
-v $PWD/prom/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
Lets inspect the data running a couple of errands in the Whip.
So its like 3:PM or so EST, and I needed to go to the store, along the way, I stopped at Taco Bell, then drove home to Gun Lake. Total trip was about 20 miles or so, with 2 stops.
Gun Lake -> Taco Bell -> Grocery Store -> Gun Lake
Distance to Empty
I hope you appreciate the simplicity here, but prometheus told the story of my errands run... I started out with a full charge with an extended setting, drove 10 miles, did two stops very close to each other, then drove it back 10 miles. You can even see where I did some drive way shuffling before I plugged it in to charge to Standard.
Gear Status
This one wont win any visualization awards, but if you recall the metric we did was 0 = P, and anything else is 1 = in motion (whether backwards or forwards). You can clearly see the 3 errands and the park shuffling in the gear status as well.