-
Notifications
You must be signed in to change notification settings - Fork 390
T6686: adds container health checks #4702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: current
Are you sure you want to change the base?
Conversation
All contributors have signed the CLA ✍️ ✅ |
👍 |
I have read the CLA Document and I hereby sign the CLA |
0baafcf
to
ec5e1e3
Compare
@c-po @sever-sever This would be ready for a review |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@nvollmar rebase please and fix conflicts
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
@sever-sever rebased |
CI cannot build the packet
Could you rebase, please? |
1c4dc01
to
48df805
Compare
mac_address = f'--mac-address {gen_mac(name, addr_info, host_ident)}' | ||
|
||
return f'{container_base_cmd} --no-healthcheck --net {networks} {ip_param} {mac_address} {entrypoint} {image} {command} {command_arguments}'.strip() | ||
return f'{container_base_cmd} {healthcheck} --net {networks} {ip_param} {mac_address} {entrypoint} {image} {command} {command_arguments}'.strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default behaviour is changed,
If we do not have any health-check
option, we used --no-healthcheck
, but now it will be ''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is, the --no-healthcheck
was only added when using container networking, when host networking was used (see line 491) it wasn't.
So far I never encountered a container which defined health checks in the image by itself. I'd argue changing the default behaviour here to make it consistent regardless of which networking is used would be preferable.
CI integration ❌ failed! Details
|
<leafNode name="disable"> | ||
<properties> | ||
<help>Disable health check if container has one defined</help> | ||
<valueless/> | ||
</properties> | ||
</leafNode> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<leafNode name="disable"> | |
<properties> | |
<help>Disable health check if container has one defined</help> | |
<valueless/> | |
</properties> | |
</leafNode> | |
#include <include/generic-disable-node.xml.i> |
We have a generic XML building block for the disable CLI option.
<properties> | ||
<help>Interval for the health checks</help> | ||
<completionHelp> | ||
<list>disable</list> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An interval that is not defined on the CLI should count as disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The situation is a bit more complex. Container can define health checks including intervals etc. Podman by default will run them as defined by the image.
So all the config options here are overrides if the image defines them already. And the disable option is there to explicitly also disable pre-defined health checks.
<description>Run health checks manually</description> | ||
</valueHelp> | ||
<valueHelp> | ||
<format><time><suffix></format> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of multiple units. Is there a real reason to run a health-check only once an hour? We should use a seconds base - meaning a value of 3600 would be once an hour.
<description>Duration with time suffix (ms, s, m, h)</description> | ||
</valueHelp> | ||
<constraint> | ||
<regex>^(?:\d+(?:\.\d+)?(?:ms|s|m|h))+$</regex> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to seconds only. We should not make the CLI overly complex. Base units are fine.
</leafNode> | ||
<leafNode name="retries"> | ||
<properties> | ||
<help>The number of retries before container is consider unhealthy</help> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<help>The number of retries before container is consider unhealthy</help> | |
<help>Number of retries before container is consider unhealthy</help> | |
<valueHelp> | |
<format>u32:1-255</format> | |
<description>Update interval in minutes</description> | |
</valueHelp> |
Please add a <valueHelp>
definition for the retry cound and allowed range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A value of 0 should be explicitly stated as "no retry"
Change summary
Adds config options for container health checks
Types of changes
Related Task(s)
https://vyos.dev/T6686
Related PR(s)
How to test / Smoketest result
Checklist: