Skip to content

Probes

Next to labels and resources, adeploy also allows to update liveness, readiness and startup probes on a global or workload scope at a single point in the default or namespace/release configuration.

Global Probes Configuration

Jinja

adeploy introduces the reserved variable __probes that allows to update probes on a global or workload scope.

Warning

adeploy will only update your probe definitions, but it won't add any new probes to your manifest! This feature is thought to define the execution part of the probe in the manifest and set the probe parameters (i.e. timeouts etc.) at a single point in your configuration.

If you want to define also the execution part, you need to add the following minimal probe snippets to your manifest:

templates/deployment.yml
containers:
  - name: main
    image: registry.k8s.io/busybox 
    livenessProbe: {}
    readinesProbe: {}
    startupProbe: {}

Note

You can either use snake casing (í.e. period_seconds) or camel casing as in the official k8s docs (i.e. periodSeconds).

Global Scope

To update probes for all compatible API objects (Deployment, StatefulSet, ReplicaSet, ...) in your deployment, add the following to the defaults.yml or the namespace/release configuration:

defaults.yml
_probes:
  liveness:
    exec:
      command: ["/tmp/health.sh"]
    initial_delay_seconds: 60
    period_seconds: 30
    timeout_seconds: 5
    failure_threshold: 5
    success_threshold: 1

  readiness:
    initial_delay_seconds: 5
    period_seconds: 5
    timeout_seconds: 5
    failure_threshold: 10
    success_threshold: 1

This will update all probes in the generated manifest files and overwrite it with the given values.

Workload Scope

To update the probe definition for a specific workload object queried by its name (i.e. {{ name }}-{{ release }}-redis), add the following:

defaults.yml
_resources:
  {{ name }}-{{ release }}-redis:
    readiness:
      initial_delay_seconds: 10