Compare commits

..
6 Commits
Author SHA1 Message Date
duynguyen 1861343f9f fix: stop actual-budget-exporter probes from hitting login-triggering /metrics
readinessProbe/livenessProbe hit /metrics on top of Prometheus's own
scrapes; exporter re-logs into actual_server on every call (no session
reuse), tripped actual_server's login rate limit (too-many-requests).
Switch probes to tcpSocket and stretch scrape interval to 5m.
2026-09-03 15:57:47 +07:00
duynguyen 26526ecc50 fix: add ACTUAL_E2E_PASSWORD_1 to actual-budget-exporter
Budget is E2E-encrypted; exporter fails with 'File ... is encrypted' without
this. Sourced from the same hand-created Secret as the other credentials.
2026-09-03 15:44:19 +07:00
duynguyen e9fa39f3f4 add: actual-budget-exporter app
Prometheus exporter for Actual Budget. actual_server itself stays in
homelab-docker-compose-prod (host docker-compose), exporter only scrapes it
over LAN and exposes /metrics via a ServiceMonitor. No HTTPRoute. Password
and budget ID come from a hand-created Secret, not committed.
2026-09-03 15:37:59 +07:00
duynguyen 08422398fc fix auth 2026-08-04 00:19:44 +07:00
duynguyen a06159c8e8 ignis: add basic auth via envoy SecurityPolicy
Ignis has no built-in auth; required now that ignis.fireflylab.cc
is a public hostname. Plain k8s Secret (no Vault yet) holding an
htpasswd hash, enforced at gateway via SecurityPolicy.
2026-08-04 00:14:33 +07:00
duynguyen 3d829d0ded ignis: add public hostname ignis.fireflylab.cc to HTTPRoute
Support multiple hostnames (LAN + public domain) via values list.
2026-08-04 00:08:02 +07:00
11 changed files with 230 additions and 23 deletions
+36 -3
View File
@@ -1,9 +1,10 @@
# Homelab Service — Apps # Homelab Service — Apps
Third bootstrap layer, run after `cluster-bootstrap` and `cluster-platform`. Third bootstrap layer, run after `cluster-bootstrap` and `cluster-platform`.
Personal/homelab apps (not cluster infra, not shared platform tooling) — first Personal/homelab apps (not cluster infra, not shared platform tooling) —
one here is [Ignis](https://github.com/Nystik-gh/ignis), a self-hosted [Ignis](https://github.com/Nystik-gh/ignis) (self-hosted browser-based
browser-based Obsidian. Obsidian) and `actual-budget-exporter` (Prometheus exporter for a
docker-compose-hosted Actual Budget instance).
## Architecture ## Architecture
@@ -71,3 +72,35 @@ kubectl logs -n ignis deploy/ignis # first boot downloads Obsidian, 1-2 min
``` ```
Visit `http://ignis.fireflylab.local` once the pod is Ready. Visit `http://ignis.fireflylab.local` once the pod is Ready.
## actual-budget-exporter
- Image: `docker.io/sakowicz/actual-budget-prometheus-exporter:latest`
Prometheus exporter for [Actual Budget](https://actualbudget.org/), no
official Helm chart, chart here is self-authored.
- `actual_server` itself is **not** in this cluster — it's a plain
docker-compose container on the homelab host
(`homelab-docker-compose-prod/actualbudget`), published on the host LAN IP.
`values.yaml` points `ACTUAL_SERVER_URL` at that host IP:port, same as
`actual-http-api` does in that repo.
- No HTTPRoute — this only serves `/metrics`. A `ServiceMonitor` (labeled
`release: kube-prometheus-stack` to match that stack's default selector)
gets it scraped by the cluster Prometheus instead.
- `ACTUAL_PASSWORD` / `ACTUAL_BUDGET_ID_1` / `ACTUAL_E2E_PASSWORD_1` are
**not** in `values.yaml` — plaintext Actual credentials don't belong in a
git-committed file. They come from a Secret you create by hand once, after
the Application syncs and the `actualbudget` namespace exists.
`ACTUAL_E2E_PASSWORD_1` is required if the budget has E2E encryption
enabled — the exporter fails with `File ... is encrypted. Please provide a
password.` otherwise; pass an empty string if the budget isn't encrypted:
```bash
kubectl create secret generic actual-budget-exporter-secrets \
-n actualbudget \
--from-literal=ACTUAL_PASSWORD='<your actual budget password>' \
--from-literal=ACTUAL_BUDGET_ID_1='<sync ID from Settings → Show advanced settings>' \
--from-literal=ACTUAL_E2E_PASSWORD_1='<E2E encryption password, empty string if none>'
```
Restart the deployment after creating/rotating it:
`kubectl rollout restart deployment/actual-budget-exporter -n actualbudget`.
@@ -0,0 +1,17 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: actual-budget-exporter
namespace: argocd
spec:
project: default
source:
repoURL: https://gitea.fireflylab.cc/duynguyen/homelab-services.git
targetRevision: main
path: apps/actual-budget-exporter/chart
destination:
server: https://kubernetes.default.svc
namespace: actualbudget
syncPolicy:
syncOptions:
- CreateNamespace=true
@@ -0,0 +1,6 @@
apiVersion: v2
name: actual-budget-exporter
description: Prometheus exporter for Actual Budget (https://github.com/sakowicz/actual-budget-prometheus-exporter)
type: application
version: 0.1.0
appVersion: "latest"
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: actual-budget-exporter
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: metrics
containerPort: {{ .Values.service.port }}
env:
{{- range $k, $v := .Values.env }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
- name: ACTUAL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secret.name }}
key: ACTUAL_PASSWORD
- name: ACTUAL_BUDGET_ID_1
valueFrom:
secretKeyRef:
name: {{ .Values.secret.name }}
key: ACTUAL_BUDGET_ID_1
- name: ACTUAL_E2E_PASSWORD_1
valueFrom:
secretKeyRef:
name: {{ .Values.secret.name }}
key: ACTUAL_E2E_PASSWORD_1
resources:
{{- toYaml .Values.resources | nindent 12 }}
# /metrics does a full login against actual_server on every hit
# (see actual-api-service.js: initializeApi() runs per getMetrics()
# call) — an httpGet probe against it every 10-20s was stacking on
# top of Prometheus's own scrapes and tripped actual_server's
# login-attempt rate limit ("too-many-requests"). Probe TCP only;
# let Prometheus be the sole thing that ever calls /metrics.
readinessProbe:
tcpSocket:
port: {{ .Values.service.port }}
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: {{ .Values.service.port }}
initialDelaySeconds: 15
periodSeconds: 20
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Release.Name }}
spec:
type: {{ .Values.service.type }}
selector:
app: {{ .Release.Name }}
ports:
- name: metrics
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
@@ -0,0 +1,22 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}
labels:
# kube-prometheus-stack's default serviceMonitorSelector only picks up
# ServiceMonitors carrying this label (release name of that Helm
# release, set by its ArgoCD Application name in cluster-platform).
release: kube-prometheus-stack
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: {{ .Release.Name }}
endpoints:
- port: metrics
path: /metrics
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
@@ -0,0 +1,39 @@
image:
repository: docker.io/sakowicz/actual-budget-prometheus-exporter
tag: latest
pullPolicy: IfNotPresent
replicaCount: 1
service:
type: ClusterIP
port: 3001
# actual_server is NOT in this cluster — it's a plain docker-compose
# container on the homelab host (see homelab-docker-compose-prod/actualbudget),
# published on the host LAN IP. Reach it the same way actual-http-api does.
env:
ACTUAL_SERVER_URL: "http://192.168.1.41:8002"
# ACTUAL_BUDGET_NAME_1: "" # optional, adds a friendly name to the prometheus label
# ACTUAL_PASSWORD, ACTUAL_BUDGET_ID_1, and ACTUAL_E2E_PASSWORD_1 are NOT set
# here — plaintext Actual credentials don't belong in a git-committed
# values.yaml. They're read from a Secret you create by hand once (see
# README.md), never committed. ACTUAL_E2E_PASSWORD_1 is required whenever the
# budget has E2E encryption enabled (exporter fails with "File ... is
# encrypted" otherwise) — leave the key empty in the Secret if it isn't.
secret:
name: actual-budget-exporter-secrets
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 128Mi
serviceMonitor:
enabled: true
# Each scrape does a full login against actual_server (no session reuse in
# this exporter) — kept long to avoid tripping its login rate limit.
interval: 5m
@@ -0,0 +1,22 @@
{{- if .Values.auth.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-basic-auth
type: Opaque
stringData:
.htpasswd: {{ .Values.auth.htpasswd | quote }}
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
name: {{ .Release.Name }}-basic-auth
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: {{ .Release.Name }}
basicAuth:
users:
name: {{ .Release.Name }}-basic-auth
{{- end }}
+6 -3
View File
@@ -3,14 +3,17 @@ apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute kind: HTTPRoute
metadata: metadata:
name: {{ .Release.Name }} name: {{ .Release.Name }}
# No built-in auth in Ignis itself — LAN-only exposure, same tradeoff # Ignis has no built-in auth — basic-auth enforced at the gateway via
# already accepted for Vault in cluster-platform. # SecurityPolicy (see basic-auth.yaml), required since one hostname is
# public-facing (ignis.fireflylab.cc).
spec: spec:
parentRefs: parentRefs:
- name: envoy-gateway - name: envoy-gateway
namespace: envoy-gateway-system namespace: envoy-gateway-system
hostnames: hostnames:
- {{ .Values.httpRoute.hostname | quote }} {{- range .Values.httpRoute.hostnames }}
- {{ . | quote }}
{{- end }}
rules: rules:
- matches: - matches:
- path: - path:
+9 -1
View File
@@ -37,4 +37,12 @@ persistence:
httpRoute: httpRoute:
enabled: true enabled: true
hostname: ignis.fireflylab.local hostnames:
- ignis.fireflylab.local
- ignis.fireflylab.cc
auth:
enabled: true
# bcrypt htpasswd line, e.g. output of: htpasswd -nB <user>
# Generate this yourself — do not put the plaintext password here.
htpasswd: "duynguyen:{SHA}piHIQK6WkZ/zAB5FibmIs4c7Eoo="
-16
View File
@@ -1,16 +0,0 @@
services:
ignis:
image: nobbe/ignis:latest
ports:
- "8080:8080"
environment:
- PUID=1000
- PGID=1000
volumes:
- ./vaults:/vaults
- ./data:/app/data
- obsidian-app:/app/obsidian-app
restart: unless-stopped
volumes:
obsidian-app: