# ServiceSpecV1

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

Defines the specification for a Kubernetes Service resource.

## Definition

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

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

## Remarks

This class represents various attributes that define the behavior and configuration of a Kubernetes Service, such as type, IP addresses, load balancer settings, traffic policies, selectors, ports, and session affinity options.

## Constructors

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

## Properties

- [AllocateLoadBalancerNodePorts](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#allocateloadbalancernodeports) : `bool?` `get; set` -- Indicates whether node ports should be automatically allocated for a service of type LoadBalancer.
- [ClusterIp](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#clusterip) : `string?` `get; set` -- Specifies the IP address assigned to the Kubernetes Service within the cluster.
- [ClusterIPs](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#clusterips) : `List<string>` `get` -- Represents a list of cluster IP addresses assigned to the Kubernetes Service.
- [ExternalIPs](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#externalips) : `List<string>` `get` -- Represents a list of external IP addresses associated with the service.
- [ExternalName](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#externalname) : `string?` `get; set` -- Specifies the external DNS name for the Kubernetes Service associated with a ServiceSpecV1.
- [ExternalTrafficPolicy](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#externaltrafficpolicy) : `string?` `get; set` -- Specifies how external traffic is routed to the Service's underlying network endpoints.
- [HealthCheckNodePort](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#healthchecknodeport) : `int?` `get; set` -- Gets or sets the health check node port for the Kubernetes Service.
- [InternalTrafficPolicy](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#internaltrafficpolicy) : `string?` `get; set` -- Gets or sets the internal traffic policy for the Kubernetes Service.
- [IpFamilies](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#ipfamilies) : `List<string>` `get` -- A list of IP families (e.g., IPv4, IPv6) used by the Kubernetes Service.
- [IpFamilyPolicy](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#ipfamilypolicy) : `string?` `get; set` -- Defines the IP family policy for a Kubernetes Service in API version V1.
- [LoadBalancerClass](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#loadbalancerclass) : `string?` `get; set` -- Specifies the class of the load balancer to be used for the service.
- [LoadBalancerIp](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#loadbalancerip) : `string?` `get; set` -- Gets or sets the IP address to assign to the external LoadBalancer of the Service.
- [LoadBalancerSourceRanges](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#loadbalancersourceranges) : `List<string>` `get` -- Specifies a list of IP address ranges that are allowed to access the Kubernetes Service when the Service type is "LoadBalancer".
- [Ports](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#ports) : [List<ServicePortV1>](/reference/api/csharp/aspire.hosting.kubernetes/serviceportv1.md) `get` -- Represents the collection of port configurations for a Kubernetes Service.
- [PublishNotReadyAddresses](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#publishnotreadyaddresses) : `bool?` `get; set` -- Gets or sets a value indicating whether to publish the addresses of not-ready pods for a Kubernetes Service.
- [Selector](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#selector) : `Dictionary<string, string>` `get; set` -- Represents the selector field in the Kubernetes Service specification.
- [SessionAffinity](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#sessionaffinity) : `string?` `get; set` -- Defines the session affinity setting for a Kubernetes Service in API version V1.
- [SessionAffinityConfig](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#sessionaffinityconfig) : [SessionAffinityConfigV1?](/reference/api/csharp/aspire.hosting.kubernetes/sessionaffinityconfigv1.md) `get; set` -- Represents the session affinity configuration for a Kubernetes Service.
- [TrafficDistribution](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#trafficdistribution) : `string?` `get; set` -- Specifies the traffic distribution policy for the Kubernetes Service.
- [Type](/reference/api/csharp/aspire.hosting.kubernetes/servicespecv1/properties.md#type) : `string` `get; set` -- Gets or sets the type of the Kubernetes Service.
