Skip to content

chore: trim CPU limits on vmagent, backstage, mctl-api, admintools - #146

Merged
mashkovd merged 2 commits into
mainfrom
chore/cpu-limits-trim-2
May 6, 2026
Merged

mashkovd merged 2 commits into
mainfrom
chore/cpu-limits-trim-2

Conversation

@mashkovd

@mashkovd mashkovd commented May 6, 2026

Copy link
Copy Markdown
Member

Summary

Second-pass trim after #145. With #145 merged, cluster now at sum(limits.cpu) = 25.50c (91% of 28). These four containers all have 11-22× limit/actual ratios and contribute ~0.85c of dead headroom.

component path from to observed
vmagent bootstrap/templates/observability/monitoring.yaml 500m 250m 123m
backstage bootstrap/templates/mctl-platform/mctl-portal.yaml 500m 300m 26m
mctl-api bootstrap/templates/mctl-platform/mctl-api.yaml 500m 250m 11m
temporal admintools bootstrap/templates/data/temporal.yaml 200m 100m 2m

Expected new total: ~24.65c (88%).

Skipped

  • shared-pg postgres (1c, actual 48m): the shared-pg Application sets ignoreDifferences: .spec.resources on the CNPG Cluster to accommodate operator-side normalization. Trims via gitops won't propagate here — would require either removing the ignore (risky — operator drift will surface as OutOfSync), or a direct kubectl patch cluster (out-of-band). Both deferred.

Test plan

  • ArgoCD reconciles monitoring, mctl-portal, mctl-api, temporal Applications green.
  • vmagent stays Healthy through next scrape interval (no 5xx in remoteWrite).
  • backstage /api/health continues to respond.
  • mctl-api /healthz continues to respond.
  • Grafana → Kubernetes / Views / Global → CPU Limits drops to ~88%.
  • No new CPUThrottlingHigh alerts over the next 24h.

mctl-deploy added 2 commits May 7, 2026 01:45
…ntools

Second pass after PR #145. After bucket A landed, sum(limits.cpu) sat at
25.50c (91% of 28-core cluster). These four containers all have 11-22x
limit/actual ratios and contribute another ~0.85c of dead headroom:

- vmagent: 500m -> 250m (steady-state 123m, 2x cushion)
- backstage: 500m -> 300m (steady-state 26m, 11x cushion)
- mctl-api: 500m -> 250m (steady-state 11m, 22x cushion)
- temporal admintools: 200m -> 100m (idle CLI sidecar, ~2m)

Expected new total: ~24.65c (88% of 28).

Postgres skip: shared-pg Application sets ignoreDifferences on
.spec.resources to accommodate CNPG operator normalization, so resource
trims via gitops won't propagate here.
Phase 4 of the incident auto-cleanup track. Adds Prometheus metrics
wiring so the cleanup activity from Phases 1/2/3 (stale TTL GC,
orphan pruning, AM fingerprint reconciliation) becomes visible in
Grafana and alertable, instead of slog-only.

Six metrics, low cardinality (status / source / reason / outcome —
no tenant or service labels):

- mctl_agent_stale_ttl_resolved_total{status} — Phase 1
- mctl_agent_orphan_pruned_total — Phase 3
- mctl_agent_am_reconcile_resolved_total — Phase 2
- mctl_agent_cleanup_skipped_total{reason} — guards across all phases
- mctl_agent_am_request_duration_seconds{outcome} — Phase 2 latency
- mctl_agent_open_tickets{status, source} — gauge updated each cycle

Adds a sibling ServiceMonitor in
bootstrap/templates/mctl-platform/mctl-agent-monitor.yaml mirroring
mctl-api-monitor.yaml (port http, path /metrics, 30s interval) — no
base-service chart changes required.

Status: accepted (operator-seeded, skipping mentor digest).
@mashkovd

mashkovd commented May 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant