Skip to content

Commit

Permalink
docs: add docker compose and kubernetes examples
Browse files Browse the repository at this point in the history
  • Loading branch information
luissimas committed Jun 23, 2024
1 parent 0294b9c commit 2d87a32
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 3,
"id": 1,
"links": [],
"panels": [
{
Expand Down Expand Up @@ -213,7 +213,7 @@
"type": "influxdb",
"uid": "edogaymh9y96of"
},
"query": "from(bucket: v.defaultBucket)\n|> range(start: -1d)\n|> last()\n|> group()",
"query": "from(bucket: v.defaultBucket)\n|> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n|> last()\n|> group()",
"refId": "A"
}
],
Expand Down Expand Up @@ -428,7 +428,7 @@
"type": "timeseries"
}
],
"refresh": "1m",
"refresh": "10s",
"schemaVersion": 39,
"tags": [],
"templating": {
Expand All @@ -437,7 +437,7 @@
"current": {
"selected": false,
"text": "influxdb",
"value": "edogaymh9y96of"
"value": "bdp8tekqeihogd"
},
"hide": 0,
"includeAll": false,
Expand All @@ -454,14 +454,14 @@
]
},
"time": {
"from": "now-5y",
"from": "now-1h",
"to": "now"
},
"timeRangeUpdatedDuringEditOrView": false,
"timepicker": {},
"timezone": "browser",
"title": "Zettelkasten",
"uid": "fdoghlpqzr5kwe",
"version": 8,
"version": 2,
"weekStart": ""
}
55 changes: 55 additions & 0 deletions examples/compose/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This is a sample compose file for deploying the zettelkasten-exporter
# using an InfluxDB storage.
version: '3.8'

volumes:
influxdb-data: {}
influxdb-config: {}
grafana-data: {}

services:
grafana:
image: grafana/grafana
depends_on:
- influxdb
restart: unless-stopped
volumes:
- grafana-data:/var/lib/grafan
ports:
- 3000:3000

influxdb:
image: influxdb:2
environment:
# We opt for an automated setup of InfluxDB for simplicity. It's
# strongly recommended to change those credentials or doing a
# manual InfluxDB setup
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: admin
DOCKER_INFLUXDB_INIT_PASSWORD: password
DOCKER_INFLUXDB_INIT_ORG: default
DOCKER_INFLUXDB_INIT_BUCKET: zettelkasten
DOCKER_INFLUXDB_INIT_RETENTION: 1w
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: demo-auth-token
volumes:
- influxdb-data:/var/lib/influxdb2
- influxdb-config:/etc/influxdb2
ports:
- 8086:8086

zettelkasten-exporter:
image: ghcr.io/luissimas/zettelkasten-exporter:latest
depends_on:
- influxdb
environment:
LOG_LEVEL: INFO
# Here we use a local directory for simplicity, but check out the
# README to see how to configure different sources such as git repositories.
ZETTELKASTEN_DIRECTORY: /sample
COLLECTION_INTERVAL: 10s
INFLUXDB_TOKEN: demo-auth-token
INFLUXDB_URL: http://influxdb:8086
INFLUXDB_ORG: default
INFLUXDB_BUCKET: zettelkasten
volumes:
- ./sample:/sample
3 changes: 3 additions & 0 deletions examples/compose/sample/dir1/dir2/four.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Four

Relative link to [[../three.md]]. And another link to [[one]].
7 changes: 7 additions & 0 deletions examples/compose/sample/dir1/three.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Three

Multiple links in this one.

[[one]]
[[two.md]]
[[four]]
5 changes: 5 additions & 0 deletions examples/compose/sample/one.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# One

This is a markdown note.

This is a [[link to a second|two.md]] note.
3 changes: 3 additions & 0 deletions examples/compose/sample/two.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Two

This note links to the [[three.md]] note.
66 changes: 66 additions & 0 deletions examples/kubernetes/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This is a sample manifest for deploying the zettelkasten-exporter using an InfluxDB
# storage.
# To deploy InfluxDB, see: https://github.com/influxdata/helm-charts/tree/master/charts/influxdb2
---
apiVersion: v1
kind: Namespace
metadata:
name: monitoring
---
apiVersion: v1
kind: Secret
metadata:
name: zettelkasten-exporter-env
namespace: monitoring
type: Opaque
data:
# These are placeholder values. Replace them with the
# appropriate values for your setup.
github-token: YW55LXRva2Vu
influxdb-token: YW55LXRva2Vu
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: zettelkasten-exporter
namespace: monitoring
labels:
app.kubernetes.io/name: zettelkasten-exporter
spec:
selector:
matchLabels:
app.kubernetes.io/name: zettelkasten-exporter
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: zettelkasten-exporter
spec:
containers:
- name: zettelkasten-exporter
image: "ghcr.io/luissimas/zettelkasten-exporter:latest"
env:
- name: LOG_LEVEL
value: INFO
- name: COLLECTION_INTERVAL
value: 5m
- name: ZETTELKASTEN_GIT_URL
value: <YOUR_REPOSITORY_GIT_URL>
- name: ZETTELKASTEN_GIT_BRANCH
value: master
- name: ZETTELKASTEN_GIT_TOKEN
valueFrom:
secretKeyRef:
name: zettelkasten-exporter-env
key: github-token
- name: INFLUXDB_URL
value: http://influxdb-influxdb2
- name: INFLUXDB_ORG
value: homelab
- name: INFLUXDB_BUCKET
value: zettelkasten
- name: INFLUXDB_TOKEN
valueFrom:
secretKeyRef:
name: zettelkasten-exporter-env
key: influxdb-token

0 comments on commit 2d87a32

Please sign in to comment.