Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod creation: cannot expose 2 different host ports pointing to the same pod port #7062

Closed
paoloantinori opened this issue Jul 23, 2020 · 4 comments · Fixed by #7074
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@paoloantinori
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I'm trying to create a pod that exposes 2 different host ports but that wants the to point to the same pod port.

Steps to reproduce the issue:

  1. podman pod create --name=test --share net -p 8080:8080 -p 8081:8080

Describe the results you received:

10:11 $ podman pod create --name=test --share net -p 8080:8080 -p 8081:8080
Error: conflicting port mappings for container port 8080 (protocol tcp)

Describe the results you expected:
Podman to allow the operation.
This use case is actually something coming from a docker-compose configuration that failed when I run it via podman-compose and the reported command is the one that was produced by podman-compose

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

10:27 $ podman --version 
podman version 2.0.2

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.15.0
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.18-1.fc32.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.18, commit: 6e8799f576f11f902cd8a8d8b45b2b2caf636a85'
  cpus: 8
  distribution:
    distribution: fedora
    version: "32"
  eventLogger: file
  hostname: trane
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.7.9-200.fc32.x86_64
  linkmode: dynamic
  memFree: 2878697472
  memTotal: 33014153216
  ociRuntime:
    name: crun
    package: Unknown
    path: /usr/local/bin/crun
    version: |-
      crun version 0.13.115-0bb6
      commit: 0bb65c7cf939ed3596a9f3798978b27c9635fff6
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.4-1.fc32.x86_64
    version: |-
      slirp4netns version 1.1.4
      commit: b66ffa8e262507e37fca689822d23430f3357fe8
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 2
  swapFree: 16599351296
  swapTotal: 16609439744
  uptime: 22h 46m 35.14s (Approximately 0.92 days)
registries:
  search:
  - docker.io
  - registry-proxy.engineering.redhat.com
  - registry.fedoraproject.org
  - quay.io
  - registry.redhat.io
  - registry.centos.org
store:
  configFile: /home/pantinor/.config/containers/storage.conf
  containerStore:
    number: 11
    paused: 0
    running: 0
    stopped: 11
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.1.2-1.fc32.x86_64
      Version: |-
        fusermount3 version: 3.9.1
        fuse-overlayfs: version 1.1.0
        FUSE library version 3.9.1
        using FUSE kernel interface version 7.31
  graphRoot: /home/pantinor/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 36
  runRoot: /run/user/1000/containers
  volumePath: /home/pantinor/.local/share/containers/storage/volumes
version:
  APIVersion: 1
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.14.3
  OsArch: linux/amd64
  Version: 2.0.2


Package info (e.g. output of rpm -q podman or apt list podman):

podman-2.0.2-1.fc32.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):

Fedora release 32 (Thirty Two)
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 23, 2020
@mheon
Copy link
Member

mheon commented Jul 23, 2020

I'll take this one. Need to verify that it is actually possible with CNI.

@mheon mheon self-assigned this Jul 23, 2020
@mheon
Copy link
Member

mheon commented Jul 23, 2020

Looks like this does work in 1.9.3.

@mheon
Copy link
Member

mheon commented Jul 23, 2020

Fixed by #7074

@paoloantinori
Copy link
Author

Thank you!

mheon added a commit to mheon/libpod that referenced this issue Jul 29, 2020
The initial version of the new port code mistakenly restricted
this, so un-restrict it. We still need to maintain the map of
container ports, unfortunately (need to verify if the port in
question is a duplicate, for example).

Fixes containers#7062

Signed-off-by: Matthew Heon <[email protected]>
mheon added a commit to mheon/libpod that referenced this issue Jul 31, 2020
The initial version of the new port code mistakenly restricted
this, so un-restrict it. We still need to maintain the map of
container ports, unfortunately (need to verify if the port in
question is a duplicate, for example).

Fixes containers#7062

Signed-off-by: Matthew Heon <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants