# ProbeV1 Properties

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

Represents a probe configuration for Kubernetes containers. A probe is used to determine the health and readiness of a container by defining checks that can consist of various actions such as HTTP requests, executing commands, GRPC actions, or assessing TCP socket connectivity.

## Exec

- Name: `Exec`
- Modifiers: `nullable` `get; set`
- Returns: [ExecActionV1?](/reference/api/csharp/aspire.hosting.kubernetes/execactionv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Gets or sets the execution action associated with a probe.

```csharp
public ExecActionV1? Exec { get; set; }
```

## Remarks

Represents a directive to execute a specific command within a container. This can be used to implement actions such as custom health checks or performing tasks during the lifecycle of a container. The execution is defined by an instance of [ExecActionV1](/reference/api/csharp/aspire.hosting.kubernetes/execactionv1.md), which specifies the command to be run.

## FailureThreshold

- Name: `FailureThreshold`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Gets or sets the failure threshold for the probe.

```csharp
public int? FailureThreshold { get; set; }
```

## Remarks

The failure threshold specifies the number of consecutive probe failures that are allowed before the container is considered unhealthy. This value is used to determine when to take action based on the probe's outcome, such as restarting the container or marking it as failed.

## Grpc

- Name: `Grpc`
- Modifiers: `nullable` `get; set`
- Returns: [GrpcActionV1?](/reference/api/csharp/aspire.hosting.kubernetes/grpcactionv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Represents a GRPC-based action within a Kubernetes probe configuration.

```csharp
public GrpcActionV1? Grpc { get; set; }
```

## Remarks

This property defines the GRPC action for health checks in Kubernetes resources. It specifies the target service name and port using a [GrpcActionV1](/reference/api/csharp/aspire.hosting.kubernetes/grpcactionv1.md) instance.

## HttpGet

- Name: `HttpGet`
- Modifiers: `nullable` `get; set`
- Returns: [HttpGetActionV1?](/reference/api/csharp/aspire.hosting.kubernetes/httpgetactionv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Represents a configuration for an HTTP GET request action as part of a Kubernetes probe mechanism.

```csharp
public HttpGetActionV1? HttpGet { get; set; }
```

## Remarks

This property specifies the behavior of an HTTP GET request when used for health checks, event handling, or other similar functionalities within Kubernetes resources. It typically includes the scheme, host, HTTP headers, path, and port necessary to construct the request. The configuration helps determine service or application availability by probing specified endpoints.

## InitialDelaySeconds

- Name: `InitialDelaySeconds`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Specifies the duration in seconds to wait before initiating the probe for the first time.

```csharp
public int? InitialDelaySeconds { get; set; }
```

## Remarks

This property is used to define a delay before the probe starts checking the status of a container. It is especially useful in scenarios where the application in the container requires time to initialize before it can respond to the probe successfully.

## PeriodSeconds

- Name: `PeriodSeconds`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Gets or sets the period in seconds between probe executions.

```csharp
public int? PeriodSeconds { get; set; }
```

## Remarks

The value represents the interval between successive executions of the specified probe, such as HTTP, TCP, or GRPC probing tasks. A lower value increases the frequency of probe checks, while a higher value reduces it. By default, this setting might be aligned with predefined Kubernetes timing configurations.

## SuccessThreshold

- Name: `SuccessThreshold`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Gets or sets the minimum consecutive successes for the probe to be considered successful after it has previously failed.

```csharp
public int? SuccessThreshold { get; set; }
```

## Remarks

The value of this property is used to determine how many successive successful probes are required to declare a previously failed resource as healthy again. This is typically applied in health or readiness probes within Kubernetes. A higher value indicates a stricter threshold for recovery.

## TcpSocket

- Name: `TcpSocket`
- Modifiers: `nullable` `get; set`
- Returns: [TcpSocketActionV1?](/reference/api/csharp/aspire.hosting.kubernetes/tcpsocketactionv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

TcpSocket specifies an action based on a TCP socket connection.

```csharp
public TcpSocketActionV1? TcpSocket { get; set; }
```

## Remarks

Defines a probe action that performs a TCP connection to a specified host and port. It is commonly used in Kubernetes health checks to determine the availability of a service.

## TerminationGracePeriodSeconds

- Name: `TerminationGracePeriodSeconds`
- Modifiers: `nullable` `get; set`
- Returns: `long?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Gets or sets the optional duration in seconds the system will wait for the pod to terminate gracefully after a probe triggers its termination. If the pod does not terminate within this time frame, it may be forcefully killed. A null value indicates that the termination grace period is not explicitly set.

```csharp
public long? TerminationGracePeriodSeconds { get; set; }
```

## TimeoutSeconds

- Name: `TimeoutSeconds`
- Modifiers: `nullable` `get; set`
- Returns: `int?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ProbeV1.cs)

Specifies the number of seconds that a probe will wait for a response before timing out.

```csharp
public int? TimeoutSeconds { get; set; }
```

## Remarks

The `TimeoutSeconds` property defines the maximum duration, in seconds, that the probe will wait for an operation to complete before considering it a failure. A timeout value that is too low may lead to false negatives, whereas a value that is too high may delay failure detection. This property is optional and, if not specified, the default value will be used as defined by the system.
