How To Resolve A CreateContainerConfigError

Prev Next

Background

The CreateContainerConfigError typically occurs when a container specification references secrets or configmaps that are missing or unavailable at container start-up.

Solution

The following should help to identify the most common causes of the CreateContainerConfigError:

  1. Run the kubectl describe command.

  2. In the Events section, locate an Event with the following:

    • Type: Warning
    • Reason: Failed
  3. Check the Message associated with the event; the most common messages associated with the CreateContainerConfigError are as follows:

    • Error: secret "<secret_name>" not found - the named secret object is not present in your cluster
    • Error: configmap "<configmap_name>" not found - the named configmap object is not present in your cluster
  4. Take the appropriate action:

    Missing Object Action
    Secret Identify the missing Secret and create it in the namespace, or mount another Secret that already exists
    ConfigMap Identify the missing ConfigMap and create it in the namespace, or mount another ConfigMap that already exists
  5. Delete and recreate the pod.

  6. View the newly created pod and verify that the status is no longer CreateContainerConfigError, but is Running.