Use this file to discover all available pages before exploring further.
This guide explains how to install the WeaveNet pod networking solution on your Kubernetes cluster and troubleshoot why an application pod might be stuck in the “ContainerCreating” state. We discuss inspecting pod status, deploying the network solution, customizing configuration settings, and verifying that everything is operating correctly.
An application named “app” has been deployed in the default namespace. Begin by checking the pod status:
kubectl get pods
If you see that the pod is stuck in the “ContainerCreating” state, it indicates that the pod is not running. To diagnose further, describe the pod to review its events:
kubectl describe pod app
Focus on the events section at the bottom of the output. You may encounter an error message like:
Warning FailedCreatePodSandbox 35s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "d25e340bdc7fb268f261540c1bcd937e356ccae1fa9f2ef621e3f7e89": plugin type="weave-net" name="weave" failed (add): unable to allocate IP address: Post "http://127.0.0.1:6784/ip/add?…": dial tcp 127.0.0.1:6784: connect: connection refused
This error typically means that the network is not configured properly because the container runtime was unable to allocate an IP address.
To fix the network configuration issue, deploy the WeaveNet networking plugin to your cluster. For more background on installing add-ons, see the Kubernetes documentation on installing add-ons.Follow these steps:
Open the Kubernetes add-ons documentation, which covers various networking add-ons like ACI, Antrea, and Calico.
Install WeaveNet by applying the manifest file with this command:
Review your cluster’s CIDR settings. If you have set a specific cluster CIDR in your kube-proxy (for example, clusterCIDR: 10.244.0.0/16), ensure that WeaveNet is configured to use a compatible IP allocation range. List the WeaveNet pods and check their logs to verify:
kubectl get pod -n kube-system | grep weavekubectl logs <weave-net-pod> -n kube-system
If the default manifest does not fit your cluster settings, adjust the configuration. For instance, to set the IP allocation range to “10.0.0.0/24”, update the environment variables in the manifest’s container configuration:
Once WeaveNet is deployed and confirmed to be running, recheck the status of the “app” pod:
kubectl get pods
If the network configuration is correct, the pod should transition from the “ContainerCreating” state to Running. This completes the exercise on deploying the WeaveNet networking solution and troubleshooting pod creation issues.