-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start tracking k8s liveness/readiness probes
K8s has a similar but not identical method as docker for container health checks. They are called liveness/readiness probes and are a part of the pod specification, and not a part of the image. Luckily, the pod configuration *is* a part of the container metadata as stringified json, with a label "annotation.kubectl.kubernetes.io/last-applied-configuration", so we can use that label to identify liveness/readiness probes. New method docker::get_k8s_pod_spec() grabs the pod configuration out of the container labels. From there, a docker::parse_liveness_readiness_probe() parses the liveness/readiness json (they have the same format, differing only by property name). The values are saved/loaded in json just as the healthcheck value was saved. Now that we have 3 different ways to run commands as a "health check", make the actual command/args a generic "health probe" property of the container. For threads, switch everything to use a threadinfo category instead of a simple bool for has healthcheck. The possible values for the category are CAT_NONE, CAT_HEALTHCHECK, and CAT_LIVENESS_PROBE. identify_healthcheck becomes identify_category() but otherwise behaves the same (passing categories down and checking the args list otherwise). The filterchecks aren't quite as generic as the threadinfo categories to keep the filtering simple. A new field proc.is_container_liveness_probe checks for k8s liveness probes, and container.liveness_probe prints the exe + args.
- Loading branch information
Showing
11 changed files
with
201 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.