Skip to content

Lifecycle

Appears in

  • .Values.workload.$name.podSpec.containers.$name

lifecycle

Define lifecycle for the container

Keyworkload.$name.podSpec.containers.$name.lifecycle
Typemap
Required
Helm tpl
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle: {}

lifecycle.preStop

Define preStop lifecycle

Keyworkload.$name.podSpec.containers.$name.lifecycle.preStop
Typemap
Required
Helm tpl
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
preStop: {}

lifecycle.postStart

Define preStop lifecycle

Keyworkload.$name.podSpec.containers.$name.lifecycle.postStart
Typemap
Required
Helm tpl
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
postStart: {}

lifecycle.$hook.type

Define hook type

Keyworkload.$name.podSpec.containers.$name.lifecycle.$hook.type
Typestring
Required
Helm tpl
Default""

Valid Values:

  • exec
  • http
  • https

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
preStop:
type: exec

lifecycle.$hook.command

Define command(s)

See Command for more information.


lifecycle.$hook.port

Define the port

Keyworkload.$name.podSpec.containers.$name.lifecycle.$hook.port
Typeint
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
postStart:
type: http
port: 8080

lifecycle.$hook.host

Define the host

Keyworkload.$name.podSpec.containers.$name.lifecycle.$hook.host
Typestring
Required
Helm tpl
Default""

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
postStart:
type: http
port: 8080
host: localhost

lifecycle.$hook.path

Define the path

Keyworkload.$name.podSpec.containers.$name.lifecycle.$hook.path
Typestring
Required
Helm tpl
Default"/"

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
postStart:
type: http
port: 8080
host: localhost
path: /path

lifecycle.$hook.httpHeaders

Define the httpHeaders

Keyworkload.$name.podSpec.containers.$name.lifecycle.$hook.httpHeaders
Typemap
Required
Helm tpl✅ (On value only)
Default{}

Example

workload:
workload-name:
podSpec:
containers:
container-name:
lifecycle:
postStart:
type: http
port: 8080
host: localhost
path: /path
httpHeaders:
key: value

Full Examples

workload:
workload-name:
enabled: true
primary: true
podSpec:
containers:
container-name:
enabled: true
primary: true
lifecycle:
preStop:
type: exec
command:
- command
postStart:
type: http
port: 8080
host: localhost
path: /path
httpHeaders:
key: value