Skip to the content.

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

  1. Verify the cluster is reachable
    oc whoami
    oc cluster-info
    
  2. 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
    
  3. Remove the monitoring overrides from ClusterVersion CRC disables monitoring by adding unmanaged: true overrides to the ClusterVersion resource for the cluster-monitoring-operator Deployment and the monitoring ClusterOperator. 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.
  4. Wait for the openshift-monitoring namespace to become active
    oc wait --for=jsonpath='{.status.phase}'=Active namespace/openshift-monitoring --timeout=300s
    
  5. Apply the cluster-monitoring-config ConfigMap with retention tuning
    bash <skill-dir>/apply-monitoring-config.sh
    

    This 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
  6. 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

  1. Apply the system-reserved override MachineConfig
    bash <skill-dir>/apply-system-reserved.sh
    

    The script creates a MachineConfig (99-z-crc-system-reserved-override) that overrides /etc/node-sizing-enabled.env with higher values. It sorts after CRC’s built-in 99-node-sizing-for-crc MC 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 until oc get mcp master shows UPDATED=True on the new rendered config (setup.sh waits). Do NOT run crcstop during that reboot: the guest ignores ACPI while rebooting, crcstop force-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 the SystemMemoryExceedsReservation alert will not fire.

Part 3 — Silence Dev-Irrelevant Alerts

  1. Silence noisy alerts that are expected on a CRC dev cluster
    bash <skill-dir>/silence-alerts.sh
    

    The script:

    • Silences AlertmanagerReceiversNotConfigured for 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 SILENCES array in the script

Part 4 — Remove the Console Banner

  1. Delete the CRC security-notice banner
    oc delete consolenotification security-notice   # or: setup.sh --part 4
    

    CRC creates it in every new cluster. Re-run after crc delete + start.

Verification

Supporting Files

Skill directory: ~/.agents/skills/crc-post-setup-config

Changelog

See CHANGELOG.md for version history.