CRC Post-Setup Configuration
Apply post-setup configuration to an OpenShift Local (CRC) cluster. This skill combines all one-time tuning that must be re-applied after every crc delete && crc start cycle.
What It Configures
| Area | What | Why |
|---|---|---|
| Cluster Monitoring | Enables the monitoring stack with aggressive Prometheus retention (24h / 4GB) |
CRC disables monitoring by default; without retention limits Prometheus fills the VM disk |
| System Reserved Resources | Overrides kubelet --system-reserved to memory=1Gi, cpu=500m, ephemeral-storage=1Gi via a MachineConfig |
CRC’s default reservation (350Mi memory) is too low and triggers the SystemMemoryExceedsReservation alert |
| Alert Silences | Silences AlertmanagerReceiversNotConfigured for 1 year |
Expected on a dev cluster with no external notification receivers configured |
| Console Banner | Deletes the security-notice ConsoleNotification (“OpenShift Local cluster is for development and testing purposes…”) |
Every new CRC cluster ships it as a BannerTop; noise on a known dev cluster |
Quick Run
scripts/setup.sh runs Parts 1–4 in order through the helper scripts below.
Dry-run gate first:
bash ~/.agents/skills/crc-post-setup-config/scripts/setup.sh --check # per-part state + DRY_RUN_RESULT=CONVERGED|PENDING
bash ~/.agents/skills/crc-post-setup-config/scripts/setup.sh # apply all parts (or --part N)
Exit 0 = all parts OK, 1 = cluster unreachable or a part failed (re-run is safe), 2 = usage.
Rules
Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.
Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.
Steps
Part 1 — Enable Cluster Monitoring
- Verify the cluster is reachable
oc whoami oc cluster-info - Set the CRC config flag
This persists across
crc delete+crc start, so a fresh cluster will also enable monitoring:crc config set enable-cluster-monitoring true -
Remove the monitoring overrides from ClusterVersion CRC disables monitoring by adding
unmanaged: trueoverrides to the ClusterVersion resource for thecluster-monitoring-operatorDeployment and themonitoringClusterOperator. Remove only these two entries while keeping all other overrides intact.- Fetch the current overrides:
oc get clusterversion version -o jsonpath='{.spec.overrides}' | python3 -m json.tool - Build a new overrides list that excludes the two monitoring entries:
{"kind":"Deployment","name":"cluster-monitoring-operator","namespace":"openshift-monitoring"}{"kind":"ClusterOperator","name":"monitoring"}
- Patch the ClusterVersion with the filtered list:
oc patch clusterversion version --type=json \ -p '[{"op":"replace","path":"/spec/overrides","value": <filtered list> }]' - If the overrides array is already free of monitoring entries, skip this step.
- Fetch the current overrides:
- Wait for the openshift-monitoring namespace to become active
oc wait --for=jsonpath='{.status.phase}'=Active namespace/openshift-monitoring --timeout=300s - Apply the cluster-monitoring-config ConfigMap with retention tuning
bash <skill-dir>/apply-monitoring-config.shThis applies:
retention: 24h— keep only 24 hours of metrics (default is 15 days)retentionSize: "4GB"— hard cap on TSDB disk usage- Reduced CPU/memory requests for Prometheus and Alertmanager to fit CRC
- Wait for the monitoring stack to roll out
oc rollout status deployment/cluster-monitoring-operator -n openshift-monitoring --timeout=300s oc wait --for=condition=Ready pod -l app.kubernetes.io/name=prometheus -n openshift-monitoring --timeout=600s
Part 2 — Tune Kubelet System-Reserved Resources
- Apply the system-reserved override MachineConfig
bash <skill-dir>/apply-system-reserved.shThe script creates a MachineConfig (
99-z-crc-system-reserved-override) that overrides/etc/node-sizing-enabled.envwith higher values. It sorts after CRC’s built-in99-node-sizing-for-crcMC so the override wins during rendering.SYSTEM_RESERVED_MEMORY=1Gi(default: 350Mi — too low, triggers alert)SYSTEM_RESERVED_CPU=500m(default: 200m)SYSTEM_RESERVED_ES=1Gi(default: 350Mi)
The machine-config-daemon applies it by rebooting the node by itself about a minute later (verified on OCP 5.0:
Performing post config change action: Reboot). No manual restart. Wait untiloc get mcp mastershowsUPDATED=Trueon the new rendered config (setup.shwaits). Do NOT runcrcstopduring that reboot: the guest ignores ACPI while rebooting,crcstopforce-kills it after 420 s, and the next start fails on a stale~/.crc/machines/crc/docker.sock. Afterwards the kubelet runs with the new values (node allocatable = capacity − 1Gi memory, − 500m CPU) and theSystemMemoryExceedsReservationalert will not fire.
Part 3 — Silence Dev-Irrelevant Alerts
- Silence noisy alerts that are expected on a CRC dev cluster
bash <skill-dir>/silence-alerts.shThe script:
- Silences
AlertmanagerReceiversNotConfiguredfor 1 year (no receivers needed on a dev cluster) - Skips alerts that are already silenced (safe to re-run)
- To add more alerts to silence, edit the
SILENCESarray in the script
- Silences
Part 4 — Remove the Console Banner
- Delete the CRC security-notice banner
oc delete consolenotification security-notice # or: setup.sh --part 4CRC creates it in every new cluster. Re-run after
crc delete+ start.
Verification
crc config view | grep enable-cluster-monitoringshowstrueoc get co monitoringshowsAvailable=TrueandDegraded=Falseoc get pods -n openshift-monitoringshows all pods Running/Readyoc get prometheus k8s -n openshift-monitoring -o jsonpath='{.spec.retention}'returns24hoc get prometheus k8s -n openshift-monitoring -o jsonpath='{.spec.retentionSize}'returns4GBoc get mcp mastershowsUPDATED=True; node allocatable memory/CPU is capacity − 1Gi / − 500mSystemMemoryExceedsReservationalert isinactiveoc get consolenotification security-noticereturns NotFound (no console banner)AlertmanagerReceiversNotConfiguredalert is silenced: Active silence visible viaoc exec -n openshift-monitoring alertmanager-main-0 -c alertmanager -- curl -s 'http://localhost:9093/api/v2/silences'
Supporting Files
Skill directory: ~/.agents/skills/crc-post-setup-config
- apply-monitoring-config.sh → load_skill(name: “crc-post-setup-config/apply-monitoring-config.sh”)
- apply-system-reserved.sh → load_skill(name: “crc-post-setup-config/apply-system-reserved.sh”)
- silence-alerts.sh → load_skill(name: “crc-post-setup-config/silence-alerts.sh”)
Changelog
See CHANGELOG.md for version history.