[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: starting first container based on centos7 with httpd installed fails

On Fri, Jul 24, 2015 at 7:13 AM, kevin parrikar <kevin parker092 gmail com> wrote:
Thanks Ben,
                       In our vm based setup we configure application after spinning up the vms using orchestration tools ,but with docker i hope to achieve the same while the image is being built.So i will read more about S2i .
Is there any standard for building docker image for running in openshift?? like i tried with my previous setup i used centos7 base image and installed httpd on it and used "oc new-app --docker-image=myrepo/httpd" but it constantly restarted and reached failed state even after changing strategy to "RunAsAny" .Can this be because i used "/etc/bashrc " to start httpd ?? 

there are best practices for docker images in general and openshift images in particular here (covers things like ensuring your image can run as arbitrary user id):

i'm not sure exactly why your image failed, it would be useful to see logs from the container.


On Wed, Jul 22, 2015 at 12:01 AM, Ben Parees <bparees redhat com> wrote:
There are a variety of ways to do what you describe.  Does this configuration have to occur at runtime, or can it occur when the image is being built?

if it can occur while the image is being built, you can use a custom s2i assemble script to control what happens during the image build process.  (assuming you are using a source-to-image build strategy)

if it must occur when the image starts up (you want the configuration to be more dynamic), you could add the configuration logic to the startup script for the image to have it pull down its configuration files.

if you want to be even more dynamic than that and customize the image after it has started, you can use the oc exec operation to perform operations against running containers.

you also might be able to use a post-deployhook:

On Tue, Jul 21, 2015 at 2:08 PM, kevin parrikar <kevin parker092 gmail com> wrote:
Thanks alot Ben this clears most of my doubts related to platform.

I have one last question specific to the application i am planning to manage with openshift.
i will have a base centos image with all the rpm dependencies of application installed.
But for configuring the application it needs to get code from github which i believe its possible.
After the code pull it needs to make configuration changes using the code like copying the code to different directories,editing config file with user provided values etc.In our existing environment we use ansible to do this on openstack instance.
In short is it possible to do some level of orchestration with openshift on docker images??

Thanks again for your help 

On Tue, Jul 21, 2015 at 6:58 PM, Ben Parees <bparees redhat com> wrote:

On Tue, Jul 21, 2015 at 2:32 AM, kevin parrikar <kevin parker092 gmail com> wrote:
Thanks Ben i will try with runAsUser.Type strategy to RunAsAny. Since "docker logs containeri-d" returns nothing. 
before i do further experiments with openshift could you clarify some of my doubts regarding openshift v3.

1.Is there an admin UI where admin can add users without using "htpasswd" to update "/etc/openshift/openshift-passwd" file manually.

There's no web ui way, if there's a CLI way, I defer to david eads (on CC)

2.If i like to create templates similar to the default available templates like mysql/nodejs/cakephp and make it available to all users can i do that.(similar to distro templates in openstack or similar)

yes, just create your template.json and run "oc create -f mynewtemplate.json -n openshift" to install the template into the openshift namespace which all users have visibility into.  (you will need to perform this operation as cluster admin to be able to write into the openshift namespace)

3.In the past i have used openshift online for sometime and there i was able to select Gear with RAM sizing which i dont find it here.(similar to flavors in openstack) 

4. I am not able to find SSH key pair creation in this.

there is none, you can enter your running containers using "oc exec", authentication is handled by openshift rather than via ssh key pairs:

Followed https://docs.openshift.org/latest/admin_guide/install/overview.html to setup my test environment on 2 vms running on KVM.

Ideally PaaS should be simpler than IaaS ,above 4 can be done in openstack and i am still new to openshift.I have worked extensively on openstack and have some knowledge in docker.



On Tue, Jul 21, 2015 at 1:48 AM, Ben Parees <bparees redhat com> wrote:
can you get the logs from the actual container?  (docker logs <containerid>)?

likely you are hitting:

On Mon, Jul 20, 2015 at 4:11 PM, kevin parrikar <kevin parker092 gmail com> wrote:
i have created a container base on  centos 7 with httpd and set to start httpd when containers starts by editing /etc/bashrc with "/usr/sbin/httpd -k start" and committed changes to public repo. 
With  "docker run -tid " i can see httpd process starting when the container starts .But with "oc new-app --docker-image=myrepo/httpd" pod is restarting frequently and fails after many restart

 oc get pods
NAME                  READY     REASON    RESTARTS   AGE
cent7-1-deploy      1/1         Running        0                   6m
cent7-1-f7mg5        0/1        Running        13                6m

failed state:

oc get pods
NAME              READY     REASON         RESTARTS   AGE
cent7-1-deploy    0/1       ExitCode:255   0          13m

oc logs cent7-1-deploy
I0720 19:53:32.866377       1 deployer.go:194] Deploying p1/cent7-1 for the first time (replicas: 1)
I0720 19:53:32.873463       1 recreate.go:112] Scaling p1/cent7-1 to 1 before validating first replica
I0720 19:53:34.932469       1 recreate.go:117] Validating first replica of p1/cent7-1
I0720 19:53:34.940913       1 lifecycle.go:283] Waiting for pod p1/cent7-1-f7mg5 container readiness
F0720 20:03:34.941871       1 deployer.go:63] first replica rejected for cent7-1: timed out waiting for pod p1/cent7-1-f7mg5 containers to become ready

Why is the pod failing to stabilise and how can we see more failure logs.

Thanks for any help.

users mailing list
users lists openshift redhat com

Ben Parees | OpenShift

Ben Parees | OpenShift

Ben Parees | OpenShift

Ben Parees | OpenShift

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]