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 Support for K8s "Deployment" specification #4093

Closed
aric49 opened this issue Sep 24, 2019 · 18 comments · Fixed by #4094
Closed

Podman Support for K8s "Deployment" specification #4093

aric49 opened this issue Sep 24, 2019 · 18 comments · Fixed by #4094
Assignees
Labels
do-not-close kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@aric49
Copy link

aric49 commented Sep 24, 2019

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

/kind bug

Description
When I attempt to use podman play kube deployment.yaml against a Kubernetes YAML in the "Deployment" specification, an empty pod gets created consisting of a simple "pause" container and no other containers or configuration.

Steps to reproduce the issue:

  1. Download the sample deployment yaml: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment -- name it "deployment.yaml"

  2. Run the podman play kube deployment.yaml

  3. Observe the following pod gets created:

Describe the results you received:

When I look at pods, i see that it was created, but the number of containers is only one (The pause container)

$ podman pod ps
POD ID         NAME               STATUS    CREATED         # OF CONTAINERS   INFRA ID
db2dfc0a6e87   nginx-deployment   Created   5 seconds ago   1                 af291850cbea

Pod inspect shows more details:

$ podman pod inspect nginx-deployment
{
     "Config": {
          "id": "db2dfc0a6e873109bdef08665697abe2c075c1a1e33282d2832dbd55be83a0e6",
          "name": "nginx-deployment",
          "labels": {
               
          },
          "cgroupParent": "/libpod_parent",
          "sharesCgroup": true,
          "sharesIpc": true,
          "sharesNet": true,
          "sharesUts": true,
          "infraConfig": {
               "makeInfraContainer": true,
               "infraPortBindings": null
          },
          "created": "2019-09-24T09:01:30.464091403-04:00",
          "lockID": 1
     },
     "State": {
          "cgroupPath": "/libpod_parent/db2dfc0a6e873109bdef08665697abe2c075c1a1e33282d2832dbd55be83a0e6",
          "infraContainerID": "af291850cbeac8c151a94f6897ded30673d424a8cb164acc29ede9a2708a7c35"
     },
     "Containers": [
          {
               "id": "af291850cbeac8c151a94f6897ded30673d424a8cb164acc29ede9a2708a7c35",
               "state": "configured"
          }
     ]
}

If I try to re-generate a kubernetes YAML based on this pod, I receive the error:

$ podman generate kube nginx-deployment
Error: pod db2dfc0a6e873109bdef08665697abe2c075c1a1e33282d2832dbd55be83a0e6 only has an infra container

Sure enough, if I look at podman ps -a, I see the single pause container:

podman ps -a
CONTAINER ID  IMAGE                           COMMAND               CREATED         STATUS                   PORTS  NAMES
af291850cbea  k8s.gcr.io/pause:3.1                                  16 minutes ago  Created                         db2dfc0a6e87-infra

Describe the results you expected:

Either an error message that the deployment spec isn't support format for podman play, or Podman creates the Pod, ignoring the number of replicas specified since Podman isn't really for container orchestration.

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

Overall, I think that the "Deployment" spec is an important format for Podman to support and also to output Kubernetes YAML in podman generate. I have been working with Kubernetes deployments for a number of years, and I have yet to really see anyone deploying naked pods in a production environment. The Deployment is pretty standard practice in the Kubernetes community for creating and scaling pods. It would be really great for podman to have the ability to take the same YAML you're deploying in production and have the ability to spin up a single pod locally for testing.

Output of podman version:

podman version 1.5.1

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12.7
  podman version: 1.5.1
