driplineorg / driplineorg/controls-guide

database and grafana implementation for 2nd mesh

Open
#12 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I think I've successfully added a database, datalogger, and grafana to work with the kv store example. Is this something that would be of interest to push to the repo? If this is useful, then I can work on adding to the these examples to the 2nd mesh.

Here are my config files.

### kv-store-sensor-logger-values.yaml
```
replicaCount: 1

#image:
#repository: dragonfly-extended
#tag: beta
#pullPolicy: IfNotPresent

configFileData:
runtime-config:
name: sensor_data_logger
module: PostgresSensorLogger
auth_file: /etc/rabbitmq-secret/authentications.json
# SensorLogger Inits
insertion_table_endpoint_name: values_table
# AlertConsumer Inits
alert_keys:
- "sensor_value.#"
alert_key_parser_re: 'sensor_value\.(?P\w+)'
# PostgreSQLInterface Inits
database_name: sensor_data
database_server: postgres-kvstore-postgresql.default.svc.cluster.local
#this is bad... waiting on a scarab update to let us pass
# actual details via env vars
auths_file: "/etc/rabbitmq-secret/authentications.json"
endpoints:
- name: values_table
module: SQLTable
table_name: numeric_data
required_insert_names:
- sensor_name
- timestamp
- value_raw
optional_insert_names:
- value_cal

```
### grafana-values.yaml

```
admin:
user: user
password: password
datasources:
secretName: orpheusdb-grafana
persistence:
enabled: false
```
### postgres-secret.yaml
```
apiVersion: v1
kind: Secret
metadata:
name: postgres-secret
type: Opaque
data:
postgresql-password: redacted-base64
```
### grafana-postgres-secret.yaml

```
apiVersion: v1
kind: Secret
metadata:
name: orpheusdb-grafana
namespace: default
type: Opaque
stringData:
other_datasource.yaml: |-
apiVersion: 1
datasources:
- name: sensor_db
type: postgres
url: postgres-kvstore-postgresql.default.svc.cluster.local
database: sensor_data
user: orpheus_master
secureJsonData:
password: "findaxions"
jsonData:
sslmode: "disable" # disable/require/verify-ca/verify-full
maxOpenConns: 0 # Grafana v5.4+
maxIdleConns: 2 # Grafana v5.4+
connMaxLifetime: 14400 # Grafana v5.4+
postgresVersion: 1000 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10
timescaledb: false
```
### postgres-kvstore-values.yaml
```
image:
registry: docker.io
repository: bitnami/postgresql
#tag: 9.6.17-debian-10-r91
tag: 11.7.0-debian-10-r90

persistence:
enabled: false

postgresqlUsername: testuser
existingSecret: postgres-secret

initdbScripts:
10_setup.sql: |
---
--- Create a database for our values
---

CREATE DATABASE sensor_data WITH TEMPLATE = template0;

\connect sensor_data

-- table for storing doubles
-- NOTE: this design is very bad and only used as an example for easy
-- demonstration a production system probably wants to map sensor names
-- onto IDs may want to allow annotations of entries, may want annotation
-- of sensors, etc.

DROP TABLE IF EXISTS numeric_data;
CREATE TABLE numeric_data (
sensor_name text NOT NULL,
"timestamp" timestamp with time zone NOT NULL default now(),
value_raw double precision NOT NULL,
value_cal double precision
);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the kv-store example and the proposed kv-store-sensor-logger-values.yaml, grafana-values.yaml, postgres-secret.yaml, grafana-postgres-secret.yaml, and postgres-kvstore-values.yaml files. Clarify whether these configurations should be added for the second mesh, then define the deployment and example validation needed before considering the integration complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
grafana, postgresql
Domain
databases, devops, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.