Package org.cdk8s.plus23.k8s
Class Lifecycle.Builder
- java.lang.Object
-
- org.cdk8s.plus23.k8s.Lifecycle.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Lifecycle
build()
Builds the configured instance.Lifecycle.Builder
postStart(LifecycleHandler postStart)
Sets the value ofLifecycle.getPostStart()
Lifecycle.Builder
preStop(LifecycleHandler preStop)
Sets the value ofLifecycle.getPreStop()
-
-
-
Method Detail
-
postStart
@Stability(Stable) public Lifecycle.Builder postStart(LifecycleHandler postStart)
Sets the value ofLifecycle.getPostStart()
- Parameters:
postStart
- PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks- Returns:
this
-
preStop
@Stability(Stable) public Lifecycle.Builder preStop(LifecycleHandler preStop)
Sets the value ofLifecycle.getPreStop()
- Parameters:
preStop
- PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod's termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks- Returns:
this
-
build
@Stability(Stable) public Lifecycle build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<Lifecycle>
- Returns:
- a new instance of
Lifecycle
- Throws:
NullPointerException
- if any required attribute was not provided
-
-