Skip to content

Commit 77d4fdd

Browse files
NotYuShengclaude
andcommitted
feat: Implement enterprise-grade Helm standardization with shared values
### Summary Standardize all Helm charts with identical structure, add production-ready templates, and implement shared values system for centralized configuration management across staging, pre-staging, and production environments. ### Major Changes - ✅ Standardize all 4 service charts with identical template coverage - ✅ Add production templates: NetworkPolicy, PodDisruptionBudget, ServiceMonitor, NOTES.txt - ✅ Create shared values system (helm/shared-values/) for centralized config management - ✅ Remove dev environment (development uses docker-compose, not Helm) - ✅ Update Makefile with shared values support and improved documentation - ✅ Add template coverage: ingress, hpa, tests for all services - ✅ Standardize naming: persistentvolumeclaim.yaml → pvc.yaml ### Benefits - 🏢 Enterprise-grade configuration management (Fortune 500 standards) - 🔄 Single point of control for cross-service configuration changes - 🔒 Production-ready security, monitoring, and high availability - 📊 Environment-specific scaling and feature management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3848d76 commit 77d4fdd

43 files changed

Lines changed: 1606 additions & 410 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,19 @@ make uninstall CHART_NAME=chat-service
103103

104104
### Data Flow
105105
1. Files uploaded via nginx (8080) → pdf_processor_service (8000)
106-
2. pdf_processor_service orchestrates other services as needed
106+
2. pdf_processor_service orchestrates other services as needed:
107+
- pdf_extraction_service for tables/images
108+
- docling_translation_service for content translation
109+
- embedder_service for text processing
107110
3. embedder_service chunks text → ChromaDB for vector storage
108111
4. chat_service queries ChromaDB + LLM for RAG responses
112+
5. Session data managed via Redis, file storage via MinIO
109113

110114
### Shared Utilities
111115
- `openai_client.py`: Configurable OpenAI-compatible client (works with vLLM)
112116
- `chroma_client.py`: Async ChromaDB client with environment-based config
117+
- `redis.py`: Redis connection utilities for session management
118+
- `s3_utils.py`: MinIO/S3 operations for file storage
113119
- All shared utilities use environment variables for configuration
114120

115121
## Code Standards
@@ -136,6 +142,13 @@ make uninstall CHART_NAME=chat-service
136142
- Each service should be tested independently
137143
- Use the `/health` endpoints for basic connectivity testing
138144
- Helm charts include test connections via `test-connection.yaml`
145+
- E2E testing setup available in `cypress/` directory
146+
147+
### Development Dependencies
148+
Each service uses minimal dependencies:
149+
- **FastAPI** + **uvicorn** for web framework
150+
- **OpenAI client** for LLM integration (compatible with vLLM)
151+
- Service-specific requirements in each `{service}/requirements.txt`
139152

140153
### Port Assignments (Development Only)
141154
Development ports are documented in README.md. Production deployments should use proper routing layers (Ingress, Service Mesh, etc.).

Makefile

Lines changed: 80 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,26 @@
44
NAMESPACE ?= omnipdf
55
CHART_NAME ?= example-service
66
CHART_DIR ?= helm/$(CHART_NAME)
7-
ENV ?= dev
8-
VALUES_FILE ?= $(CHART_DIR)/values-$(ENV).yaml
7+
ENV ?= staging
8+
9+
# Shared values configuration
10+
SHARED_VALUES_DIR ?= helm/shared-values
11+
SHARED_BASE_VALUES ?= $(SHARED_VALUES_DIR)/common-base.yaml
12+
SHARED_ENV_VALUES ?= $(SHARED_VALUES_DIR)/common-$(ENV).yaml
13+
14+
# Service-specific values files
15+
SERVICE_VALUES_FILE ?= $(CHART_DIR)/values.yaml
16+
SERVICE_ENV_VALUES_FILE ?= $(CHART_DIR)/values-$(ENV).yaml
17+
18+
# Build values file list (in order of precedence)
19+
VALUES_FILES = -f $(SHARED_BASE_VALUES)
20+
ifneq ($(wildcard $(SHARED_ENV_VALUES)),)
21+
VALUES_FILES += -f $(SHARED_ENV_VALUES)
22+
endif
23+
ifneq ($(wildcard $(SERVICE_ENV_VALUES_FILE)),)
24+
VALUES_FILES += -f $(SERVICE_ENV_VALUES_FILE)
25+
endif
26+
VALUES_FILES += -f $(SERVICE_VALUES_FILE)
927

1028
# Default port for port-forwarding (override as needed)
1129
LOCAL_PORT ?= 8000
@@ -14,12 +32,12 @@ REMOTE_PORT ?= 8000
1432
.PHONY: help install install-all upgrade upgrade-all uninstall uninstall-all lint status port-forward
1533

