On Tue, Sep 13, 2016 at 1:35 AM, Ravi Kapoor <ravikapoor...@gmail.com>
wrote:

> Hi Ben,
>
> I am finally able to run my nodejs code on openshift with both approaches
> (volume mount as well as S2I)
> I was also able to resolve most of other issues I mentioned and was able
> to run JEE application as well.
>
> Thanks a lot for helping me through all the silly questions.
> Good news is that now my company will be using openshift to manage our
> dockers/deployments.
>

​cool!  glad we were able to get you going.
​



>
> regards
>
>
> On Sat, Sep 10, 2016 at 8:23 AM, Ben Parees <bpar...@redhat.com> wrote:
>
>> you can define a command on the container within the pod:
>> http://kubernetes.io/docs/user-guide/configuring-containers/
>> #launching-a-container-using-a-configuration-file
>>
>>
>> On Fri, Sep 9, 2016 at 5:21 PM, Ravi <ravikapoor...@gmail.com> wrote:
>>
>>>
>>> Thank you for this help.
>>>
>>> I was trying nginx because after invoking container, I do not have to
>>> run a command. For java or node, after the container is run I will need to
>>> run a command e.g.
>>>
>>> java -jar myapp.jar
>>> OR
>>> node server.js
>>>
>>> Can you guide me how to add this to the json file or point me to
>>> documentation so I can try this?
>>>
>>> thanks so much
>>>
>>>
>>> On 9/8/2016 6:56 PM, Ben Parees wrote:
>>>
>>>> Downloads$ oc get pods
>>>> NAME             READY     STATUS    RESTARTS   AGE
>>>> nginx-1-deploy   1/1       Running   0          14s
>>>> nginx-1-rmfl9    0/1       Error     0          11s
>>>>
>>>> Downloads$ oc logs nginx-1-rmfl9
>>>> 2016/09/09 01:54:21 [warn] 1#1: the "user" directive makes sense only if
>>>> the master process runs with super-user privileges, ignored in
>>>> /etc/nginx/nginx.conf:2
>>>> nginx: [warn] the "user" directive makes sense only if the master
>>>> process runs with super-user privileges, ignored in
>>>> /etc/nginx/nginx.conf:2
>>>> 2016/09/09 01:54:21 [emerg] 1#1: mkdir() "/var/cache/nginx/client_temp"
>>>> failed (13: Permission denied)
>>>> nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (13:
>>>> Permission denied)
>>>>
>>>>
>>>> the nginx image probably only works when run as root or as some other
>>>> specific user.  when images are run in openshift, by default they are
>>>> assigned a random uid for security purposes.  that can cause issues with
>>>> images that expect to run as a specific user.  please see our
>>>> documentation:
>>>>
>>>> https://docs.openshift.org/latest/creating_images/guidelines
>>>> .html#openshift-origin-specific-guidelines
>>>> (section on support arbitrary uids)
>>>>
>>>> to relax the restriction, see:
>>>> https://docs.openshift.org/latest/admin_guide/manage_scc.htm
>>>> l#enable-images-to-run-with-user-in-the-dockerfile
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Sep 8, 2016 at 9:50 PM, Ravi <ravikapoor...@gmail.com
>>>> <mailto:ravikapoor...@gmail.com>> wrote:
>>>>
>>>>
>>>>     oh, forgot to add, I do not have any readiness probe.
>>>>
>>>>     On 9/8/2016 6:47 PM, Ravi Kapoor wrote:
>>>>
>>>>         I removed volumes, pod still failed. json and logs attached
>>>>
>>>>
>>>>
>>>>         On Thu, Sep 8, 2016 at 6:35 PM, Ben Parees <bpar...@redhat.com
>>>>         <mailto:bpar...@redhat.com>
>>>>         <mailto:bpar...@redhat.com <mailto:bpar...@redhat.com>>> wrote:
>>>>
>>>>             though i don't see it in your json it sounds like you have a
>>>>             readiness probe defined on your pod and it's not being met
>>>>         successfully.
>>>>
>>>>             the other possibility is it has to do w/ your mounts.  can
>>>> you
>>>>             temporarily remove the volume mounts and see if the pod
>>>>         comes up?
>>>>
>>>>
>>>>             On Thu, Sep 8, 2016 at 8:33 PM, Ravi Kapoor
>>>>         <ravikapoor...@gmail.com <mailto:ravikapoor...@gmail.com>
>>>>             <mailto:ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com>>> wrote:
>>>>
>>>>                 Pod deployment failed. error in console log is
>>>>
>>>>                 --> Scaling nginx-1 to 1
>>>>                 --> Waiting up to 10m0s for pods in deployment nginx-1
>>>>         to become
>>>>                 ready
>>>>                 error: update acceptor rejected nginx-1: pods for
>>>> deployment
>>>>                 "nginx-1" took longer than 600 seconds to become ready
>>>>
>>>>
>>>>
>>>>                 *$ oc describe pods*
>>>>                 Name:                   nginx-1-deploy
>>>>                 Namespace:              test
>>>>                 Security Policy:        restricted
>>>>                 Node:                   172.27.104.71/172.27.104.71
>>>>         <http://172.27.104.71/172.27.104.71>
>>>>                 <http://172.27.104.71/172.27.104.71
>>>>         <http://172.27.104.71/172.27.104.71>>
>>>>                 Start Time:             Thu, 08 Sep 2016 17:30:29 -0400
>>>>                 Labels:
>>>>                 openshift.io/deployer-pod-for.name=nginx-1
>>>>         <http://openshift.io/deployer-pod-for.name=nginx-1>
>>>>                 <http://openshift.io/deployer-pod-for.name=nginx-1
>>>>         <http://openshift.io/deployer-pod-for.name=nginx-1>>
>>>>                 Status:                 Failed
>>>>                 IP:                     172.17.0.2
>>>>                 Controllers:            <none>
>>>>                 Containers:
>>>>                   deployment:
>>>>                     Container ID:
>>>>
>>>>         docker://da330ff8f32ccb5a83697f50848d7e54f05e8c417149816faf6
>>>> be4f7f5c63650
>>>>                     Image:
>>>>         openshift/origin-deployer:v1.3.0-alpha.2
>>>>                     Image ID:
>>>>
>>>>         docker://sha256:112b6b61d786a37c7d46a46ba7e0c909a0ecbe672ce4
>>>> 6b2b2af0021c0ededa71
>>>>                     Port:
>>>>                     State:              Terminated
>>>>                       Reason:           Error
>>>>                       Exit Code:        1
>>>>                       Started:          Thu, 08 Sep 2016 17:30:32 -0400
>>>>                       Finished:         Thu, 08 Sep 2016 17:40:34 -0400
>>>>                     Ready:              False
>>>>                     Restart Count:      0
>>>>                     Volume Mounts:
>>>>                       /var/run/secrets/kubernetes.io/serviceaccount
>>>>         <http://kubernetes.io/serviceaccount>
>>>>                 <http://kubernetes.io/serviceaccount
>>>>         <http://kubernetes.io/serviceaccount>> from
>>>> deployer-token-6ffzs
>>>>         (ro)
>>>>                     Environment Variables:
>>>>                       KUBERNETES_MASTER:
>>>> https://172.27.104.71:8443
>>>>                       OPENSHIFT_MASTER:
>>>> https://172.27.104.71:8443
>>>>                       BEARER_TOKEN_FILE:
>>>>                  /var/run/secrets/kubernetes.io/serviceaccount/token
>>>>         <http://kubernetes.io/serviceaccount/token>
>>>>                 <http://kubernetes.io/serviceaccount/token
>>>>         <http://kubernetes.io/serviceaccount/token>>
>>>>                       OPENSHIFT_CA_DATA:        -----BEGIN
>>>> CERTIFICATE-----
>>>>
>>>>         MIIC6jCCAdKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtv
>>>> cGVu
>>>>
>>>>         c2hpZnQtc2lnbmVyQDE0NzEzMTU3MDcwHhcNMTYwODE2MDI0ODI2WhcNMjEw
>>>> ODE1
>>>>
>>>>         MDI0ODI3WjAmMSQwIgYDVQQDDBtvcGVuc2hpZnQtc2lnbmVyQDE0NzEzMTU3
>>>> MDcw
>>>>
>>>>         ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIhIflRIqJq8s6HMFc
>>>> 7fGW
>>>>
>>>>         WmOHAWeKhrHrmSLvt3y/zp8uVhSvad89woqTNlkMt4iepFODklAY7DOgGijq
>>>> DxcL
>>>>
>>>>         a0N6GBrbfNm+ucPAeOEnVH3MzwTXkHeJuDVSFbXkAnJJGnq+v3N2G/uhi0S+
>>>> S/Wj
>>>>
>>>>         D0fcwsVpzyawL4E3SztlSd06d1CO2R5mx6gMW9IQo4w2sX2GkNHgy1MTKPzW
>>>> sOlx
>>>>
>>>>         WxUMw3XWwaZUzq8Dt2qet3y19OX0GJQIDVVEcozx2HtiVjlkH0WKU1A5QOYS
>>>> EEzR
>>>>
>>>>         X/v9wsW3X117C5QleGjdjTuQR7dlSJSSWMj7+LEjNtaEFuqXzBrzX+tLDreT
>>>> RoRr
>>>>
>>>>         AgMBAAGjIzAhMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8EBTADAQH/MA0G
>>>> CSqG
>>>>
>>>>         SIb3DQEBCwUAA4IBAQCRyzx+V5Q/dQHSaFX7UKxQHogQOUNu/td0VPiNY88a
>>>> h6UV
>>>>
>>>>         m/+i5dp/ieemFpP2oIh/kTqkhaAaP/fAQ/TEXHvs2UfI+xTgIwxqfghktLwL
>>>> YvBH
>>>>
>>>>         fsLLACvsvxxsqImXbxobE+2PzVZ/k1s8fVrOTyA//PLUVtEt3dVGu7hGTg9w
>>>> 7R8+
>>>>
>>>>         JgDwx/aoxexfIKkz/a/I4DYZ5H47OxeKmSRANQuezjhjeVCeej6nzksQfdWU
>>>> B9e2
>>>>
>>>>         /1hgXeJ1jic8jnUd0oEYoSylyLIe6mAjEbOiDFmDE4kkFTWEIvesttDhAyD6
>>>> qNkm
>>>>                 KP6yHJwyak2vJL6S0F4X8akVQLYT9F6yd8Kay1fy
>>>>                 -----END CERTIFICATE-----
>>>>
>>>>                       OPENSHIFT_DEPLOYMENT_NAME:        nginx-1
>>>>                       OPENSHIFT_DEPLOYMENT_NAMESPACE:   test
>>>>                 Conditions:
>>>>                   Type          Status
>>>>                   Ready         False
>>>>                 Volumes:
>>>>                   deployer-token-6ffzs:
>>>>                     Type:       Secret (a volume populated by a Secret)
>>>>                     SecretName: deployer-token-6ffzs
>>>>                 QoS Tier:       BestEffort
>>>>                 No events.
>>>>
>>>>
>>>>                 On Thu, Sep 8, 2016 at 4:40 PM, Ben Parees
>>>>         <bpar...@redhat.com <mailto:bpar...@redhat.com>
>>>>                 <mailto:bpar...@redhat.com <mailto:bpar...@redhat.com
>>>> >>>
>>>>         wrote:
>>>>
>>>>                     what do the logs for the container show?  what
>>>>         events are
>>>>                     shown when you "oc describe" the pod?
>>>>
>>>>
>>>>                     On Thu, Sep 8, 2016 at 5:41 PM, Ravi Kapoor
>>>>                     <ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com> <mailto:ravikapoor...@gmail.co
>>>> m
>>>>         <mailto:ravikapoor...@gmail.com>>>
>>>>                     wrote:
>>>>
>>>>                         Hi Ben,
>>>>
>>>>                         Thanks, that was lot of help. Looks like I am
>>>>         getting close.
>>>>                         I created the files, i am able to create
>>>> service etc
>>>>                         (even though I had to create route manually, its
>>>>         ok, I
>>>>                         can figure out that part later).
>>>>                         However the service container fails to start.
>>>>         Can you
>>>>                         double check the attached nginx definition?
>>>>
>>>>                         thanks
>>>>
>>>>
>>>>                         On Thu, Sep 8, 2016 at 11:40 AM, Ben Parees
>>>>                         <bpar...@redhat.com <mailto:bpar...@redhat.com>
>>>>         <mailto:bpar...@redhat.com <mailto:bpar...@redhat.com>>> wrote:
>>>>
>>>>                             a template is just a list of resource
>>>>         definitions
>>>>                             and some other metadata.  The only
>>>> significant
>>>>                             difference is the presence of ${KEY} entries
>>>>         which
>>>>                             get substituted with actual values from the
>>>>         parameters.
>>>>
>>>>                             if you just want the objects it defines,
>>>> run:
>>>>                             oc process template.json > file.json
>>>>
>>>>                             that will give you a list object of the
>>>>         resources
>>>>                             after substitution is performed.
>>>>
>>>>
>>>>                             On Thu, Sep 8, 2016 at 2:35 PM, Ravi Kapoor
>>>>                             <ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com>
>>>>                             <mailto:ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com>>> wrote:
>>>>
>>>>                                 I looked at this. The issue is that this
>>>>         is a
>>>>                                 template, I could not figure out how to
>>>>         make it
>>>>                                 a non-template based json.
>>>>                                 In other words - when I select "Add to
>>>>         project"
>>>>                                 and use this JSON, it does not add a
>>>>                                 pod/service/deployment, it only adds a
>>>>         template.
>>>>                                 How do I convert it to a non-template?
>>>>
>>>>                                 On Thu, Sep 8, 2016 at 11:04 AM, Ben
>>>> Parees
>>>>                                 <bpar...@redhat.com
>>>>         <mailto:bpar...@redhat.com> <mailto:bpar...@redhat.com
>>>>         <mailto:bpar...@redhat.com>>>
>>>>                                 wrote:
>>>>
>>>>                                     if you want an example of a
>>>> deployment
>>>>                                     config that correctly uses a
>>>> persistent
>>>>                                     volume claim, you can look at:
>>>>
>>>>
>>>>         https://github.com/openshift/origin/blob/master/examples/jen
>>>> kins/jenkins-persistent-template.json
>>>>         <https://github.com/openshift/origin/blob/master/examples/je
>>>> nkins/jenkins-persistent-template.json>
>>>>
>>>>         <https://github.com/openshift/origin/blob/master/examples/je
>>>> nkins/jenkins-persistent-template.json
>>>>         <https://github.com/openshift/origin/blob/master/examples/je
>>>> nkins/jenkins-persistent-template.json>>
>>>>
>>>>
>>>>                                     On Thu, Sep 8, 2016 at 1:53 PM, Ravi
>>>>         Kapoor
>>>>                                     <ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com>
>>>>                                     <mailto:ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com>>> wrote:
>>>>
>>>>                                         Hi Ben, I am attaching the files
>>>>         I am
>>>>                                         using.
>>>>
>>>>                                         The PersistenceVolume and
>>>>                                         PersistenceVolumeClaim work.
>>>>
>>>>                                         Next when I try to load these
>>>> inside
>>>>                                         nginx docker, I could not find
>>>>         proper
>>>>                                         documentation how to do it.
>>>>                                         So I have been trying to copy
>>>>         various
>>>>                                         JSONs from across the web to
>>>> make it
>>>>                                         work. None of them worked so
>>>> far.
>>>>                                         The latest one I copied
>>>>                                         from
>>>>         http://codegists.com/code/hello%20openshift%20json/
>>>>         <http://codegists.com/code/hello%20openshift%20json/>
>>>>
>>>>         <http://codegists.com/code/hello%20openshift%20json/
>>>>         <http://codegists.com/code/hello%20openshift%20json/>>
>>>>                                         and modified.
>>>>                                         This file is also attached.
>>>>
>>>>                                         thanks so much
>>>>
>>>>
>>>>
>>>>
>>>>                                         On Wed, Sep 7, 2016 at 8:57 AM,
>>>> Ben
>>>>                                         Parees <bpar...@redhat.com
>>>>         <mailto:bpar...@redhat.com>
>>>>                                         <mailto:bpar...@redhat.com
>>>>         <mailto:bpar...@redhat.com>>> wrote:
>>>>
>>>>
>>>>
>>>>                                             On Tue, Sep 6, 2016 at 7:34
>>>>         PM, Ravi
>>>>                                             Kapoor
>>>>         <ravikapoor...@gmail.com <mailto:ravikapoor...@gmail.com>
>>>>
>>>>         <mailto:ravikapoor...@gmail.com
>>>>         <mailto:ravikapoor...@gmail.com>>> wrote:
>>>>
>>>>                                                 1. continuing with this
>>>> ...
>>>>                                                 >  If you want to mount
>>>>         them in
>>>>                                                 separately, you need to
>>>>         define a
>>>>                                                 volume in openshift that
>>>>                                                 includes your class
>>>>         files, and
>>>>                                                 then define a pod in
>>>>         openshift
>>>>                                                 that mounts the volume.
>>>>
>>>>                                                 I am able to create a
>>>>         volume and
>>>>                                                 bind a volume claim to
>>>> it.
>>>>                                                 However when I try to
>>>>         bind it to
>>>>                                                 a container, it fails. I
>>>>         tried
>>>>                                                 using pod definition
>>>> with a
>>>>                                                 claim in example 16.2 at
>>>>
>>>>         https://access.redhat.com/documentation/en/openshift-enterpr
>>>> ise/3.0/paged/developer-guide/chapter-16-using-persistent-volumes
>>>>         <https://access.redhat.com/documentation/en/openshift-enterp
>>>> rise/3.0/paged/developer-guide/chapter-16-using-persistent-volumes>
>>>>
>>>>         <https://access.redhat.com/documentation/en/openshift-enterp
>>>> rise/3.0/paged/developer-guide/chapter-16-using-persistent-volumes
>>>>         <https://access.redhat.com/documentation/en/openshift-enterp
>>>> rise/3.0/paged/developer-guide/chapter-16-using-persistent-volumes>>
>>>>
>>>>                                                 I also tried the one
>>>>                                                 at
>>>>         https://access.redhat.com/documentation/en/openshift-enterpr
>>>> ise/3.0/paged/developer-guide/chapter-8-deployments
>>>>         <https://access.redhat.com/documentation/en/openshift-enterp
>>>> rise/3.0/paged/developer-guide/chapter-8-deployments>
>>>>
>>>>         <https://access.redhat.com/documentation/en/openshift-enterp
>>>> rise/3.0/paged/developer-guide/chapter-8-deployments
>>>>         <https://access.redhat.com/documentation/en/openshift-enterp
>>>> rise/3.0/paged/developer-guide/chapter-8-deployments>>
>>>>                                                 but it gives me "invalid
>>>>         YAML"
>>>>
>>>>
>>>>                                             ​if you provide me w/ the
>>>>         yaml for
>>>>                                             the resources you've defined
>>>>         (both
>>>>                                             the volume and the pod) i
>>>>         can take a
>>>>                                             look​.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                                                 2. Answers inline
>>>>                                                 > what does oc get pods
>>>>         show?
>>>>                                                 nodetest-1-7xucf   1/1
>>>>                                                 Running     0
>>>> 30s
>>>>                                                 nodetest-1-build   0/1
>>>>                                                 Completed   0
>>>> 2m
>>>>
>>>>                                                 > if you run oc get svc,
>>>>         are you
>>>>                                                 able to access the
>>>>         application
>>>>                                                 via the service ip?
>>>>                                                 $ oc get svc
>>>>                                                 NAME       CLUSTER-IP
>>>>                                                  EXTERNAL-IP   PORT(S)
>>>>           AGE
>>>>                                                 nodetest   172.30.110.50
>>>>                                                 <none>        8080/TCP
>>>>  5m
>>>>                                                 $ curl
>>>>         http://172.30.110.50:8080/
>>>>                                                 curl: (7) Failed
>>>> connect to
>>>>                                                 172.30.110.50:8080
>>>>         <http://172.30.110.50:8080>
>>>>                                                 <
>>>> http://172.30.110.50:8080>;
>>>>                                                 Connection refused
>>>>
>>>>
>>>>                                             ​your app needs to listen on
>>>>                                             0.0.0.0, not 127.0.0.1.
>>>>
>>>>
>>>>         https://github.com/openshift/nodejs-ex/blob/master/server.js
>>>> #L14
>>>>         <https://github.com/openshift/nodejs-ex/blob/master/server.j
>>>> s#L14>
>>>>
>>>>         <https://github.com/openshift/nodejs-ex/blob/master/server.j
>>>> s#L14 <https://github.com/openshift/nodejs-ex/blob/master/server.js#L14
>>>> >>
>>>>
>>>>
>>>>         https://github.com/openshift/nodejs-ex/blob/master/server.js
>>>> #L104 <https://github.com/openshift/nodejs-ex/blob/master/server.j
>>>> s#L104>
>>>>
>>>>         <https://github.com/openshift/nodejs-ex/blob/master/server.j
>>>> s#L104
>>>>         <https://github.com/openshift/nodejs-ex/blob/master/server.j
>>>> s#L104>>
>>>>
>>>>                                             ​
>>>>
>>>>
>>>>
>>>>                                                 > How did you get the
>>>> build,
>>>>                                                 application, service,
>>>>         and route
>>>>                                                 defined?  (via oc
>>>>         new-app, or
>>>>                                                 via a template?)
>>>>                                                 from UI, I clicked on
>>>>         "add to
>>>>                                                 project" ->
>>>>         "nodejs:latest" ->
>>>>                                                 enter name "nodetest"
>>>>         and git
>>>>                                                 url as
>>>>
>>>>         "https://github.com/vinayagg/nodejs-hello-world
>>>>         <https://github.com/vinayagg/nodejs-hello-world>
>>>>
>>>>         <https://github.com/vinayagg/nodejs-hello-world
>>>>         <https://github.com/vinayagg/nodejs-hello-world>>"
>>>>                                                 -> click "create".
>>>>                                                 Wait for pod to be
>>>>         deployed and
>>>>                                                 available.
>>>>
>>>>                                                 3. Thanks that makes
>>>>         sense, I
>>>>                                                 have not had time to
>>>>         follow your
>>>>                                                 instructions yet. I will
>>>>         update
>>>>                                                 later.
>>>>
>>>>
>>>>                                                 On Tue, Sep 6, 2016 at
>>>>         1:26 PM,
>>>>                                                 Ben Parees
>>>>         <bpar...@redhat.com <mailto:bpar...@redhat.com>
>>>>
>>>>         <mailto:bpar...@redhat.com <mailto:bpar...@redhat.com>>> wrote:
>>>>
>>>>
>>>>
>>>>                                                     On Tue, Sep 6, 2016
>>>>         at 3:03
>>>>                                                     PM, Ravi Kapoor
>>>>
>>>>         <ravikapoor...@gmail.com <mailto:ravikapoor...@gmail.com>
>>>>
>>>>         <mailto:ravikapoor...@gmail.com <mailto:ravikapoor...@gmail.com
>>>> >>>
>>>>                                                     wrote:
>>>>
>>>>                                                         I have done many
>>>>                                                         tutorials and
>>>>         was able
>>>>                                                         to successfully
>>>> run
>>>>
>>>> existing/prebuild
>>>>                                                         example apps.
>>>>
>>>>                                                         1. For first
>>>>         scenario
>>>>                                                         > deploy it on
>>>>         openshift
>>>>                                                         using "oc
>>>>         new-app" or
>>>>                                                         "oc run"
>>>>                                                         I ran following
>>>>         command
>>>>                                                         "oc run java1
>>>>
>>>>         --image=openjdk:8-jre-alpine
>>>>
>>>>         --env="volume=/home/ec2-user/test:/usr/src/myapp"
>>>>
>>>>         --env="workdir=/usr/src/myapp"
>>>>                                                         java A"
>>>>                                                         and received
>>>>         following
>>>>                                                         error:
>>>>                                                         Error: Could not
>>>>         find or
>>>>                                                         load main class
>>>> A
>>>>
>>>>
>>>>                                                     ​sure, nothing about
>>>>         what
>>>>                                                     you did there is
>>>>         going to
>>>>                                                     mount your class
>>>>         files into
>>>>                                                     the running pod,
>>>>         hence the
>>>>                                                     class not found
>>>>         error.  As I
>>>>                                                     said, build an image
>>>>         that
>>>>                                                     includes your class
>>>>         files,
>>>>                                                     don't try to mount
>>>>         them in
>>>>                                                     separately.  If you
>>>>         want to
>>>>                                                     mount them in
>>>>         separately,
>>>>                                                     you need to define a
>>>>         volume
>>>>                                                     in openshift that
>>>>         includes
>>>>                                                     your class files,
>>>>         and then
>>>>                                                     define a pod in
>>>>         openshift
>>>>                                                     that mounts the
>>>> volume.
>>>>                                                     ​
>>>>
>>>>
>>>>
>>>>
>>>>                                                         2. For second
>>>>         scenario:
>>>>                                                         > i'm not sure
>>>>         what issues
>>>>                                                         you are having
>>>>         with nodejs
>>>>
>>>>                                                         I picked a
>>>>         repository
>>>>                                                         sample node
>>>>         repository
>>>>
>>>>         (https://github.com/azat-co/nodejs-hello-world
>>>>         <https://github.com/azat-co/nodejs-hello-world>
>>>>
>>>>         <https://github.com/azat-co/nodejs-hello-world
>>>>         <https://github.com/azat-co/nodejs-hello-world>>),
>>>>                                                         forked it
>>>>                                                         at
>>>>         https://github.com/vinayagg/nodejs-hello-world
>>>>         <https://github.com/vinayagg/nodejs-hello-world>
>>>>
>>>>         <https://github.com/vinayagg/nodejs-hello-world
>>>>         <https://github.com/vinayagg/nodejs-hello-world>>
>>>>                                                         First it took me
>>>>         time to
>>>>                                                         understand that
>>>>         port has
>>>>                                                         to be 8080 for
>>>>         it to run.
>>>>                                                         Now I am able to
>>>>         run it
>>>>                                                         in openshift
>>>> using
>>>>                                                         Node:latest S2I
>>>>         image,
>>>>                                                         the status shows
>>>>                                                         running, however
>>>>         when I
>>>>                                                         try to access
>>>>         the route,
>>>>                                                         I get following
>>>>         error:
>>>>
>>>>                                                         503 Service
>>>>         Unavailable
>>>>                                                         No server is
>>>>         available
>>>>                                                         to handle this
>>>>         request.
>>>>
>>>>                                                         The logs show
>>>>         that the
>>>>                                                         container is
>>>> running
>>>>                                                         successfully.
>>>>         Here is a
>>>>                                                         snipped of logs
>>>>                                                         Launching via
>>>> npm...
>>>>                                                         npm info it
>>>>         worked if it
>>>>                                                         ends with ok
>>>>                                                         npm info using
>>>>         npm@2.15.1
>>>>                                                         npm info using
>>>>         node@v4.4.2
>>>>                                                         npm info
>>>> prestart
>>>>
>>>> node-example@0.0.1
>>>>                                                         npm info start
>>>>
>>>> node-example@0.0.1
>>>>                                                         >
>>>>         node-example@0.0.1 start /opt/app-root/src
>>>>                                                         > node server.js
>>>>                                                         Server running
>>>> at
>>>>
>>>>         http://127.0.0.1:8080/
>>>>
>>>>                                                         What am I doing
>>>>         wrong here?
>>>>
>>>>
>>>>                                                     ​what does oc get
>>>>         pods show?
>>>>
>>>>                                                     if you run oc get
>>>>         svc, are
>>>>                                                     you able to access
>>>> the
>>>>                                                     application via the
>>>>         service ip?
>>>>
>>>>                                                     How did you get the
>>>>         build,
>>>>                                                     application,
>>>>         service, and
>>>>                                                     route defined?
>>>> (via oc
>>>>                                                     new-app, or via a
>>>>         template?)
>>>>                                                     ​
>>>>
>>>>
>>>>
>>>>                                                         3. For java
>>>> image, I
>>>>                                                         forked jboss eap
>>>>         quick
>>>>                                                         starts
>>>> repository
>>>>                                                         at
>>>>         https://github.com/vinayagg/jboss-eap-quickstarts
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts>
>>>>
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts>>
>>>>                                                         It builds
>>>>         successfully
>>>>                                                         with Maven.
>>>>         However when
>>>>                                                         I try to build
>>>>         it with
>>>>                                                         Wildfly S2I, I
>>>> get
>>>>                                                         following error
>>>>         during build
>>>>
>>>>                                                         Downloading
>>>>
>>>>         "https://github.com/vinayagg/jboss-eap-quickstarts.git
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts.git>
>>>>
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts.git
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts.git>>"
>>>>                                                         ...
>>>>                                                         Cloning source
>>>> from
>>>>
>>>>         https://github.com/vinayagg/jboss-eap-quickstarts.git
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts.git>
>>>>
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts.git
>>>>         <https://github.com/vinayagg/jboss-eap-quickstarts.git>>
>>>>                                                         error: build
>>>> error:
>>>>                                                         error: pathspec
>>>>         'master'
>>>>                                                         did not match
>>>> any
>>>>                                                         file(s) known to
>>>>         git.
>>>>
>>>>
>>>>                                                     ​your repo (and
>>>>         perhaps the
>>>>                                                     repo you forked)
>>>> has no
>>>>                                                     "master" branch,
>>>>         which is
>>>>                                                     the default branch
>>>>         we try to
>>>>                                                     check out and
>>>>         build.  you'll
>>>>                                                     need to specify a
>>>>         specific
>>>>                                                     (valid) branch to
>>>>         build, see
>>>>                                                     the "ref" field
>>>>         example here:
>>>>
>>>>         https://docs.openshift.org/latest/dev_guide/builds.html#sour
>>>> ce-code
>>>>         <https://docs.openshift.org/latest/dev_guide/builds.html#sou
>>>> rce-code>
>>>>
>>>>         <https://docs.openshift.org/latest/dev_guide/builds.html#sou
>>>> rce-code
>>>>         <https://docs.openshift.org/latest/dev_guide/builds.html#sou
>>>> rce-code>>
>>>>
>>>>                                                     for example here is
>>>> a
>>>>                                                     template that uses
>>>> that
>>>>                                                     repository, notice
>>>> it
>>>>                                                     specifies both a
>>>>         valid ref,
>>>>                                                     and a valid context
>>>>                                                     directory within
>>>>         that repo:
>>>>
>>>>         https://github.com/jboss-openshift/application-templates/blo
>>>> b/master/eap/eap64-basic-s2i.json#L170
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L170>
>>>>
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L170
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L170>>
>>>>
>>>>         https://github.com/jboss-openshift/application-templates/blo
>>>> b/master/eap/eap64-basic-s2i.json#L172
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L172>
>>>>
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L172
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L172>>
>>>>
>>>>
>>>>         https://github.com/jboss-openshift/application-templates/blo
>>>> b/master/eap/eap64-basic-s2i.json#L37-L40
>>>>         <https://github.com/jboss-openshift/application-templates/bl
>>>> ob/master/eap/eap64-basic-s2i.json#L37-L40>
>>>
>>>
>>
>>
>> --
>> Ben Parees | OpenShift
>>
>>
>


-- 
Ben Parees | OpenShift
_______________________________________________
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to