diff --git a/README.md b/README.md index b8e5817..c450d23 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Also, the repository name is a reference to my local TLD which is `.haven` :) - AdGuardHome-2 (2nd instance) - AdGuard-Sync - infra - - Haven Notify (my own internal service) + - [Haven Notify](https://git.ivanch.me/ivanch/server-scripts/src/branch/main/haven-notify) - Beszel - Beszel Agent (running as DaemonSet) - Code Config (vscode for internal config editing) @@ -35,6 +35,13 @@ Also, the repository name is a reference to my local TLD which is `.haven` :) - dev - Gitea Runner (x64) - Gitea Runner (arm64) +- monitoring + - Grafana + - Prometheus + - Node Exporter + - Kube State Metrics + - Loki + - Alloy #### Miscellaneous namespaces @@ -49,4 +56,7 @@ Also, the repository name is a reference to my local TLD which is `.haven` :) - Move archivebox data to its own PVC on NAS - Move uptimekuma to `infra` namespace - Add links to each application docs -- Add links to server scripts \ No newline at end of file +- Add links to server scripts +- Move alloy to `monitoring` namespace +- Change `loki`, `grafana`, and `prometheus` to Helm chart installation +- Change loki and prometheus to use PVCs \ No newline at end of file diff --git a/infra/beszel.yaml b/infra/beszel.yaml index a1f5f3f..48f401c 100644 --- a/infra/beszel.yaml +++ b/infra/beszel.yaml @@ -15,9 +15,18 @@ spec: labels: app: beszel spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - amd64 containers: - name: beszel - image: ghcr.io/henrygd/beszel/beszel:14.1 + image: ghcr.io/henrygd/beszel/beszel:0.14.1 imagePullPolicy: Always ports: - containerPort: 8090 diff --git a/monitoring/loki.yaml b/monitoring/loki.yaml new file mode 100644 index 0000000..ccaf7fd --- /dev/null +++ b/monitoring/loki.yaml @@ -0,0 +1,101 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: loki + namespace: monitoring +spec: + replicas: 1 + selector: + matchLabels: + app: loki + template: + metadata: + labels: + app: loki + spec: + containers: + - name: loki + image: grafana/loki:3 + args: ["-config.file=/etc/loki/config/config.yaml"] + ports: + - containerPort: 3100 + volumeMounts: + - name: config + mountPath: /etc/loki/config + - name: loki-storage + mountPath: /tmp/loki + volumes: + - name: config + configMap: + name: loki-config + - name: loki-storage + emptyDir: + medium: Memory +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: loki-config + namespace: monitoring +data: + config.yaml: | + auth_enabled: true + server: + http_listen_port: 3100 + + common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: inmemory + replication_factor: 1 + path_prefix: /tmp/loki + querier: + multi_tenant_queries_enabled: true + + schema_config: + configs: + - from: "2024-01-01" + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + + storage_config: + tsdb_shipper: + active_index_directory: /tmp/loki/index + cache_location: /tmp/loki/cache + filesystem: + directory: /tmp/loki/chunks + + limits_config: + allow_structured_metadata: true + retention_period: 0 + + ingester: + lifecycler: + ring: + kvstore: + store: inmemory + replication_factor: 1 + chunk_idle_period: 1m + max_chunk_age: 5m + chunk_target_size: 1536000 + + compactor: + retention_enabled: false +--- +apiVersion: v1 +kind: Service +metadata: + name: loki + namespace: monitoring +spec: + ports: + - port: 3100 + targetPort: 3100 + name: http + selector: + app: loki \ No newline at end of file