# logsys Helm chart This chart deploys a complete log collection and storage stack: - **Loki** — Log storage engine (StatefulSet with PersistentVolume) - **Vector** — Log collector agent (DaemonSet) The Vector agent collects container JSON logs from the `shop-recycle` namespace and ships parsed labels to Loki and metrics to a Prometheus exporter. Configuration and parsing rules are adapted from the Log.md monitoring guide. ## Install ```bash helm upgrade --install vector ./k8s/logsys -n shoprecycle --create-namespace ``` This single command deploys: - Loki StatefulSet with persistent storage (10Gi default) - Vector DaemonSet for log collection - All ConfigMaps for configuration ## Configuration **Loki:** - `loki.enabled` — Enable/disable Loki deployment (default: true) - `loki.namespace` — Namespace (default: shoprecycle) - `loki.replicas` — Number of Loki replicas (default: 1) - `loki.persistence.size` — Storage size (default: 10Gi) - `loki.retention.days` — Log retention in days (default: 30) **Vector:** - `vector.enabled` — Enable/disable Vector deployment (default: true) - `vector.loki.endpoint` — Loki push endpoint (default: `http://loki:3100`) - `vector.logSelector` — List of app names to collect (defaults: gateway/order/payment/web) ## Usage After deployment, access Loki via: ```bash kubectl port-forward -n shoprecycle svc/loki 3100:3100 ``` Then configure Grafana to use datasource `http://loki:3100`. ## Notes - This chart mounts `/var/log` from the host on each node. - Loki uses filesystem storage with BoltDB for production-style log indexing. - Follow the migration steps in Log.md: start with staging dual-write, then canary, then full roll-out.