|
| 1 | +# Chat Service Helm Chart |
| 2 | + |
| 3 | +This Helm chart deploys the chat-service microservice with production-ready configurations. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Before installing this chart, you must create the required Kubernetes secret: |
| 8 | + |
| 9 | +```bash |
| 10 | +# Create the secret with your actual API key |
| 11 | +kubectl create secret generic chat-service-secrets \ |
| 12 | + --from-literal=OPENAI_API_KEY=your-actual-api-key-here \ |
| 13 | + --namespace omnipdf |
| 14 | + |
| 15 | +# Or create from a file (more secure) |
| 16 | +echo -n 'your-actual-api-key-here' > /tmp/api-key |
| 17 | +kubectl create secret generic chat-service-secrets \ |
| 18 | + --from-file=OPENAI_API_KEY=/tmp/api-key \ |
| 19 | + --namespace omnipdf |
| 20 | +rm /tmp/api-key |
| 21 | +``` |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +```bash |
| 26 | +# Install using Makefile |
| 27 | +make install CHART_NAME=chat-service |
| 28 | + |
| 29 | +# Or install directly with Helm |
| 30 | +helm upgrade --install chat-service . \ |
| 31 | + --namespace omnipdf \ |
| 32 | + --create-namespace |
| 33 | +``` |
| 34 | + |
| 35 | +## Security |
| 36 | + |
| 37 | +- **Secrets**: API keys are stored in Kubernetes Secrets, not in values.yaml |
| 38 | +- **Non-root**: Container runs as user 65534 (nobody) |
| 39 | +- **Read-only filesystem**: Container filesystem is read-only |
| 40 | +- **Dropped capabilities**: All Linux capabilities are dropped |
| 41 | +- **Resource limits**: CPU and memory limits are enforced |
| 42 | + |
| 43 | +## Configuration |
| 44 | + |
| 45 | +Key configuration options in `values.yaml`: |
| 46 | + |
| 47 | +```yaml |
| 48 | +# Scaling |
| 49 | +replicaCount: 2 |
| 50 | +autoscaling: |
| 51 | + enabled: true |
| 52 | + minReplicas: 2 |
| 53 | + maxReplicas: 10 |
| 54 | + |
| 55 | +# Resources |
| 56 | +resources: |
| 57 | + limits: |
| 58 | + cpu: 200m |
| 59 | + memory: 256Mi |
| 60 | + requests: |
| 61 | + cpu: 50m |
| 62 | + memory: 64Mi |
| 63 | + |
| 64 | +# Image |
| 65 | +image: |
| 66 | + repository: ghcr.io/notyusheng/chat-service |
| 67 | + pullPolicy: Never # For offline environments |
| 68 | +``` |
| 69 | +
|
| 70 | +## Monitoring |
| 71 | +
|
| 72 | +The service exposes a `/health` endpoint on port 8000 for health checks. |
| 73 | + |
| 74 | +## Troubleshooting |
| 75 | + |
| 76 | +**Secret not found error:** |
| 77 | +```bash |
| 78 | +# Check if secret exists |
| 79 | +kubectl get secret chat-service-secrets -n omnipdf |
| 80 | +
|
| 81 | +# Create the secret if missing (see Prerequisites above) |
| 82 | +``` |
| 83 | + |
| 84 | +**Image pull errors with pullPolicy: Never:** |
| 85 | +```bash |
| 86 | +# Ensure image exists locally |
| 87 | +docker images | grep chat-service |
| 88 | +
|
| 89 | +# Pull and tag image if needed |
| 90 | +docker pull ghcr.io/notyusheng/chat-service:dev-v0.0.0-6653136 |
| 91 | +``` |
0 commit comments