Skip to main content
Version: v0.12

lifecycle

Schema Lifecycle

Lifecycle describes actions that the management system should take in response
to container lifecycle events.

Attributes

nametypedescriptiondefault value
postStartThe action to be taken after a container is created.
More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
preStopThe action to be taken before a container is terminated due to an API request or
management event such as liveness/startup probe failure, preemption, resource contention, etc.
More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

Examples

import kam.workload.container.probe as p
import kam.workload.container.lifecycle as lc

lifecycleHook = lc.Lifecycle {
preStop: p.Exec {
command: ["preStop.sh"]
}
postStart: p.Http {
url: "http://localhost:80"
}
}