This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.11.3. Troubleshooting node network configuration
If the node network configuration encounters an issue, the Policy is automatically rolled back and the Enactments report failure. This includes issues such as:
- The configuration fails to be applied on the host.
- The host loses connection to the default gateway.
- The host loses connection to the API server.
You can apply changes to the node network configuration across your entire cluster by applying a NodeNetworkConfigurationPolicy. If you apply an incorrect configuration, you can use the following example to troubleshoot and correct the failed network Policy.
In this example, a Linux bridge Policy is applied to an example cluster that has 3 master nodes and 3 worker nodes. The Policy fails to be applied because it references an incorrect interface. To find the error, investigate the available nmstate resources. You can then update the Policy with the correct configuration.
Procedure
Create a Policy and apply it to your cluster. The following example creates a simple bridge on the
ens01
interface:Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f ens01-bridge-testfail.yaml
$ oc apply -f ens01-bridge-testfail.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
nodenetworkconfigurationpolicy.nmstate.io/ens01-bridge-testfail created
nodenetworkconfigurationpolicy.nmstate.io/ens01-bridge-testfail created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the status of the Policy by running the following command:
oc get nncp
$ oc get nncp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output shows that the Policy failed:
Example output
NAME STATUS ens01-bridge-testfail FailedToConfigure
NAME STATUS ens01-bridge-testfail FailedToConfigure
Copy to Clipboard Copied! Toggle word wrap Toggle overflow However the Policy status alone does not indicate if it failed on all nodes or a subset of nodes.
List the Enactments to see if the Policy was successful on any of the nodes. If the Policy failed for only a subset it suggests the problem is with specific node configuration; if the Policy failed on all nodes it suggest the problem is with the Policy.
oc get nnce
$ oc get nnce
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output shows that the Policy failed on all nodes:
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow View one of the failed Enactments and look at the traceback. The following command uses the output tool
jsonpath
to filter the output:oc get nnce worker-1.ens01-bridge-testfail -o jsonpath='{.status.conditions[?(@.type=="Failing")].message}'
$ oc get nnce worker-1.ens01-bridge-testfail -o jsonpath='{.status.conditions[?(@.type=="Failing")].message}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command returns a large traceback that has been edited for brevity:
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
NmstateVerificationError
lists thedesired
Policy configuration, thecurrent
configuration of the Policy on the node, and thedifference
highlighting the parameters that do not match. In this example, theport
is included in thedifference
, which suggests that the problem is the port configuration in the Policy.To ensure that the Policy is configured properly, view the network configuration for one or all of the nodes by requesting the
NodeNetworkState
. The following command returns the network configuration for themaster-1
node:oc get nns master-1 -o yaml
$ oc get nns master-1 -o yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output shows that the interface name on the nodes is
ens1
but the failed Policy incorrectly usesens01
:Example output
- ipv4: ... name: ens1 state: up type: ethernet
- ipv4: ... name: ens1 state: up type: ethernet
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Correct the error by editing the existing Policy:
oc edit nncp ens01-bridge-testfail
$ oc edit nncp ens01-bridge-testfail
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ... port: - name: ens1
... port: - name: ens1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Save the Policy to apply the correction.
Check the status of the Policy to ensure it updated successfully:
oc get nncp
$ oc get nncp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME STATUS ens01-bridge-testfail SuccessfullyConfigured
NAME STATUS ens01-bridge-testfail SuccessfullyConfigured
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The updated Policy is successfully configured on all nodes in the cluster.