Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1360233 - [RFE] Better to have "oc run" also create emptyDir volume automatically for image which need a volume like "oc new-app"
Summary: [RFE] Better to have "oc run" also create emptyDir volume automatically for i...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OKD
Classification: Red Hat
Component: Command Line Interface
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-26 10:06 UTC by Bing Li
Modified: 2016-11-28 21:22 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-28 21:22:04 UTC


Attachments (Terms of Use)

Description Bing Li 2016-07-26 10:06:38 UTC
Description of problem:
For images which need a volume in the dockerfile, "oc new-app" command can create emptyDir volume automatically. Is it designed behave like this? But "oc run" command cannot create volume automatically, and pod would failed to be running.
This does not matter for OCP env, but will affect user experience in Online env, so propose this RFE.

Steps to Reproduce:
1. Create by "oc new-app" command;
# oc new-app --image-stream=postgresql:9.5 --env=POSTGRESQL_USER=user,POSTGRESQL_PASSWORD=redhat,POSTGRESQL_DATABASE=sampledb,POSTGRESQL_MAX_CONNECTIONS=42,POSTGRESQL_SHARED_BUFFERS=64MB

2. Pod should be running after a while, and an emptyDir volume would be created automatically.
# oc get pod
NAME                 READY     STATUS    RESTARTS   AGE
postgresql-1-l6jek   1/1       Running   0          1m
# oc get dc postgresql -o json
...
            "spec": {
                "volumes": [
                    {
                        "name": "postgresql-volume-1",
                        "emptyDir": {}
                    }
                ],
...
                        "volumeMounts": [
                            {
                                "name": "postgresql-volume-1",
                                "mountPath": "/var/lib/pgsql/data"
                            }
                        ],
...
3. Create by "oc run" command;
# oc run psql --image=registry.access.redhat.com/rhscl/postgresql-95-rhel7 --env=POSTGRESQL_USER=user,POSTGRESQL_PASSWORD=redhat,POSTGRESQL_DATABASE=sampledb,POSTGRESQL_MAX_CONNECTIONS=42,POSTGRESQL_SHARED_BUFFERS=64MB
deploymentconfig "psql" created

4. Pod would fail to be running, because no volume is created;
# oc get pod
NAME            READY     STATUS              RESTARTS   AGE
psql-1-deploy   1/1       Running             0          1m
psql-1-gfh4q    0/1       RunContainerError   0          1m
# oc describe pod psql-1-gfh4q
...
  2s        2s        1        {kubelet ip-172-31-9-167.ec2.internal}                Warning        FailedSync        Error syncing pod, skipping: failed to "StartContainer" for "psql" with RunContainerError: "runContainer: API error (500): mkdir /var/lib/docker/volumes/24f77003ec438227ebef66d64e6bb8551860ac84b151e814710720a4f9f89b6e: permission denied\n"
...

Comment 1 Fabiano Franz 2016-10-31 19:20:36 UTC
Adding Cesar and Derek for opinions. 

I'm not sure the `run` command should have such level of intelligence - `oc run` is more targeted at "run this image" use cases where the developer will set up the dependencies it needs to become an usable app, rather than "run this images with all it depends on to become an app", which is actually a responsibility of `oc new-app`.

Comment 2 Derek Carr 2016-11-28 21:09:17 UTC
I think the `run` command should not have this level of intelligence.


Note You need to log in before you can comment on or make changes to this bug.