[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [atomic-devel] recommended way of running a container
- From: Farkas Levente <lfarkas lfarkas org>
- To: Brent Baude <bbaude redhat com>, atomic-devel projectatomic io
- Subject: Re: [atomic-devel] recommended way of running a container
- Date: Tue, 7 May 2019 13:33:13 +0200
On 5/6/19 4:11 PM, Brent Baude wrote:
> On Mon, 2019-05-06 at 13:16 +0200, Farkas Levente wrote:
>> On 5/2/19 9:20 PM, Brent Baude wrote:
>>> On Thu, 2019-05-02 at 16:12 +0200, Farkas Levente wrote:
>>>> - 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.
>>
>> does it means the recommended way to create one systemd service file
>> for
>> the container and in this service the ExecStart's podman should have
>> to
>> be a --healthcheck-command parameter (and may be more) and use the
>> podman generated transient timer or service for healtcheck?
>>
>> and in this case in case of failure who and how will restart the main
>> service?
>>
>
> Farkas,
>
> I'm having trouble understanding your question. The use of systemd to
> control a container and the use of systemd to provide health checks are
> mutually exclusive. You do not need to put anything healthcheck
> related in your systemd file that controls the container.
first of all my biggest problem the lack of documentation. IMHO it's not
the best solution to read blog to get the docs. eg:
https://github.com/containers/libpod/blob/master/docs/podman-run.1.md
which seems to me the latest up-to-date manual said:
--------------------------------------
--healthchech=""
Set or alter a healthcheck for a container. The value must be of
the format of:
[OPTIONS] CMD command
where options can be any of the follow:
* --interval=DURATION (default: 30s)
* --timeout=DURATION (default: 30s)
* --start-period=DURATION (default: 0s)
* --retries=N (default: 3)
--------------------------------------
not to mention the --healthchech typo since it's just a simple typo. and
it seems to copied from docker.
while your blog:
https://developers.redhat.com/blog/2019/04/18/monitoring-container-vitality-and-availability-with-podman/
said
--healthcheck-command which is not in the man
--healthcheck-start-period etc not an option for --healthcheck
so which one is the valid?
while both are a few weeks old still not consistent and can't help.
back to my original question. assume I don't use kubernetes or any other
orchestration and just wanna setup a host (atomic or normal) with a few
predefined containers. starting and running these containers with systemd.
in this case should i add a healthcheck service and timer unit or use
the transient podman generated service and times?
ps. as a side note to a long waiting feature in docker's healthcheck to
be able to restart or exit the container which health status if failed.
even if docker always postpone this request it'd be nice to add to
podman like --all and -l.
--
Levente "Si vis pacem para bellum!"
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]