1634
help:
17-
@echo "Makefile commands for Helm chart management:"
35+
@echo "Makefile commands for Helm chart management with shared values:"
1836
@echo ""
1937
@echo "Single-service commands:"
20-
@echo " make install Install chart (CHART_NAME, ENV)"
38+
@echo " make install Install chart with shared values (CHART_NAME, ENV)"
2139
@echo " e.g. make install CHART_NAME=chat-service ENV=staging"
22-
@echo " make upgrade Upgrade chart (CHART_NAME, ENV)"
40+
@echo " make upgrade Upgrade chart with shared values (CHART_NAME, ENV)"
2341
@echo " e.g. make upgrade CHART_NAME=embedder-service ENV=prod"
2442
@echo " make uninstall Uninstall chart (CHART_NAME)"
2543
@echo " e.g. make uninstall CHART_NAME=pdf-processor"
@@ -31,32 +49,48 @@ help:
3149
@echo " e.g. make port-forward CHART_NAME=chat-service LOCAL_PORT=8000 REMOTE_PORT=8000"
3250
@echo ""
3351
@echo "Multi-service commands:"
34-
@echo " make install-all Install all charts under ./helm/ (ENV)"
52+
@echo " make install-all Install all charts with shared values (ENV)"
3553
@echo " e.g. make install-all ENV=prod"
36-
@echo " make upgrade-all Upgrade all charts under ./helm/ (ENV)"
54+
@echo " make upgrade-all Upgrade all charts with shared values (ENV)"
3755
@echo " e.g. make upgrade-all ENV=staging"
3856
@echo " make uninstall-all Uninstall all charts under ./helm/"
3957
@echo ""
58+
@echo "Shared Values System:"
59+
@echo " Values are applied in order (later values override earlier ones):"
60+
@echo " 1. helm/shared-values/common-base.yaml - Base configuration for all services"
61+
@echo " 2. helm/shared-values/common-{ENV}.yaml - Environment-specific shared config"
62+
@echo " 3. helm/{SERVICE}/values-{ENV}.yaml - Service-specific environment config"
63+
@echo " 4. helm/{SERVICE}/values.yaml - Service-specific base config"
64+
@echo ""
4065
@echo "Environment Variables:"
41-
@echo " ENV Environment (dev, staging, prestaging, prod) - defaults to 'dev'"
66+
@echo " ENV Environment (staging, prestaging, prod) - defaults to 'staging'"
67+
@echo ""
68+
@echo "Development Environment:"
69+
@echo " Use docker-compose for local development:"
70+
@echo " docker-compose up -d # Start all services locally"
71+
@echo " docker-compose logs -f chat_service # View service logs"
4272
@echo ""
4373
@echo "⚠️ IMPORTANT:"
4474
@echo " Avoid underscores (_) in CHART_NAME or release names."
4575
@echo " Use hyphens (-) instead to follow Kubernetes naming conventions (RFC 1123)."
4676
@echo " Example: use chat-service ✅, not chat_service ❌"
4777

48-
## Install a single Helm chart
78+
## Install a single Helm chart with shared values
4979
install:
80+
@echo "Installing $(CHART_NAME) with shared values for environment: $(ENV)"
81+
@echo "Values files (in order): $(VALUES_FILES)"
5082
helm upgrade --install $(CHART_NAME) $(CHART_DIR) \
5183
--namespace $(NAMESPACE) \
5284
--create-namespace \
53-
--values $(VALUES_FILE)
85+
$(VALUES_FILES)
5486

55-
## Upgrade a single Helm chart
87+
## Upgrade a single Helm chart with shared values
5688
upgrade:
89+
@echo "Upgrading $(CHART_NAME) with shared values for environment: $(ENV)"
90+
@echo "Values files (in order): $(VALUES_FILES)"
5791
helm upgrade $(CHART_NAME) $(CHART_DIR) \
5892
--namespace $(NAMESPACE) \
59-
--values $(VALUES_FILE)
93+
$(VALUES_FILES)
6094

6195
## Uninstall a single Helm chart
6296
uninstall:
@@ -75,28 +109,48 @@ status:
75109
@echo "=== Pod Status ==="
76110
kubectl get pods -n $(NAMESPACE) -l "app.kubernetes.io/name=$(CHART_NAME),app.kubernetes.io/instance=$(CHART_NAME)"
77111

