Share via


LifecycleV1.PreStop Property

Definition

Gets or sets the pre-stop hook for defining actions to execute before the container stops.

[YamlDotNet.Serialization.YamlMember(Alias="preStop")]
public Aspire.Hosting.Kubernetes.Resources.LifecycleHandlerV1 PreStop { get; set; }
[<YamlDotNet.Serialization.YamlMember(Alias="preStop")>]
member this.PreStop : Aspire.Hosting.Kubernetes.Resources.LifecycleHandlerV1 with get, set
Public Property PreStop As LifecycleHandlerV1

Property Value

Attributes
YamlDotNet.Serialization.YamlMemberAttribute

Remarks

The PreStop property is used to specify a lifecycle hook that is triggered immediately before the container is terminated. It allows various actions, such as executing a command, sleeping for a certain duration, making an HTTP GET request, or connecting to a TCP socket. This provides a mechanism to perform necessary clean-up tasks or ensure graceful shutdown of the container before it is stopped by the orchestration system.

Applies to