Welcome to the Linux Foundation Forum!

Issue with any deployments on my new minikube cluster

Hello,
I'm following the content provided by the course, created a minikube cluster using the docker driver (it was easier than the virtualbox method for my environment). All good

  1. $ minikube status
  2. minikube
  3. type: Control Plane
  4. host: Running
  5. kubelet: Running
  6. apiserver: Running
  7. kubeconfig: Configured
  8.  
  9. minikube-m02
  10. type: Worker
  11. host: Running
  12. kubelet: Running

Great! Then I tried my first deployment using this yaml file:

  1. cat def-deploy.yaml
  2.  
  3. apiVersion: apps/v1
  4. kind: Deployment
  5. metadata:
  6. name: nginx-deployment
  7. labels:
  8. app: nginx-deployment
  9. spec:
  10. replicas: 3
  11. selector:
  12. matchLabels:
  13. app: nginx-deployment
  14. template:
  15. metadata:
  16. labels:
  17. app: nginx-deployment
  18. spec:
  19. containers:
  20. - name: nginx
  21. image: nginx:1.20.2
  22. ports:
  23. - containerPort: 80

Applied this configuration : kubectl create -f def-deploy.yaml

all good... until I tried to check the pods:

  1. kubectl get pods
  2. NAME READY STATUS RESTARTS AGE
  3. nginx-deployment-594d7b4ff5-8gjf9 0/1 ImageInspectError 0 4s
  4. nginx-deployment-594d7b4ff5-clbp2 0/1 ImageInspectError 0 4s
  5. nginx-deployment-594d7b4ff5-tv4sm 0/1 ImageInspectError 0 4s

Then:

  1. kubectl describe pod nginx-deployment-594d7b4ff5-8gjf9
  2. Name: nginx-deployment-594d7b4ff5-8gjf9
  3. Namespace: default
  4. Priority: 0
  5. Service Account: default
  6. Node: minikube-m02/192.168.58.3
  7. Start Time: Wed, 19 Feb 2025 22:04:05 +0000
  8. Labels: app=nginx-deployment
  9. pod-template-hash=594d7b4ff5
  10. Annotations: <none>
  11. Status: Pending
  12. IP: 10.244.1.4
  13. IPs:
  14. IP: 10.244.1.4
  15. Controlled By: ReplicaSet/nginx-deployment-594d7b4ff5
  16. Containers:
  17. nginx:
  18. Container ID:
  19. Image: nginx:1.20.2
  20. Image ID:
  21. Port: 80/TCP
  22. Host Port: 0/TCP
  23. State: Waiting
  24. Reason: ImageInspectError
  25. Ready: False
  26. Restart Count: 0
  27. Environment: <none>
  28. Mounts:
  29. /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-6hdk8 (ro)
  30. Conditions:
  31. Type Status
  32. PodReadyToStartContainers True
  33. Initialized True
  34. Ready False
  35. ContainersReady False
  36. PodScheduled True
  37. Volumes:
  38. kube-api-access-6hdk8:
  39. Type: Projected (a volume that contains injected data from multiple sources)
  40. TokenExpirationSeconds: 3607
  41. ConfigMapName: kube-root-ca.crt
  42. ConfigMapOptional: <nil>
  43. DownwardAPI: true
  44. QoS Class: BestEffort
  45. Node-Selectors: <none>
  46. Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
  47. node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
  48. Events:
  49. Type Reason Age From Message
  50. ---- ------ ---- ---- -------
  51. Normal Scheduled 32s default-scheduler Successfully assigned default/nginx-deployment-594d7b4ff5-8gjf9 to minikube-m02
  52. Warning InspectFailed 5s (x4 over 31s) kubelet Failed to inspect image "": rpc error: code = Unknown desc = short-name "nginx:1.20.2" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"
  53. Warning Failed 5s (x4 over 31s) kubelet Error: ImageInspectError

Why this vanilla install of minikube does not allow me to deploy anything successfully ?

Thank you,

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 2,434

    Hi @fmiranda,

    Does your Minikube cluster deployed with the Docker driver have access to the internet? It is possible that it causes resolve issues and the image name alone cannot be resolved, therefore it was never pulled from the public Docker Hub registry.
    You may try to update the image name to docker.io/library/nginx:1.20.2. If the deployment is still unsuccessful, then your Docker nodes need to be inspected for connectivity.

    Regards,
    -Chris

  • Thank you @chrispokorni

    This is how my deployment yaml file looks like with your suggestions:

    1. apiVersion: apps/v1
    2. kind: Deployment
    3. metadata:
    4. name: nginx-deployment
    5. labels:
    6. app: nginx-deployment
    7. spec:
    8. replicas: 3
    9. selector:
    10. matchLabels:
    11. app: nginx-deployment
    12. template:
    13. metadata:
    14. labels:
    15. app: nginx-deployment
    16. spec:
    17. containers:
    18. - name: nginx
    19. image: docker.io/library/nginx:1.20.2
    20. ports:
    21. - containerPort: 80

    creating the deployment again:

    1. $ kubectl create -f def-deploy.yaml
    2. deployment.apps/nginx-deployment created

    Checking the pods:

    1. fmiranda@kubernetes:~$ kubectl get pods
    2. NAME READY STATUS RESTARTS AGE
    3. nginx-deployment-769f4c67db-7ltfw 0/1 ContainerCreating 0 3s
    4. nginx-deployment-769f4c67db-lk8bd 0/1 ContainerCreating 0 3s
    5. nginx-deployment-769f4c67db-qbhnk 0/1 ContainerCreating 0 3s
    6.  

    Then:

    1. fmiranda@kubernetes:~$ kubectl get pods
    2. NAME READY STATUS RESTARTS AGE
    3. nginx-deployment-769f4c67db-7ltfw 1/1 Running 0 5s
    4. nginx-deployment-769f4c67db-lk8bd 1/1 Running 0 5s
    5. nginx-deployment-769f4c67db-qbhnk 1/1 Running 0 5s

    It all works out now! wooohoo!

    Is this just with me? Or is this that needs to be updated in the course content?

    Thank you !!!

  • Posts: 2,434

    Hi @fmiranda,

    The name resolution issue you encountered is possibly attributed to the Docker driver and its networking limitations. I have not encountered this issue with hypervisor drivers, while launching applications imperatively with kubectl or declaratively from a manifest.
    There is a note, later on in the course however, when deploying an application from the Kubernetes Dashboard, that the image name may need to be prefixed by docker.io/library/, a known issue with earlier Dashboard versions.

    Regards,
    -Chris

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training