podman: Podman play kube does not bind ports to localhost

/kind bug

Given the following pod manifest…

apiVersion: v1
kind: Pod
metadata:
  name: my-pod
  labels:
    app: my-pod
spec:
  containers:
  - name: nginx-container
    image: nginx:latest
    command: ['nginx', '-g', 'daemon off;']
    ports:
    - containerPort: 80
  - name: python-web-container
    image: quay.io/redhatworkshops/simple-python-web:latest
    command: [ '/usr/bin/python3', '-m', 'http.server', '8080']
    ports:
    - containerPort: 80

produces the following output when running podman play kube mypod.yaml

ERRO[0007] error starting some container dependencies   
ERRO[0007] "failed to expose ports via rootlessport: \"unknown proto: \\\"\\\"\\n\"" 
Error: error starting some containers: internal libpod error

Here is my version

$ podman version
Version:            1.8.1
RemoteAPI Version:  1
Go Version:         go1.13.6
OS/Arch:            linux/amd64

Here is my os

$ cat /etc/os-release 
NAME=Fedora
VERSION="31 (Workstation Edition)"
ID=fedora
VERSION_ID=31
VERSION_CODENAME=""
PLATFORM_ID="platform:f31"
PRETTY_NAME="Fedora 31 (Workstation Edition)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:31"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f31/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=31
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=31
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
$ uname -a
Linux laptop 5.5.10-200.fc31.x86_64 #1 SMP Wed Mar 18 14:21:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (20 by maintainers)

Commits related to this issue

Most upvoted comments

@mheon thanks so much for the clarification.

In my mind then, the behavior I would expect is as follows:

  • containerPort (only) does nothing in a podman context, or is informational. This is line with usage in Kubernetes. https://github.com/kubernetes/kubernetes/issues/4332

  • hostPort (only) acts like a publish [hostPort]:[hostPort]

  • containerPort + hostPort works like it does in kubernetes, as in a publish [hostPort]:[containerPort]

I think this will still require a change to some other networking code to get the above logic correct.

Does this proposal seem reasonable?