# Service

- 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/ServiceV1.cs)
- Inherits: [BaseKubernetesResource](/reference/api/csharp/aspire.hosting.kubernetes/basekubernetesresource.md)

Represents a Kubernetes Service resource in the v1 API version.

## Definition

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

public sealed class Service
    : Aspire.Hosting.Kubernetes.Resources.BaseKubernetesResource
{
    // ...
}
```

## Remarks

The Service class is used to define and configure networking Services within a Kubernetes cluster. It inherits common Kubernetes resource attributes from the BaseKubernetesResource class and provides additional specific configurations through its Spec property, which describes the desired behavior of the Service.

## Constructors

- [Service](/reference/api/csharp/aspire.hosting.kubernetes/service/constructors.md#constructor) -- Represents a Kubernetes Service resource in the v1 API version.

## Properties

- [Spec](/reference/api/csharp/aspire.hosting.kubernetes/service/properties.md#spec) : [ServiceSpecV1](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1.md) `get; set` -- Represents the specification of the Kubernetes Service resource.
