# LifecycleV1

- 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/LifecycleV1.cs)

Represents the lifecycle configuration for a Kubernetes Pod container.

## Definition

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

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

## Remarks

The [LifecycleV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclev1.md) class defines the lifecycle events for a container, which include hooks or actions that can be triggered at specific points during the container's lifecycle. It allows specifying custom logic to be executed either before the container is terminated (preStop) or after the container is started (postStart). This configuration is particularly useful for managing cleanup operations, initialization tasks, or other custom behaviors during these lifecycle phases.

## Constructors

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

## Properties

- [PostStart](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclev1/properties.md#poststart) : [LifecycleHandlerV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1.md) `get; set` -- Represents the post-start lifecycle event handler in a Kubernetes Pod.
- [PreStop](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclev1/properties.md#prestop) : [LifecycleHandlerV1](/reference/api/csharp/aspire.hosting.kubernetes/lifecyclehandlerv1.md) `get; set` -- Gets or sets the pre-stop hook for defining actions to execute before the container stops.