78-
## Install all Helm charts in ./helm/
112+
## Install all Helm charts in ./helm/ with shared values
79113
install-all:
80-
@echo "Installing all Helm charts under ./helm/..."
114+
@echo "Installing all Helm charts under ./helm/ with shared values for environment: $(ENV)"
81115
@for dir in helm/*/; do \
82116
CHART=$$(basename $$dir); \
83-
echo "Installing chart: $$CHART"; \
84-
helm upgrade --install $$CHART helm/$$CHART \
85-
--namespace $(NAMESPACE) \
86-
--create-namespace \
87-
--values helm/$$CHART/values-$(ENV).yaml; \
117+
if [ "$$CHART" != "shared-values" ]; then \
118+
echo "Installing chart: $$CHART"; \
119+
CHART_VALUES="-f $(SHARED_BASE_VALUES)"; \
120+
if [ -f "$(SHARED_VALUES_DIR)/common-$(ENV).yaml" ]; then \
121+
CHART_VALUES="$$CHART_VALUES -f $(SHARED_VALUES_DIR)/common-$(ENV).yaml"; \
122+
fi; \
123+
if [ -f "helm/$$CHART/values-$(ENV).yaml" ]; then \
124+
CHART_VALUES="$$CHART_VALUES -f helm/$$CHART/values-$(ENV).yaml"; \
125+
fi; \
126+
CHART_VALUES="$$CHART_VALUES -f helm/$$CHART/values.yaml"; \
127+
helm upgrade --install $$CHART helm/$$CHART \
128+
--namespace $(NAMESPACE) \
129+
--create-namespace \
130+
$$CHART_VALUES; \
131+
fi; \
88132
done
89133

90-
## Upgrade all Helm charts in ./helm/
134+
## Upgrade all Helm charts in ./helm/ with shared values
91135
upgrade-all:
92-
@echo "Upgrading all Helm charts under ./helm/..."
136+
@echo "Upgrading all Helm charts under ./helm/ with shared values for environment: $(ENV)"
93137
@for dir in helm/*/; do \
94138
CHART=$$(basename $$dir); \
95-
echo "Upgrading chart: $$CHART"; \
96-
helm upgrade --install $$CHART helm/$$CHART \
97-
--namespace $(NAMESPACE) \
98-
--create-namespace \
99-
--values helm/$$CHART/values-$(ENV).yaml; \
139+
if [ "$$CHART" != "shared-values" ]; then \
140+
echo "Upgrading chart: $$CHART"; \
141+
CHART_VALUES="-f $(SHARED_BASE_VALUES)"; \
142+
if [ -f "$(SHARED_VALUES_DIR)/common-$(ENV).yaml" ]; then \
143+
CHART_VALUES="$$CHART_VALUES -f $(SHARED_VALUES_DIR)/common-$(ENV).yaml"; \
144+
fi; \
145+
if [ -f "helm/$$CHART/values-$(ENV).yaml" ]; then \
146+
CHART_VALUES="$$CHART_VALUES -f helm/$$CHART/values-$(ENV).yaml"; \
147+
fi; \
148+
CHART_VALUES="$$CHART_VALUES -f helm/$$CHART/values.yaml"; \
149+
helm upgrade --install $$CHART helm/$$CHART \
150+
--namespace $(NAMESPACE) \
151+
--create-namespace \
152+
$$CHART_VALUES; \
153+
fi; \
100154
done
101155

102156
## Uninstall all Helm charts in ./helm/

helm/chat-service/.helmignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

helm/chat-service/Chart.yaml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
apiVersion: v2
22
name: chat-service
3-
description: A Helm chart for Kubernetes
3+
description: OmniPDF Chat Service - RAG-based conversational interface with LLM integration
44

5-
# A chart can be either an 'application' or a 'library' chart.
6-
#
7-
# Application charts are a collection of templates that can be packaged into versioned archives
8-
# to be deployed.
9-
#
10-
# Library charts provide useful utilities or functions for the chart developer. They're included as
11-
# a dependency of application charts to inject those utilities and functions into the rendering
12-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
135
type: application
14-
15-
# This is the chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
186
version: 0.1.0
19-
20-
# This is the version number of the application being deployed. This version number should be
21-
# incremented each time you make changes to the application. Versions are not expected to
22-
# follow Semantic Versioning. They should reflect the version the application is using.
23-
# It is recommended to use it with quotes.
247
appVersion: "dev-v0.0.0-6653136"
258

26-
# Chart icon for Helm repositories and UIs - Local static logo
9+
# Chart icon for Helm repositories and UIs
2710
icon: file://assets/logo.svg
11+
12+
# Keywords for chart search
13+
keywords:
14+
- chat
15+
- llm
16+
- rag
17+
- conversational
18+
- omnipdf
19+

helm/chat-service/README.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

helm/chat-service/charts/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)