Skip to content

Lifecycle

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

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: {}

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: {}

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: {}

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

Define command(s)

See Command for more information.


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

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

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

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

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