Lifecycle
Appears in
Section titled “Appears in”.Values.workload.$name.podSpec.containers.$name
lifecycle
Section titled “lifecycle”Define lifecycle for the container
| Key | workload.$name.podSpec.containers.$name.lifecycle |
| Type | map |
| Required | ❌ |
Helm tpl | ❌ |
| Default | {} |
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: {}lifecycle.preStop
Section titled “lifecycle.preStop”Define preStop lifecycle
| Key | workload.$name.podSpec.containers.$name.lifecycle.preStop |
| Type | map |
| Required | ❌ |
Helm tpl | ❌ |
| Default | {} |
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: preStop: {}lifecycle.postStart
Section titled “lifecycle.postStart”Define preStop lifecycle
| Key | workload.$name.podSpec.containers.$name.lifecycle.postStart |
| Type | map |
| Required | ❌ |
Helm tpl | ❌ |
| Default | {} |
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: postStart: {}lifecycle.$hook.type
Section titled “lifecycle.$hook.type”Define hook type
| Key | workload.$name.podSpec.containers.$name.lifecycle.$hook.type |
| Type | string |
| Required | ❌ |
Helm tpl | ❌ |
| Default | "" |
Valid Values:
exechttphttps
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: preStop: type: execlifecycle.$hook.command
Section titled “lifecycle.$hook.command”Define command(s)
See Command for more information.
lifecycle.$hook.port
Section titled “lifecycle.$hook.port”Define the port
| Key | workload.$name.podSpec.containers.$name.lifecycle.$hook.port |
| Type | int |
| Required | ✅ |
Helm tpl | ✅ |
| Default | "" |
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: postStart: type: http port: 8080lifecycle.$hook.host
Section titled “lifecycle.$hook.host”Define the host
| Key | workload.$name.podSpec.containers.$name.lifecycle.$hook.host |
| Type | string |
| Required | ❌ |
Helm tpl | ✅ |
| Default | "" |
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: postStart: type: http port: 8080 host: localhostlifecycle.$hook.path
Section titled “lifecycle.$hook.path”Define the path
| Key | workload.$name.podSpec.containers.$name.lifecycle.$hook.path |
| Type | string |
| Required | ❌ |
Helm tpl | ✅ |
| Default | "/" |
Example
workload: workload-name: podSpec: containers: container-name: lifecycle: postStart: type: http port: 8080 host: localhost path: /pathlifecycle.$hook.httpHeaders
Section titled “lifecycle.$hook.httpHeaders”Define the httpHeaders
| Key | workload.$name.podSpec.containers.$name.lifecycle.$hook.httpHeaders |
| Type | map |
| 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: valueFull Examples
Section titled “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