Podman: substituting podman for docker for use with kubernetes kind fails

Created on 29 Oct 2019  Â·  17Comments  Â·  Source: containers/podman

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

/kind bug

Description

Trying to substitute the requirement for docker in the kind (kubernetes in docker) tool https://github.com/kubernetes-sigs/kind, and it fails due to the combination of arguments that podman is launched with.

Steps to reproduce the issue:

  1. Download / install kind (put it in your path and chmod +x the binary)

  2. Create a symlink for docker to point to podman (ln -s /usr/bin/podman ~/bin/docker)

  3. Try to create a cluster 'kind create cluster'

Describe the results you received:
The tool launches podman (thinking that it is really docker) with a combination of flags that causes podman to error.

jdiaz@minigoomba ~]$ kind create cluster --loglevel=debug
DEBU[16:20:06] Running: /home/jdiaz/bin/docker [docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}\t{{.Label "io.k8s.sigs.kin
d.cluster"}}] 
Error: could not list clusters: failed to list nodes: exit status 125

Describe the results you expected:
Would like podman to accept the same set of CLI parameters as docker.

Additional information you deem important (e.g. issue happens only occasionally):
When actually running the command that 'kind' invokes you get this output:

[jdiaz@minigoomba ~]$ docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format '{{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}}'
Error: error with flags passed: quiet conflicts with size, namespace, and format with go template

Output of podman version:

[jdiaz@minigoomba ~]$ podman version
Version:            1.6.2
RemoteAPI Version:  1
Go Version:         go1.13.1
OS/Arch:            linux/amd64

Output of podman info --debug:

[jdiaz@minigoomba ~]$ 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: 8088338432      
  MemTotal: 16664195072    
  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: 7983435776
  SwapTotal: 8401186816
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: minigoomba
  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: 121h 9m 15.68s (Approximately 5.04 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/jdiaz/.config/containers/storage.conf
  ContainerStore:
    number: 0
  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/jdiaz/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 6
  RunRoot: /run/user/1000
  VolumePath: /home/jdiaz/.local/share/containers/storage/volumes

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

[jdiaz@minigoomba ~]$ rpm -q podman
podman-1.6.2-2.fc31.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):
Fedora 31 system on a physical machine.

do-not-close kinbug stale-issue

Most helpful comment

Just for the reference, KinD does not work with podman. There are many small things need to be addressed in KinD project to make it work properly.

All 17 comments

CgroupVersion: v2

You can't run Kubernetes on v2 anyway at this moment

Does Docker ignore --quiet when --format is used?

The use of the two together seems somewhat bizarre but we should mirror
Docker here if they allow it.

On Wed, Oct 30, 2019, 04:06 Giuseppe Scrivano notifications@github.com
wrote:

Does Docker ignore --quiet when --format is used?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/containers/libpod/issues/4373?email_source=notifications&email_token=AB3AOCCLKAHVLZUHO22GMN3QRE6ARA5CNFSM4JGPEAH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECTH4WI#issuecomment-547782233,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB3AOCFEB7AXP4EHHJ74EI3QRE6ARANCNFSM4JGPEAHQ
.

@giuseppe yes, it does appear to allow it:

[root@minigoomba ~]# docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format '{{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}}'
[root@minigoomba ~]# echo $?
0
[root@minigoomba ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.4
 API version:       1.40
 Go version:        go1.12.10
 Git commit:        9013bf583a
 Built:             Fri Oct 18 16:05:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.4
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.10
  Git commit:       9013bf583a
  Built:            Fri Oct 18 16:03:41 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
[root@minigoomba ~]# 

I'll take this one

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.

@mheon Did you ever work on this?

Not yet, I'll take a look tomorrow

@mheon - is there ETA for this ? I want to stay with my alias podman=docker and softlink docker->podman ;-)

Took a crack at this one today. I've convinced Podman to accept both --format and --quiet at the same time, but now we begin to run into problems with the specific format string. Podman does not record labels in the struct that we output for ps at present. I can do a one-time patch on this easily enough, but this could be a persistent problem for applications wanting to make advanced use of Go templates - they don't just reflect what we print to the terminal, but also internal structures are not so easy to guarantee compatibility.

Partial solution in #4751

I was unable to convince Podman to accept the exact --format command here - it looks like .Label is actually .Labels internally, and the data type doesn't seem to match as well. Someone more familiar with Go templates will need to take a look at that.

Ran into a similar issue.
Using Podman 1.6.2 & a podman-docker package.

kind create cluster

Results in:
ERROR: failed to list clusters: command "docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster=kind --format '{{.Names}}'" failed with error: exit status 125

That should be fixed on master. The missing bit is support for labels in
templates.

On Mon, Dec 30, 2019, 11:22 Eran Israeli notifications@github.com wrote:

Ran into a similar issue.
Using Podman 1.6.2 & a podman-docker package.

kind create cluster

Results in:
ERROR: failed to list clusters: command "docker ps -q -a --no-trunc
--filter label=io.k8s.sigs.kind.cluster=kind --format '{{.Names}}'" failed
with error: exit status 125

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/containers/libpod/issues/4373?email_source=notifications&email_token=AB3AOCCOL2W4FUAY6KNNCW3Q3IN2PA5CNFSM4JGPEAH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2UXVY#issuecomment-569723863,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB3AOCGHGZSXTOQCE3GOSBDQ3IN2PANCNFSM4JGPEAHQ
.

Is the fix in podman 1.7 or later?

Just for the reference, KinD does not work with podman. There are many small things need to be addressed in KinD project to make it work properly.

@drpaneas Since it is closed, is there any issue (maybe PR) which tracks it?

@drpaneas Since it is closed, is there any issue (maybe PR) which tracks it?

My memory doesn't serve me at the moment. I remember there were some PRs for fixing 1 or 2 issues, yet there were more problems that need to be addressed. When I will give it a try next time, I will be more concrete.

Was this page helpful?
0 / 5 - 0 ratings