host:
  BuildahVersion: 1.10.1
  Conmon:
    package: podman-1.5.1-3.fc30.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.0, commit: d728afa06cd2df86a27f32a4692c7099a56acc97-dirty'
  Distribution:
    distribution: fedora
    version: "30"
  MemFree: 25730248704
  MemTotal: 33571356672
  OCIRuntime:
    package: containerd.io-1.2.5-3.1.fc29.x86_64
    path: /usr/sbin/runc
    version: |-
      runc version 1.0.0-rc6+dev
      commit: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
      spec: 1.0.1-dev
  SwapFree: 16894652416
  SwapTotal: 16894652416
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: thinkpad-p51
  kernel: 5.2.15-200.fc30.x86_64
  os: linux
  rootless: true
  uptime: 52m 41.2s
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /home/aric/.config/containers/storage.conf
  ContainerStore:
    number: 2
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mount_program=/usr/bin/fuse-overlayfs
  GraphRoot: /home/aric/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 3
  RunRoot: /run/user/1000
  VolumePath: /home/aric/.local/share/containers/storage/volumes

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

podman-1.5.1-3.fc30.x86_64

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 24, 2019
@mheon mheon added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Sep 24, 2019
@haircommander
Copy link
Collaborator

/assign
quick fix coming up

@mheon
Copy link
Member

mheon commented Sep 24, 2019

Reopening. We want to eventually support the Deployment spec, but it's a feature request, not a bug.

@mheon mheon reopened this Sep 24, 2019
@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.

@mheon
Copy link
Member

mheon commented Oct 30, 2019

Feature request, should not be closed

@rhatdan
Copy link
Member

rhatdan commented Feb 17, 2020

Is this something an intern could work on?

@theunrealgeek
Copy link
Contributor

I would love to take this on if there is still interest in this feature

@mheon
Copy link
Member

mheon commented Mar 31, 2020 via email

@aric49
Copy link
Author

aric49 commented Apr 6, 2020

@theunrealgeek --- Thanks for taking this on. Just to clarify, this is still feature that I would like to see. I"m sure there are plenty of others out there that it would make sense for as well.

@theunrealgeek
Copy link
Contributor

@aric49 I will have a first cut at this very soon (~ couple of days). I plan on having a simple interpretation of the Deployment object into a bunch of identical pods. I'm still debating whether to introduce the ReplicaSet concept that k8s uses underlying a Deployment.

Also, to my understanding podman itself is stateless, so supporting something like a re-play of a changed file to only update what changed, is going to be difficult. If anyone has thoughts on how this can be achieved I'm all ears.

@haircommander
Copy link
Collaborator

@aric49 I will have a first cut at this very soon (~ couple of days). I plan on having a simple interpretation of the Deployment object into a bunch of identical pods. I'm still debating whether to introduce the ReplicaSet concept that k8s uses underlying a Deployment.

Also, to my understanding podman itself is stateless, so supporting something like a re-play of a changed file to only update what changed, is going to be difficult. If anyone has thoughts on how this can be achieved I'm all ears.

@theunrealgeek
there exists the libpod database where state can be kept, but I'd honestly not go forward with the update feature yet. it's been asked for for pod yaml as well, and I think it'll take a bit of plumbing to work nicely

Excited to see the work you've done!

@theunrealgeek
Copy link
Contributor

Looks like as part of podman V2 birth commit, the play command and associated code got removed. I'll look into brining this back into the new v2 state of the code and I'll also need to familiarize with the new way of doing things.

@rhatdan
Copy link
Member

rhatdan commented Apr 18, 2020

@theunrealgeek Awesome we need lots of help getting V2 up to speed.

@theunrealgeek
Copy link
Contributor

Just a quick status update, I'm still working on getting play kube for both Pod and Deployment types working.
I'm having to rewrite many things for v2 and also got busy with my day job a little last few days...

@github-actions
Copy link

github-actions bot commented Jun 1, 2020

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jun 2, 2020

@theunrealgeek How is it going?

@theunrealgeek
Copy link
Contributor

I've just pushed the commits addressing PR comments and I'm hoping to get it approved soon

@theunrealgeek
Copy link
Contributor

@aric49 This feature got merged a day back into master, please try it out

@rhatdan rhatdan closed this as completed Jun 15, 2020
@aric49
Copy link
Author

aric49 commented Jun 15, 2020

@theunrealgeek --- Thanks so much for looking into this. It works great. Thank you!

@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/feature Categorizes issue or PR as related to a new feature. 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

Successfully merging a pull request may close this issue.

7 participants