Package org.cdk8s.plus24
Class ContainerLifecycle.Builder
- java.lang.Object
-
- org.cdk8s.plus24.ContainerLifecycle.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ContainerLifecycle>
- Enclosing interface:
- ContainerLifecycle
@Stability(Stable) public static final class ContainerLifecycle.Builder extends Object implements software.amazon.jsii.Builder<ContainerLifecycle>
A builder forContainerLifecycle
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerLifecycle
build()
Builds the configured instance.ContainerLifecycle.Builder
postStart(Handler postStart)
Sets the value ofContainerLifecycle.getPostStart()
ContainerLifecycle.Builder
preStop(Handler preStop)
Sets the value ofContainerLifecycle.getPreStop()
-
-
-
Method Detail
-
postStart
@Stability(Stable) public ContainerLifecycle.Builder postStart(Handler postStart)
Sets the value ofContainerLifecycle.getPostStart()
- Parameters:
postStart
- This hook is executed immediately after a container is created. However, there is no guarantee that the hook will execute before the container ENTRYPOINT.- Returns:
this
-
preStop
@Stability(Stable) public ContainerLifecycle.Builder preStop(Handler preStop)
Sets the value ofContainerLifecycle.getPreStop()
- Parameters:
preStop
- This hook is called immediately before a container is terminated due to an API request or management event such as a liveness/startup probe failure, preemption, resource contention and others. A call to the PreStop hook fails if the container is already in a terminated or completed state and the hook must complete before the TERM signal to stop the container can be sent. The Pod's termination grace period countdown begins before the PreStop hook is executed, so regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. No parameters are passed to the handler.- Returns:
this
-
build
@Stability(Stable) public ContainerLifecycle build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ContainerLifecycle>
- Returns:
- a new instance of
ContainerLifecycle
- Throws:
NullPointerException
- if any required attribute was not provided
-
-