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

podman play kube ignores hostNetwork directive in pod description #4432

Closed
larsks opened this issue Nov 3, 2019 · 11 comments
Closed

podman play kube ignores hostNetwork directive in pod description #4432

larsks opened this issue Nov 3, 2019 · 11 comments
Assignees
Labels
do-not-close Good First Issue This issue would be a good issue for a first time contributor to undertake. 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. stale-issue

Comments

@larsks
Copy link
Contributor

larsks commented Nov 3, 2019

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

/kind bug

Description

podman play kube does not respect the hostNetwork parameter in a pod spec.

Steps to reproduce the issue:

  1. Create a pod description that uses the hostNetwork parameter:
$ cat pod.yml
---
apiVersion: v1
kind: Pod
metadata:
  name: database-pod
spec:
  hostNetwork: true
  containers:
    - image: mariadb
      name: database
      env:
        - name: MYSQL_ROOT_PASSWORD
          value: secret
$ sudo podman play kube pod.yml
  1. Examine the container network configuration.
$ sudo podman exec database ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
3: eth0@if18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 5e:db:0e:7b:f4:87 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.88.0.38/16 brd 10.88.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5cdb:eff:fe7b:f487/64 scope link
       valid_lft forever preferred_lft forever
  1. See that the container has an isolated network namespace rather than using the host network namespace.

Describe the results you expected:

I expected the container to run in the host network namespace.

Output of podman version:

Version:            1.6.2
RemoteAPI Version:  1
Go Version:         go1.13.1
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.13.1
  podman version: 1.6.2
host:
  BuildahVersion: 1.11.3
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.2-1.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.2, commit: 186a550ba0866ce799d74006dab97969a2107979'
  Distribution:
    distribution: fedora
    version: "31"
  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
  MemFree: 26143690752
  MemTotal: 33580802048
  OCIRuntime:
    name: crun
    package: crun-0.10.2-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.10.2
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 16890458112
  SwapTotal: 16890458112
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: madhatter
  kernel: 5.3.7-301.fc31.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-0.4.0-20.1.dev.gitbbd6f25.fc31.x86_64
    Version: |-
      slirp4netns version 0.4.0-beta.3+dev
      commit: bbd6f25c70d5db2a1cd3bfb0416a8db99a75ed7e
  uptime: 17m 52.89s
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/lars/.config/containers/storage.conf
  ContainerStore:
    number: 5
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.6.5-2.fc31.x86_64
      Version: |-
        fusermount3 version: 3.6.2
        fuse-overlayfs: version 0.6.5
        FUSE library version 3.6.2
        using FUSE kernel interface version 7.29
  GraphRoot: /home/lars/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 5
  RunRoot: /run/user/1000
  VolumePath: /home/lars/.local/share/containers/storage/volumes

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

podman-1.6.2-2.fc31.x86_64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 3, 2019
@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Nov 4, 2019
@rhatdan
Copy link
Member

rhatdan commented Nov 4, 2019

@haircommander Or anyone else. Seems like this would be a good fist issue.
@larsks Would you be interested in attempting a PR to fix this?

@haircommander
Copy link
Collaborator

I hope the work beginning in #2957 will solve this

@larsks
Copy link
Contributor Author

larsks commented Nov 4, 2019

Note that this isn't "just" a play kube issue: we also need to update podman pod create to allow setting the network mode, and podman generate kube to generate correct YAML for pods in host network mode.

@larsks
Copy link
Contributor Author

larsks commented Nov 18, 2019

It looks like this was also requested in #3837.

@github-actions
Copy link

This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days.

@rhatdan
Copy link
Member

rhatdan commented Dec 19, 2019

@larsks @haircommander Is this fixed now? Can we close?

@haircommander
Copy link
Collaborator

@larsks @haircommander Is this fixed now? Can we close?

nope, still not fixed

@rhatdan
Copy link
Member

rhatdan commented Feb 18, 2020

@mheon Could you mark this on as fixed by your PR?

@rhatdan
Copy link
Member

rhatdan commented Feb 18, 2020

#5241

@mheon
Copy link
Member

mheon commented Feb 18, 2020

I got everything except play kube. I'll add a patch to fix this as well.

mheon added a commit to mheon/libpod that referenced this issue Feb 18, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@mheon
Copy link
Member

mheon commented Feb 18, 2020

Added to #5241

mheon added a commit to mheon/libpod that referenced this issue Feb 18, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
mheon added a commit to mheon/libpod that referenced this issue Feb 18, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
mheon added a commit to mheon/libpod that referenced this issue Feb 18, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
mheon added a commit to mheon/libpod that referenced this issue Feb 18, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
mheon added a commit to mheon/libpod that referenced this issue Feb 18, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
mheon added a commit to mheon/libpod that referenced this issue Feb 19, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
snj33v pushed a commit to snj33v/libpod that referenced this issue May 31, 2020
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes containers#2808
Fixes containers#3837
Fixes containers#4432
Fixes containers#4718
Fixes containers#4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@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
do-not-close Good First Issue This issue would be a good issue for a first time contributor to undertake. 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. stale-issue
Projects
None yet
Development

No branches or pull requests

6 participants