Skip to content

Commit beb7aee

Browse files
authored
Merge pull request #188 from IBM/helm-limits-check
Cleanup autoscaler rules and remove old unused chart
2 parents f3b3d20 + b776199 commit beb7aee

File tree

10 files changed

+41
-213
lines changed

10 files changed

+41
-213
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
*.db
2+
*.bak
3+
*.backup
14
mcpgateway.sbom.xml
25
gateway_service_leader.lock
36
docs/docs/test/

charts/README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ helm lint .
168168

169169
```bash
170170
# Upgrade only the gateway image
171-
ahelm upgrade mcp-stack . -n mcp \
171+
ahelm upgrade mcp-stack . -n mcp-private\
172172
--set mcpContextForge.image.tag=v1.2.3 \
173173
--wait
174174

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

179179
# Roll back to revision 1
180180
helm rollback mcp-stack 1 -n mcp
@@ -376,7 +376,7 @@ helm upgrade --install mcp-stack charts/mcp-stack \
376376

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

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

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

424+
### Check scaling events
425+
426+
```bash
427+
# 1. Show the last few scale-up / scale-down events
428+
kubectl describe hpa mcp-stack-mcpgateway -n mcp-private | tail -n 20
429+
430+
# 2. Stream HPA events as they happen
431+
kubectl get events -n mcp-private \
432+
--field-selector involvedObject.kind=HorizontalPodAutoscaler,\
433+
involvedObject.name=mcp-stack-mcpgateway \
434+
--watch
435+
436+
# 3. Watch target utilisation & replica count refresh every 2 s
437+
watch -n2 kubectl get hpa mcp-stack-mcpgateway -n mcp-private
438+
439+
# 4. Live pod-level CPU / memory (confirm the numbers the HPA sees)
440+
kubectl top pods -l app=mcp-stack-mcpgateway -n mcp-private --sort-by=cpu
441+
```
442+
424443
---
425444

426445
### Prerequisites & Gotchas

charts/mcp-stack/values.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ global:
1212
########################################################################
1313
mcpContextForge:
1414
replicaCount: 2 # horizontal scaling for the gateway
15-
hpa: # Horizontal pod autoscaler
16-
enabled: true # default on; switch to false to disable HPA
17-
minReplicas: 2 # must be >= 1
18-
maxReplicas: 10
19-
targetCPUUtilizationPercentage: 80 # average CPU utilisation target
20-
targetMemoryUtilizationPercentage: 80 # uncomment to add memory metric
15+
16+
# --- HORIZONTAL POD AUTOSCALER --------------------------------------
17+
# * Percentages compare live usage with the container *request* values
18+
# (limits are ignored by the HPA).
19+
# * If both CPU and memory targets are set, crossing either threshold
20+
# triggers a scale event.
21+
# --------------------------------------------------------------------
22+
hpa:
23+
enabled: true # Set to false to keep a fixed replica count
24+
minReplicas: 2 # Never scale below this
25+
maxReplicas: 10 # Never scale above this
26+
targetCPUUtilizationPercentage: 90 # Scale up when avg CPU > 90 % of *request*
27+
targetMemoryUtilizationPercentage: 90 # Scale up when avg memory > 90 % of *request*
2128

2229
image:
2330
repository: ghcr.io/ibm/mcp-context-forge
@@ -68,7 +75,7 @@ mcpContextForge:
6875
memory: 1024Mi
6976
requests:
7077
cpu: 100m
71-
memory: 256Mi
78+
memory: 512Mi
7279

7380
# Optional ingress for HTTP traffic
7481
ingress:

charts/mcpgateway/Chart.yaml

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

charts/mcpgateway/templates/_helpers.tpl

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

charts/mcpgateway/templates/configmap.yaml

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

charts/mcpgateway/templates/deployment.yaml

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

charts/mcpgateway/templates/ingress.yaml

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

charts/mcpgateway/templates/service.yaml

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

charts/mcpgateway/values.yaml

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

0 commit comments

Comments
 (0)