1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/microshift-cni-multus-troubleshoot.adoc
2024-05-10 20:08:00 +00:00

52 lines
3.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * microshift_networking/microshift_multiple_networks/microshift-cni-multus-using.adoc
:_mod-docs-content-type: REFERENCE
[id="microshift-cni-multus-troubleshoot_{context}"]
= Troubleshooting Multus networking
If the settings for multiple networks are not configured properly, pods can fail to start. The following steps can help you solve for a couple common scenarios.
[id="Pod-networking-cannot-be-configured_{context}"]
== Pod networking cannot be configured
If the Multus CNI plugin cannot apply networking annotations to a pod, the pod does not start. Pods can also fail to start if any of the additional network CNIs fail.
.Example error
[source,terminal]
----
Warning NoNetworkFound 0s multus cannot find a network-attachment-definitio (asdasd) in namespace (default): network-attachment-definitions.k8s.cni.cncf.io "bad-ref-doesnt-exist" not found
----
In this case, you can take the following steps to trouble CNI failures:
* Verify the values in both the `NetworkAttachmentDefinitions` and the annotations.
* Remove the annotation to verify whether the pod is created successfully with just the default network. If not, this might indicate a networking problem other than the Multus configuration.
* If you are a device administrator, you can inspect the `crio.service` or `microshift.service` logs, paying special attention to those that are generated by the `kubelet`.
+
For example, the following error from the `kubelet` shows that the primary CNI is not running. This situation can be caused by pods not starting or because of a CRI-O misconfiguration such as an incorrect `cni_default_network` setting.
+
.Example kubelet-generated error
[source,terminal]
----
Feb 06 13:47:31 dev microshift[1494]: kubelet E0206 13:47:31.163290 1494 pod_workers.go:1298] "Error syncing pod, skipping" err="network is not ready: container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: No CNI configuration file in /etc/cni/net.d/. Has your network provider started?" pod="default/samplepod" podUID="fe0f7f7a-8c47-4488-952b-8abc0d8e2602"
----
[id="missing-nad_{context}"]
== Missing configuration file
Sometimes a pod cannot be created because the annotations reference a `NetworkAttachmentDefinition` configuration YAML that does not exist. In this case an error such as the following is usually produced:
.Example log
[source,terminal]
----
cannot find a network-attachment-definition (bad-conf) in namespace (default): network-attachment-definitions.k8s.cni.cncf.io "bad-conf" not found" pod="default/samplepod"`
----
.Example error output
[source,terminal]
----
"CreatePodSandbox for pod failed" err="rpc error: code = Unknown desc = failed to create pod network sandbox k8s_samplepod_default_5fa13105-1bfb-4c6b-aee7-3437cfb50e25_0(7517818bd8e85f07b551f749c7529be88b4e7daef0dd572d049aa636950c76c6): error adding pod default_samplepod to CNI network \"multus-cni-network\": plugin type=\"multus\" name=\"multus-cni-network\" failed (add): Multus: [default/samplepod/5fa13105-1bfb-4c6b-aee7-3437cfb50e25]: error loading k8s delegates k8s args: TryLoadPodDelegates: error in getting k8s network for pod: GetNetworkDelegates: failed getting the delegate: getKubernetesDelegate: cannot find a network-attachment-definition (bad-conf) in namespace (default): network-attachment-definitions.k8s.cni.cncf.io \"bad-conf\" not found" pod="default/samplepod"
----
To fix this error, create and apply the `NetworkAttachmentDefinitions` YAML.