# LifecycleV1 Properties

- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Type: [LifecycleV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclev1.md)
- Kind: `Properties`
- Members: `2`

Represents the lifecycle configuration for a Kubernetes Pod container.

## PostStart

- Name: `PostStart`
- Modifiers: `get; set`
- Returns: [LifecycleHandlerV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/LifecycleV1.cs)

Represents the post-start lifecycle event handler in a Kubernetes Pod.

```csharp
public LifecycleHandlerV1 PostStart { get; set; }
```

## Remarks

The `PostStart` property defines actions to be executed immediately after a container is started. Actions can include executing a custom command, performing an HTTP GET request, establishing a TCP connection, or introducing a sleep duration before additional operations. It is used to customize and control the behavior of a container upon startup.

## PreStop

- Name: `PreStop`
- Modifiers: `get; set`
- Returns: [LifecycleHandlerV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/LifecycleV1.cs)

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

```csharp
public LifecycleHandlerV1 PreStop { get; set; }
```

## 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.
