redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
773 stars 244 forks source link

Odo dev on Mac not deploying podman pod for single container Django application #7236

Closed ucfchandra closed 2 months ago

ucfchandra commented 2 months ago

/kind bug

What versions of software are you using?

Operating System:

Mac (not M1)

Output of odo version:

===============================================
⚠  unable to fetch the cluster server version
===============================================
odo v3.15.0 (10b5e8a8f-Homebrew)

Podman Client: 4.9.3

How did you run odo exactly?

ODO_PUSH_IMAGES=false odo dev --platform=podman

Actual behavior

✗  Deploying pod [4s]
Error occurred on Push - exit status 125: 
Complete Podman output:
Error: playing YAML file: initializing source [image]: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

Expected behavior

Running Django container

Any logs, error output, etc?

Podman machine is initialized, started, and running, so that is not the issue. Might be an issue with my devfile. Attached below.

schemaVersion: 2.2.0

components:
  - name: announcements-image
    image:
      dockerfile:
        uri: ./Containerfile
        buildContext: .
      imageName: announcements-image

  - name: announcements
    container:
      image: announcements-image
      endpoints:
      - name: http-8000
        targetPort: 8000

Thank you :)

rm3l commented 2 months ago

Hi @ucfchandra ,

Error occurred on Push - exit status 125: 
Complete Podman output:
Error: playing YAML file: initializing source [image]: pinging container registry localhost: Get "https://localhost/v2/": dial > tcp [::1]:443: connect: connection refused

I think this might be because of the image pull policy which is set to Always by default on all container components. In this case, it causes Podman to try to pull the image, and Podman will use localhost as the default search registry for relative image names. Can you try changing the image pull policy of your announcements container component to IfNotPresent or Never. See https://odo.dev/docs/troubleshooting#recommended-solution-5 or https://odo.dev/docs/troubleshooting#the-image-pull-policy-of-the-dev-container-is-always-and-i-cannot-change-it

Please Let me know if that fixes the issue. Thanks.

ucfchandra commented 2 months ago

That fixes the issue, thank you!