Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.db
*.bak
*.backup
mcpgateway.sbom.xml
gateway_service_leader.lock
docs/docs/test/
Expand Down
29 changes: 24 additions & 5 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ helm lint .

```bash
# Upgrade only the gateway image
ahelm upgrade mcp-stack . -n mcp \
ahelm upgrade mcp-stack . -n mcp-private\
--set mcpContextForge.image.tag=v1.2.3 \
--wait

# Preview changes (requires helm‑diff plugin)
helm plugin install https://github.com/databus23/helm-diff
helm diff upgrade mcp-stack . -n mcp -f my-values.yaml
helm diff upgrade mcp-stack . -n mcp-private-f my-values.yaml

# Roll back to revision 1
helm rollback mcp-stack 1 -n mcp
Expand Down Expand Up @@ -376,7 +376,7 @@ helm upgrade --install mcp-stack charts/mcp-stack \

# Later: raise the ceiling & make scaling more aggressive
helm upgrade mcp-stack charts/mcp-stack \
-n mcp \
-n mcp-private\
--reuse-values \
--set mcpContextForge.hpa.maxReplicas=20 \
--set mcpContextForge.hpa.targetCPUUtilizationPercentage=60 \
Expand All @@ -391,12 +391,12 @@ Useful in emergencies or during load tests.

```bash
# Bump minReplicas from 3 → 5
kubectl patch hpa mcp-stack-mcpgateway -n mcp \
kubectl patch hpa mcp-stack-mcpgateway -n mcp-private\
--type merge \
-p '{"spec":{"minReplicas":5}}'

# Drop the CPU target from 80 % → 65 % (scale up sooner)
kubectl patch hpa mcp-stack-mcpgateway -n mcp \
kubectl patch hpa mcp-stack-mcpgateway -n mcp-private\
--type json \
-p '[{"op":"replace","path":"/spec/metrics/0/resource/target/averageUtilization","value":65}]'
```
Expand All @@ -421,6 +421,25 @@ NAME TARGETS MINPODS MAXPODS REPLICAS
mcp-stack-mcpgateway 55%/70% 2 15 4
```

### Check scaling events

```bash
# 1. Show the last few scale-up / scale-down events
kubectl describe hpa mcp-stack-mcpgateway -n mcp-private | tail -n 20

# 2. Stream HPA events as they happen
kubectl get events -n mcp-private \
--field-selector involvedObject.kind=HorizontalPodAutoscaler,\
involvedObject.name=mcp-stack-mcpgateway \
--watch

# 3. Watch target utilisation & replica count refresh every 2 s
watch -n2 kubectl get hpa mcp-stack-mcpgateway -n mcp-private

# 4. Live pod-level CPU / memory (confirm the numbers the HPA sees)
kubectl top pods -l app=mcp-stack-mcpgateway -n mcp-private --sort-by=cpu
```

---

### Prerequisites & Gotchas
Expand Down
21 changes: 14 additions & 7 deletions charts/mcp-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ global:
########################################################################
mcpContextForge:
replicaCount: 2 # horizontal scaling for the gateway
hpa: # Horizontal pod autoscaler
enabled: true # default on; switch to false to disable HPA
minReplicas: 2 # must be >= 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80 # average CPU utilisation target
targetMemoryUtilizationPercentage: 80 # uncomment to add memory metric

# --- HORIZONTAL POD AUTOSCALER --------------------------------------
# * Percentages compare live usage with the container *request* values
# (limits are ignored by the HPA).
# * If both CPU and memory targets are set, crossing either threshold
# triggers a scale event.
# --------------------------------------------------------------------
hpa:
enabled: true # Set to false to keep a fixed replica count
minReplicas: 2 # Never scale below this
maxReplicas: 10 # Never scale above this
targetCPUUtilizationPercentage: 90 # Scale up when avg CPU > 90 % of *request*
targetMemoryUtilizationPercentage: 90 # Scale up when avg memory > 90 % of *request*

image:
repository: ghcr.io/ibm/mcp-context-forge
Expand Down Expand Up @@ -68,7 +75,7 @@ mcpContextForge:
memory: 1024Mi
requests:
cpu: 100m
memory: 256Mi
memory: 512Mi

# Optional ingress for HTTP traffic
ingress:
Expand Down
16 changes: 0 additions & 16 deletions charts/mcpgateway/Chart.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions charts/mcpgateway/templates/_helpers.tpl

This file was deleted.

14 changes: 0 additions & 14 deletions charts/mcpgateway/templates/configmap.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions charts/mcpgateway/templates/deployment.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions charts/mcpgateway/templates/ingress.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions charts/mcpgateway/templates/service.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions charts/mcpgateway/values.yaml

This file was deleted.

Loading