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 not idemponent when port is bound to 0.0.0.0/ maybe same as issue #679 #743

Closed
EinApfelBaum opened this issue May 11, 2024 · 0 comments · Fixed by #744
Closed

Pod not idemponent when port is bound to 0.0.0.0/ maybe same as issue #679 #743

EinApfelBaum opened this issue May 11, 2024 · 0 comments · Fixed by #744
Assignees
Labels
bug/idempotency Bug related to idempotency of modules

Comments

@EinApfelBaum
Copy link

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

/kind bug

Description

duplicate of #679, but for pods.

The pod is being recreated everytime the playbook runs but only if there is at least one published port which bounds to address 0.0.0.0. Please refer to the diff output below to quickly see the problem.

Steps to reproduce the issue:

Run the playbook shown later in this post. And then rerun it to see that the pod is being recreated everytime.

Describe the results you received:

The pod should only be created once instead of everytime the task executes.

Describe the results you expected:

The pod should not be recreated.

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

Happens all the time.

Version of the containers.podman collection:
Either git commit if installed from git: git show --summary
Or version from ansible-galaxy if installed from galaxy: ansible-galaxy collection list | grep containers.podman

containers.podman 1.13.0 
containers.podman         1.4.1  

Output of ansible --version:

ansible 2.10.8
  config file = /home/baum/git/ansible.infrastructure/ansible.cfg
  configured module search path = ['/home/baum/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]

Output of podman version:

Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.18.1
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: 'conmon: /usr/bin/conmon'
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: unknown'
  cpus: 16
  distribution:
    codename: vera
    distribution: linuxmint
    version: "21.1"
  eventLogger: journald
  hostname: baum-framework
  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: 6.1.0-1035-oem
  linkmode: dynamic
  logDriver: journald
  memFree: 8504508416
  memTotal: 16458379264
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.17
      commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.6.1
  swapFree: 2147479552
  swapTotal: 2147479552
  uptime: 4h 14m 24.49s (Approximately 0.17 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/baum/.config/containers/storage.conf
  containerStore:
    number: 9
    paused: 0
    running: 0
    stopped: 9
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/baum/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 12
  runRoot: /run/user/1000/containers
  volumePath: /home/baum/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.18.1
  OsArch: linux/amd64
  Version: 3.4.4

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

(paste your output here)

Playbok you run with ansible (e.g. content of playbook.yaml):

---

- hosts: localhost
  gather_facts: false
  tasks:
    - name: Create podman pod
      containers.podman.podman_pod:
        name: TestPod
        state: created
        publish:
          - "0.0.0.0:8000:8000"

Command line and output of ansible run with high verbosity

Please NOTE: if you submit a bug about idempotency, run the playbook with --diff option, like:

ansible-playbook -i inventory --diff -vv playbook.yml

PLAY [localhost] *******************************************************************************************************************************

TASK [Create podman pod] ***********************************************************************************************************************
--- before
+++ after
@@ -1 +1 @@
-publish - ['8000:8000']
+publish - ['0.0.0.0:8000:8000']

changed: [localhost]

PLAY RECAP *************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

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

sshnaidm added a commit to sshnaidm/ansible-podman-collections that referenced this issue May 13, 2024
Fix containers#743
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
@sshnaidm sshnaidm self-assigned this May 13, 2024
@sshnaidm sshnaidm added the bug/idempotency Bug related to idempotency of modules label May 13, 2024
sshnaidm added a commit that referenced this issue May 13, 2024
Fix #743
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/idempotency Bug related to idempotency of modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants