-
Notifications
You must be signed in to change notification settings - Fork 729
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. A new class sinsp_container_info::container_health_probe represents one of these health probes. It has a probe type (healthcheck/liveness/readiness), methods to parse the actual executable/arguments/etc out of the container json and methods to add the json back to a larger json object. The container info now has a list of possible health probe objects and iterates over them when dumping the container to json. 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,readiness}_probe checks for k8s liveness/readiness probes, and container.{liveness,readiness}_probe prints the exe + args.
- Loading branch information
Showing
10 changed files
with
421 additions
and
99 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
Oops, something went wrong.