From 758d6cae5cf7d899789e643b86bffb639a43fee6 Mon Sep 17 00:00:00 2001 From: Juhani Pelli Date: Thu, 25 Jul 2024 01:46:33 +0300 Subject: [PATCH] Use in-cluster archive --- .env | 2 -- README.md | 6 +++--- packages/archive/.khz-k3s/deployment.yaml | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 3d2b2ac..e81e74e 100644 --- a/.env +++ b/.env @@ -11,5 +11,3 @@ ARCHIVE_API_SSL=0 ARCHIVE_API_HOST=127.0.0.1 ARCHIVE_API_PORT=4000 ARCHIVE_API_PATH=/trpc -ARCHIVE_CLIENT_GCLOUD_SCOPE= -ARCHIVE_CLIENT_GCLOUD_CREDENTIALS= \ No newline at end of file diff --git a/README.md b/README.md index 26394bd..5f243f0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ This is a rebuild of [unkhz/ruuvitaulu](https://github.com/unkhz/ruuvitaulu), at Following shiny tools are used - [Cloudflare workers](https://workers.cloudflare.com/) for serverless functions and apps -- [Google Cloud Run](https://cloud.google.com/run) for apps that require nodejs apis - [Redis Streams](https://redis.io/docs/data-types/streams/) for durable processing of measurements - [TimescaleDb](https://www.timescale.com/) for SQL based long term storage of time series data - [Nx (package based)](https://nx.dev) for monorepo organization and task running @@ -48,6 +47,7 @@ npm run setup ### Running Run gateway functionality in gateway box + ``` npm run start-gateway ``` @@ -62,8 +62,8 @@ npm run start-gateway | Listener | Rust app / Ruuvi Station | Extract | captures measurements, forwards to gateway box | | Gatherer | Typescript app w/ Bun runtime | Staging | receives data from a different network, stores intermediate snapshots of measurement | | Queue | Redis streams | Staging | holds measurements, allows quantizing the time dimension of measurements | -| Publisher | Typescript app w/ Bun runtime | Transform / Load | transforms intermediate data into final format, pushes final data forward towards Archive | -| Archive | tRPC API for TimescaleDb | Load | stores data in final format, provides to consumers like Grafana, Configurator | +| Publisher | Typescript app w/ Bun runtime | Transform / Load | transforms intermediate data into final format, pushes final data forward towards Archive | +| Archive | tRPC API for TimescaleDb | Load | stores data in final format, provides to consumers like Grafana, Configurator | #### Network topology diagram (example setup) diff --git a/packages/archive/.khz-k3s/deployment.yaml b/packages/archive/.khz-k3s/deployment.yaml index 60be7dc..b96b99a 100644 --- a/packages/archive/.khz-k3s/deployment.yaml +++ b/packages/archive/.khz-k3s/deployment.yaml @@ -20,6 +20,21 @@ spec: containers: - name: ruuvipuserrin-archive image: ghcr.io/unkhz/ruuvipuserrin-archive:latest + env: + - name: PG_HOST + value: acid-minimal-cluster.postgres-operator.svc.cluster.local + - name: PG_PORT + value: '5432' + - name: PG_USER + valueFrom: + secretKeyRef: + name: postgres.acid-minimal-cluster.credentials.postgresql.acid.zalan.do + key: username + - name: PG_PASSWORD + valueFrom: + secretKeyRef: + name: postgres.acid-minimal-cluster.credentials.postgresql.acid.zalan.do + key: password ports: - containerPort: 8080 resources: