fix(neuron-mcp): blue/green deployment, memory limits, preStop drain hook

- Rename Deployment to neuron-mcp-blue with slot=blue label
- Add neuron-mcp-green Deployment scaffold (replicas=0, ready to receive new image)
- Service selector now routes by slot label; annotation tracks active slot
- Memory: 768Mi → 1536Mi limit, 256Mi → 512Mi request (fixes OOM pod restarts / 502s)
- Add JAVA_TOOL_OPTIONS: container-aware GC + ExitOnOutOfMemoryError
- Add preStop sleep 8s so Traefik drains in-flight connections before pod terminates
- terminationGracePeriodSeconds: 30
- Add scripts/blue-green-deploy.sh: automated slot-swap with health check and rollback
This commit is contained in:
Will Anderson
2026-04-24 22:08:12 -05:00
parent 5d4cc17829
commit f86ee04467
4 changed files with 173 additions and 7 deletions
@@ -21,9 +21,14 @@ metadata:
namespace: neuron-prod
labels:
app: neuron-mcp
annotations:
# Blue/green: change slot to "green" then back to "blue" to switch traffic.
# Process: deploy green → verify health → patch this selector → scale blue to 0.
neuron.ai/active-slot: "blue"
spec:
selector:
app: neuron-mcp
slot: blue
ports:
- name: http
port: 8080