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

Re: [atomic-devel] recommended way of running a container



On Thu, 2019-05-02 at 16:12 +0200, Farkas Levente wrote:
> Hi,
> I'm just read the blog about healthchecks:
> 
> https://developers.redhat.com/blog/2019/04/18/monitoring-container-vitality-and-availability-with-podman/
> 
> What is the current recommended way of running a container on an
> atomic
> host using podman? Assume I'd not like to use docker.

Let me just say, there is no one way that I am aware of.  And it
depends on the container.  With podman, we have tried to provide the
ability to be flexible for you and the container needs.

> As I understand it now:
> - Create a systemd service file on the host for the container,

I have a PR for podman currently under review to create a systemd unit
file based on a container.  That PR can be seen at -> 
https://github.com/containers/libpod/pull/2985

It will add the command: podman generate systemd <container>

> - Create a systemd service file on the host for the healthcheck,
> - Create a systemd timer  file on the host for the healthcheck.
> 

Just for the record, healthchecks are optional.  The systemd service
and timer files are created automatically for you with podman and are
considered to be transient in nature.  That means if the system is
rebooted, that timer and service are deleted.  If the container is
started again, they are recreated.

> Who should have to restart the container? ie. on the container's
> service
> file what is the Restart line and the Type?
> 
> Is there any recommended template for this?
> 
> Yes I know there are several ways to do it in container systemd, on
> host
> systemd manual healthcheck etc. But IMHO it'd be useful for everybody
> do
> give a recommended way or template which is in your planed future way
> of
The base template can be seen at 
https://github.com/containers/libpod/pull/2985/files#diff-7042841ac7848088f53740b39199fbb9R10
... we are considering the ability to be able to change that base
template for future versions.

> doing so. AFAIS (after read it) RHEL official container docs is a bit
> outdated.
> 
> Thanks in advance.
> 

Hello Farkas,

Lots of questions in your email.  I've tried to answer them inline.


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