From f6081dabebc953730a244bb5be58d9b63d4c6391 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:15 -0500 Subject: [PATCH 01/12] feat: add Helm chart Chart.yaml --- charts/logsight-ai/Chart.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 charts/logsight-ai/Chart.yaml diff --git a/charts/logsight-ai/Chart.yaml b/charts/logsight-ai/Chart.yaml new file mode 100644 index 0000000..cac10e5 --- /dev/null +++ b/charts/logsight-ai/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: logsight-ai +description: Production-focused Helm chart for the LogSight-AI API +type: application +version: 0.1.0 +appVersion: "0.2.0" +keywords: + - logs + - observability + - anomaly-detection +maintainers: + - name: CoreyLeath-code From e6a9dbc34feef7f57675911414349df53b4a253e Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:18 -0500 Subject: [PATCH 02/12] feat: add Helm chart values.yaml --- charts/logsight-ai/values.yaml | 105 +++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 charts/logsight-ai/values.yaml diff --git a/charts/logsight-ai/values.yaml b/charts/logsight-ai/values.yaml new file mode 100644 index 0000000..3865f62 --- /dev/null +++ b/charts/logsight-ai/values.yaml @@ -0,0 +1,105 @@ +replicaCount: 2 + +image: + repository: logsight-ai + pullPolicy: IfNotPresent + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + create: true + annotations: {} + name: "" + automountServiceAccountToken: false + +podAnnotations: {} +podLabels: {} + +podSecurityContext: + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 1000 + fsGroup: 1000 + seccompProfile: + type: RuntimeDefault + +securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: [ALL] + +service: + type: ClusterIP + port: 8000 + +resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: "1" + memory: 1Gi + +probes: + liveness: + initialDelaySeconds: 10 + periodSeconds: 20 + timeoutSeconds: 3 + failureThreshold: 3 + readiness: + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 + +env: + LOGSIGHT_WINDOW: "500" + LOGSIGHT_OTEL_ENABLED: "false" + LOGSIGHT_CELERY_DISPATCH_ENABLED: "false" + +extraEnv: [] +extraEnvFrom: [] + +autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 10 + targetCPUUtilizationPercentage: 70 + targetMemoryUtilizationPercentage: 80 + +podDisruptionBudget: + enabled: true + minAvailable: 1 + +networkPolicy: + enabled: true + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: ingress-nginx + ports: + - protocol: TCP + port: 8000 + egress: + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + podSelector: + matchLabels: + k8s-app: kube-dns + ports: + - protocol: UDP + port: 53 + - protocol: TCP + port: 53 + extraEgress: [] + +nodeSelector: {} +tolerations: [] +affinity: {} From 750af4b477a364c678627bbdbe5e0b1314e0ef94 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:20 -0500 Subject: [PATCH 03/12] feat: add Helm chart _helpers.tpl --- charts/logsight-ai/templates/_helpers.tpl | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 charts/logsight-ai/templates/_helpers.tpl diff --git a/charts/logsight-ai/templates/_helpers.tpl b/charts/logsight-ai/templates/_helpers.tpl new file mode 100644 index 0000000..1bcb366 --- /dev/null +++ b/charts/logsight-ai/templates/_helpers.tpl @@ -0,0 +1,40 @@ +{{- define "logsight-ai.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{- define "logsight-ai.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := include "logsight-ai.name" . }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{- define "logsight-ai.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{- define "logsight-ai.labels" -}} +helm.sh/chart: {{ include "logsight-ai.chart" . }} +{{ include "logsight-ai.selectorLabels" . }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{- define "logsight-ai.selectorLabels" -}} +app.kubernetes.io/name: {{ include "logsight-ai.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{- define "logsight-ai.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "logsight-ai.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} From 365906c8dc439ea533b8f158e47bd8a28c64068d Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:22 -0500 Subject: [PATCH 04/12] feat: add Helm chart serviceaccount.yaml --- charts/logsight-ai/templates/serviceaccount.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 charts/logsight-ai/templates/serviceaccount.yaml diff --git a/charts/logsight-ai/templates/serviceaccount.yaml b/charts/logsight-ai/templates/serviceaccount.yaml new file mode 100644 index 0000000..881630d --- /dev/null +++ b/charts/logsight-ai/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "logsight-ai.serviceAccountName" . }} + labels: + {{- include "logsight-ai.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} +{{- end }} From 6ed40087b23ca4bf3859644700cba201f4635165 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:24 -0500 Subject: [PATCH 05/12] feat: add Helm chart service.yaml --- charts/logsight-ai/templates/service.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 charts/logsight-ai/templates/service.yaml diff --git a/charts/logsight-ai/templates/service.yaml b/charts/logsight-ai/templates/service.yaml new file mode 100644 index 0000000..50a7d4b --- /dev/null +++ b/charts/logsight-ai/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "logsight-ai.fullname" . }} + labels: + {{- include "logsight-ai.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "logsight-ai.selectorLabels" . | nindent 4 }} From b8ce55f47850a2fb422ab1f47335b84fa6a180a7 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:44 -0500 Subject: [PATCH 06/12] feat: add Helm deployment.yaml --- charts/logsight-ai/templates/deployment.yaml | 88 ++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 charts/logsight-ai/templates/deployment.yaml diff --git a/charts/logsight-ai/templates/deployment.yaml b/charts/logsight-ai/templates/deployment.yaml new file mode 100644 index 0000000..e2da7d6 --- /dev/null +++ b/charts/logsight-ai/templates/deployment.yaml @@ -0,0 +1,88 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "logsight-ai.fullname" . }} + labels: + {{- include "logsight-ai.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "logsight-ai.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "logsight-ai.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ include "logsight-ai.serviceAccountName" . }} + automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: logsight-api + image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["uvicorn"] + args: ["logsight.api:app", "--host", "0.0.0.0", "--port", "8000"] + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + ports: + - name: http + containerPort: 8000 + protocol: TCP + env: + {{- range $name, $value := .Values.env }} + - name: {{ $name }} + value: {{ $value | quote }} + {{- end }} + {{- with .Values.extraEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.extraEnvFrom }} + envFrom: + {{- toYaml . | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + livenessProbe: + httpGet: + path: /health + port: http + {{- toYaml .Values.probes.liveness | nindent 12 }} + readinessProbe: + httpGet: + path: /health + port: http + {{- toYaml .Values.probes.readiness | nindent 12 }} + volumeMounts: + - name: tmp + mountPath: /tmp + volumes: + - name: tmp + emptyDir: + sizeLimit: 64Mi + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} From 3c60375d4454cfd677266d3c8fcc7b038513eb95 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:45 -0500 Subject: [PATCH 07/12] feat: add Helm hpa.yaml --- charts/logsight-ai/templates/hpa.yaml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 charts/logsight-ai/templates/hpa.yaml diff --git a/charts/logsight-ai/templates/hpa.yaml b/charts/logsight-ai/templates/hpa.yaml new file mode 100644 index 0000000..3c5c824 --- /dev/null +++ b/charts/logsight-ai/templates/hpa.yaml @@ -0,0 +1,30 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "logsight-ai.fullname" . }} + labels: + {{- include "logsight-ai.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "logsight-ai.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} From 10076c8f5baba4611bf18d0a8d562cd038173f18 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:47 -0500 Subject: [PATCH 08/12] feat: add Helm pdb.yaml --- charts/logsight-ai/templates/pdb.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 charts/logsight-ai/templates/pdb.yaml diff --git a/charts/logsight-ai/templates/pdb.yaml b/charts/logsight-ai/templates/pdb.yaml new file mode 100644 index 0000000..5348088 --- /dev/null +++ b/charts/logsight-ai/templates/pdb.yaml @@ -0,0 +1,13 @@ +{{- if .Values.podDisruptionBudget.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "logsight-ai.fullname" . }} + labels: + {{- include "logsight-ai.labels" . | nindent 4 }} +spec: + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + selector: + matchLabels: + {{- include "logsight-ai.selectorLabels" . | nindent 6 }} +{{- end }} From 0c6aa497dc5550d1c6b0224e2c8aa5665d99e7ed Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:58:48 -0500 Subject: [PATCH 09/12] feat: add Helm networkpolicy.yaml --- .../logsight-ai/templates/networkpolicy.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 charts/logsight-ai/templates/networkpolicy.yaml diff --git a/charts/logsight-ai/templates/networkpolicy.yaml b/charts/logsight-ai/templates/networkpolicy.yaml new file mode 100644 index 0000000..4446845 --- /dev/null +++ b/charts/logsight-ai/templates/networkpolicy.yaml @@ -0,0 +1,19 @@ +{{- if .Values.networkPolicy.enabled }} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "logsight-ai.fullname" . }} + labels: + {{- include "logsight-ai.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + {{- include "logsight-ai.selectorLabels" . | nindent 6 }} + policyTypes: + - Ingress + - Egress + ingress: + {{- toYaml .Values.networkPolicy.ingress | nindent 4 }} + egress: + {{- toYaml (concat .Values.networkPolicy.egress .Values.networkPolicy.extraEgress) | nindent 4 }} +{{- end }} From f93115e95db79dc5ed855a827f09cab3fcaf3137 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:59:13 -0500 Subject: [PATCH 10/12] ci: validate Helm chart --- .github/workflows/helm.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/helm.yml diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml new file mode 100644 index 0000000..028f437 --- /dev/null +++ b/.github/workflows/helm.yml @@ -0,0 +1,23 @@ +name: Helm + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + lint-and-template: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: azure/setup-helm@v4 + - run: helm lint charts/logsight-ai + - run: helm template logsight-ai charts/logsight-ai --namespace logsight > rendered-manifests.yaml + - uses: actions/upload-artifact@v7 + with: + name: helm-manifests + path: rendered-manifests.yaml From ea994cc6d5e0686cf7b00f33666113a2d0a0cc74 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:59:16 -0500 Subject: [PATCH 11/12] docs: add Helm deployment guide --- charts/logsight-ai/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 charts/logsight-ai/README.md diff --git a/charts/logsight-ai/README.md b/charts/logsight-ai/README.md new file mode 100644 index 0000000..786959e --- /dev/null +++ b/charts/logsight-ai/README.md @@ -0,0 +1,27 @@ +# LogSight-AI Helm chart + +This chart deploys the LogSight API as a hardened Kubernetes workload. It expects +the image to contain the `api` extra and leaves Redis, OTLP, and distributed +inference services as deployment-owned dependencies. + +## Install + +```bash +helm upgrade --install logsight-ai ./charts/logsight-ai \ + --namespace logsight --create-namespace \ + --set image.repository=registry.example/logsight-ai \ + --set image.tag=IMMUTABLE_DIGEST_OR_TAG +``` + +## Production configuration + +The chart defaults to two replicas, an HPA, a PDB, non-root/read-only container +security, a dedicated service account without a token, and a restrictive +NetworkPolicy. The default NetworkPolicy permits only ingress from the +`ingress-nginx` namespace and DNS egress. Add explicit `networkPolicy.extraEgress` +rules before configuring Redis, OTLP, Kafka, ClickHouse, or Qdrant endpoints. + +Pass credentials through `extraEnvFrom` references to externally managed Secrets; +do not place connection credentials in values files. Use immutable image tags or +digests, tune resource requests from measured workload behavior, and test +autoscaling/disruption behavior in a non-production namespace before promotion. From be163d33cb1bb5f0b2eb4eb7b5752d1671f1ddd2 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 13 Nov 2026 16:59:24 -0500 Subject: [PATCH 12/12] docs: document production Helm chart --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea735a1..da752cb 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,13 @@ pip install -e ".[api,kafka,observability,ai,parsing,redis]" The optional integrations are deliberately separated so a developer can use the original local-first CLI without downloading heavyweight ML or infrastructure clients. +### Helm deployment + +The production chart at `charts/logsight-ai` deploys the API with an HPA, PDB, +hardened pod/container settings, and a default-deny NetworkPolicy. It requires an +immutable image reference and explicit egress rules for deployment-owned +dependencies. See the [Helm chart guide](charts/logsight-ai/README.md). + ### Distributed inference workers The enterprise Compose stack includes an idle Celery embedding worker. Its task @@ -238,7 +245,7 @@ Pull requests retain the existing formatting, linting, strict typing, unit/integ - [x] Redis-backed deduplication/rate limiting - [x] OTel Collector deployment and trace-log correlation pipeline - [x] Celery/Ray distributed inference workers -- [ ] Helm chart with HPA/PDB/network policies +- [x] Helm chart with HPA/PDB/network policies - [ ] RAG incident investigator with versioned runbooks/commits - [ ] Labeled benchmark corpus with precision/recall and alert-burden metrics @@ -248,6 +255,7 @@ Pull requests retain the existing formatting, linting, strict typing, unit/integ - [Architecture](docs/architecture.md) - [Collector correlation](docs/OTEL_COLLECTOR.md) - [Celery inference workers](docs/CELERY_WORKERS.md) +- [Helm chart](charts/logsight-ai/README.md) - [Deployment and rollback checklist](docs/DEPLOYMENT.md) - [Benchmark methodology](docs/BENCHMARKING.md) - [Mathematical foundations](docs/MATHEMATICAL_FOUNDATIONS.md)