lifecycle
Schema Lifecycle
Lifecycle describes actions that the management system should take in response
to container lifecycle events.
Attributes
name | type | description | default value |
---|---|---|---|
postStart | The action to be taken after a container is created. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks | ||
preStop | The 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"
}
}