1

I would like to know if it is recommended to use that image in production environment. Or should I install Openshift Natively?

If I can use the docker image in production how should I upgrade it when a new version of image is released? I know I lose all configuration and application definition when starting a new docker container. Is there a way to keep them? Mapping volumes? Which volumes should be mapped?

The command line I am using is: $ sudo docker run -d --name "origin" \ --privileged --pid=host --net=host \ -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys -v /var/lib/docker:/var/lib/docker:rw \ -v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \ openshift/origin start

PS. There is a relative question I asked yesterday but not focusing on the same problem.

Update on 20/01/2016

I have tried @Clayton's suggestion of mapping folder /var/lib/origin which worked well before 17th Jan 2016. Then I started getting Failed to mount issue when deploying router and some other applications. When I change it back to mapping /var/lib/origin/openshift.local.volumes, it seems OK until now.

Community
  • 1
  • 1
Devs love ZenUML
  • 11,344
  • 8
  • 53
  • 67

1 Answers1

2

If you have the /var/lib/origin directory mounted, when your container reboots you will still have all your application data. That would be the recommended way to run in a container.

Clayton
  • 3,281
  • 1
  • 18
  • 14
  • Hi @Clayton, I have updated the command line to match official tutorial so that it is more useful/applicable to others who may have similar question. Hopefully, your answer still applies. If it is the case, I will accept this as the answer. I am asking only because `/var/lib/origin/openshift.local.volumes` is already mapped. – Devs love ZenUML Jan 12 '16 at 06:25
  • Just a further question, do you know why `-v /var/lib/docker:/var/lib/docker:rw` in the official tutorial? Docker cannot run inside container by only doing this in the latest version. – Devs love ZenUML Jan 12 '16 at 06:28
  • @Clayton could you go into the first part of the question please? I imagined installing using the 'advanced' method (red.ht/1l58sMF) is the proper way for production use. What are the downsides to using the all-in-one approach. – dbalakirev Jan 13 '16 at 07:30
  • 1
    The ansible installer is currently our recommended way to install production OpenShift. That currently has a mode for running in containers, but I don't believe yet has been tested against the 1.1 Origin images. The regular path depends on RPMs which run as systemd services on the machines. – Clayton Jan 16 '16 at 15:54
  • @Clayton when I follow your instruction (mapping the /var/lib/origin folder), it runs well. But when I enabled `--loglevel=5`, I have got `docker.go:368] Docker Container: /origin-448-log5 is not managed by kubelet.`. `origin-448-log5` is the container of a newer version. Is this normal? – Devs love ZenUML Jan 19 '16 at 00:09
  • I think it is normal after investigation. I have rerun it with cleaned `/var/lib/origin` and got the same log information. – Devs love ZenUML Jan 19 '16 at 00:30
  • @Clayton, it looks like the ansible installer requires REDHAT OS. Can it be used on SUSE Enterprise 12? – Devs love ZenUML Jan 19 '16 at 06:30
  • It has not been tested with SUSE to my knowledge. – Clayton Feb 06 '16 at 16:40