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

substituting podman for docker for use with kubernetes kind fails #4373

Closed
joelddiaz opened this issue Oct 29, 2019 · 17 comments
Closed

substituting podman for docker for use with kubernetes kind fails #4373

joelddiaz opened this issue Oct 29, 2019 · 17 comments
Labels
do-not-close 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

@joelddiaz
Copy link

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.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 29, 2019
@AkihiroSuda
Copy link
Collaborator

CgroupVersion: v2

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

@giuseppe
Copy link
Member

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

@mheon
Copy link
Member

mheon commented Oct 30, 2019 via email

@joelddiaz
Copy link
Author

@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 ~]# 

@mheon
Copy link
Member

mheon commented Oct 31, 2019

I'll take this one

@github-actions
Copy link

github-actions bot commented Dec 1, 2019

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 2, 2019

@mheon Did you ever work on this?

@mheon
Copy link
Member

mheon commented Dec 2, 2019

Not yet, I'll take a look tomorrow

@ghost
Copy link

ghost commented Dec 25, 2019

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

@mheon
Copy link
Member

mheon commented Dec 26, 2019

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.

@mheon
Copy link
Member

mheon commented Dec 26, 2019

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.

@eisraeli
Copy link

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

@mheon
Copy link
Member

mheon commented Dec 30, 2019 via email

@rhatdan
Copy link
Member

rhatdan commented Dec 31, 2019

Is the fix in podman 1.7 or later?

@rhatdan rhatdan closed this as completed Dec 31, 2019
@drpaneas
Copy link

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.

@borqosky
Copy link

borqosky commented Mar 8, 2020

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

@drpaneas
Copy link

drpaneas commented Mar 9, 2020

@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.

@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 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

9 participants