CRC NMState Operator Configuration
Install the NMState Operator on OpenShift Local (CRC) and verify that the console plugin and networking menu items are working correctly.
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.
This skill requires no semantic judgment — all steps are mechanical script execution with deterministic outcomes.
Workflow
Step 1 — Run the setup script
The agent MUST run:
bash ~/.agents/skills/crc-nmstate-config/scripts/setup.sh
Use --check to verify without making changes.
Output Contract
- Exit 0 → NMState operator installed and verified
- Exit 1 → installation failed, review output
Prerequisites
- CRC cluster is running (
crc statusshows Running) ocis logged in askubeadmin(oc whoamireturnskubeadmin)- OpenShift Console is accessible
Step 1: Create Namespace, OperatorGroup, and Subscription
Apply all three resources in one pass:
oc apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: openshift-nmstate
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-nmstate
namespace: openshift-nmstate
spec:
targetNamespaces:
- openshift-nmstate
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: kubernetes-nmstate-operator
namespace: openshift-nmstate
spec:
channel: stable
name: kubernetes-nmstate-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
EOF
Step 2: Wait for the Operator to Be Ready
Wait for the CSV to reach Succeeded phase:
oc get csv -n openshift-nmstate --watch
Expected output eventually shows:
kubernetes-nmstate-operator.v... kubernetes-nmstate-operator ... Succeeded
Step 3: Create the NMState Instance
oc apply -f - <<EOF
apiVersion: nmstate.io/v1
kind: NMState
metadata:
name: nmstate
EOF
Step 4: Wait for All NMState Pods to Be Running
oc get pods -n openshift-nmstate --watch
Expected running pods:
nmstate-console-plugin-*nmstate-handler-*(DaemonSet, one per node)nmstate-metrics-*nmstate-operator-*nmstate-webhook-*
Step 5: Verify CRDs Are Present
oc get crd | grep nmstate
Expected output includes:
nodenetworkconfigurationenactments.nmstate.io
nodenetworkconfigurationpolicies.nmstate.io
nodenetworkstates.nmstate.io
Step 6: Verify Console Plugin Is Registered
The NMState operator automatically registers nmstate-console-plugin and adds it to the console. Verify:
# Check ConsolePlugin resource exists
oc get consoleplugin nmstate-console-plugin
# Verify it is listed in the console operator plugins
oc get consoles.operator.openshift.io cluster -o jsonpath='{.spec.plugins}' | tr ',' '\n'
Expected: nmstate-console-plugin appears in the plugins list.
Step 7: Verify Console Menu Items
- Open the OpenShift Console in a browser (get URL with
crc console --url) - Log in as
kubeadmin - Navigate to Networking in the left sidebar
- Confirm the following items are present:
- NodeNetworkConfigurationPolicy — under Networking
- NodeNetworkState — under Networking
How it works: The NMState operator’s
nmstate-console-pluginuses aconsole.flag/modelextension that setsNMSTATE_PLUGIN_ENABLED=truewhen theNodeNetworkStateCRD exists. This flag gates the NNCP and NNS nav items in the console.
Verification Checklist
oc get csv -n openshift-nmstateshowsSucceededoc get pods -n openshift-nmstateshows all pods Runningoc get crd | grep nmstateshowsnodenetworkconfigurationpoliciesandnodenetworkstatesoc get consoleplugin nmstate-console-pluginreturns the resourcenmstate-console-pluginappears inconsoles.operator.openshift.io/clusterspec.plugins- NodeNetworkConfigurationPolicy menu item visible in Console → Networking
- NodeNetworkState menu item visible in Console → Networking
Persistence After CRC Restart
The NMState operator and its console plugin persist across CRC restarts. After a crc stop / crc start cycle, allow a few minutes for all pods to reach Running state, then verify the menu items are still present.
Troubleshooting
CatalogSource not available:
oc get catalogsource -n openshift-marketplace
# Ensure redhat-operators is present and READY
Console plugin not showing menu items after install:
- Hard refresh the browser (Ctrl+Shift+R)
- Check that
nmstate-console-pluginis inspec.plugins:oc get consoles.operator.openshift.io cluster -o jsonpath='{.spec.plugins}' - If missing, add it manually:
oc patch consoles.operator.openshift.io cluster --type=json \ -p='[{"op":"add","path":"/spec/plugins/-","value":"nmstate-console-plugin"}]'
Pods stuck Pending:
oc describe pod -n openshift-nmstate <pod-name>
# Check for resource constraints or image pull errors
Changelog
See CHANGELOG.md for version history.