# LifecycleHandlerV1

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/LifecycleHandlerV1.cs)

Represents a handler for Kubernetes lifecycle events.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Resources;

public sealed class LifecycleHandlerV1
{
    // ...
}
```

## Remarks

A LifecycleHandlerV1 defines actions to be executed as part of the Kubernetes Pod lifecycle, such as pre-stop and post-start events. It supports multiple action types, including executing a command, sleeping for a duration, making HTTP GET requests, or establishing TCP socket connections.

## Constructors

- [LifecycleHandlerV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1/constructors.md#constructor)

## Properties

- [Exec](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1/properties.md#exec) : [ExecActionV1](/reference/api/csharp/aspire.hosting.kubernetes/execactionv1.md) `get; set` -- Represents an action that executes a command within a container.
- [HttpGet](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1/properties.md#httpget) : [HttpGetActionV1](/reference/api/csharp/aspire.hosting.kubernetes/httpgetactionv1.md) `get; set` -- Represents the HTTP GET action associated with a lifecycle handler in Kubernetes resources.
- [Sleep](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1/properties.md#sleep) : [SleepActionV1](/reference/api/csharp/aspire.hosting.kubernetes/sleepactionv1.md) `get; set` -- Gets or sets a sleep action configuration for a lifecycle handler.
- [TcpSocket](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1/properties.md#tcpsocket) : [TcpSocketActionV1](/reference/api/csharp/aspire.hosting.kubernetes/tcpsocketactionv1.md) `get; set` -- Gets or sets the TcpSocketActionV1 property.
