Skip to content
Docs Try Aspire

ServiceSpecV1 Properties

Class Properties 20 members
Defines the specification for a Kubernetes Service resource.
AllocateLoadBalancerNodePorts Section titled AllocateLoadBalancerNodePorts nullable bool?
Indicates whether node ports should be automatically allocated for a service of type LoadBalancer.
public bool? AllocateLoadBalancerNodePorts { get; set; }
When set to true, this property ensures that node ports are allocated for the load balancer service, enabling external access through specific ports. This setting is optional and can be used based on service configuration requirements.
ClusterIp Section titled ClusterIp nullable string?
Specifies the IP address assigned to the Kubernetes Service within the cluster.
public string? ClusterIp { get; set; }
The ClusterIP is used internally within the Kubernetes cluster to allow services to communicate with each other. If set to "None", the service will not be assigned a ClusterIP and will act as a headless service, suitable for direct pod communication. This property may be null when the cluster IP is not explicitly specified.
ClusterIPs Section titled ClusterIPs List<string>
Represents a list of cluster IP addresses assigned to the Kubernetes Service.
public List<string> ClusterIPs { get; }
The property is used to define multiple IP addresses for the Service, enabling support for more than one IP family. Commonly used in dual-stack networking configurations where both IPv4 and IPv6 IP addresses are specified. The property is immutable after creation and is managed by the Kubernetes system.
ExternalIPs Section titled ExternalIPs List<string>
Represents a list of external IP addresses associated with the service.
public List<string> ExternalIPs { get; }
ExternalIPs specifies additional IP addresses for the service that are externally visible. These IP addresses are usually outside the cluster and can be used to route traffic to the service.
ExternalName Section titled ExternalName nullable string?
Specifies the external DNS name for the Kubernetes Service associated with a ServiceSpecV1.
public string? ExternalName { get; set; }
This property is used with the "ExternalName" service type in Kubernetes to map a service to an external DNS name rather than an IP or other resources within the cluster.
ExternalTrafficPolicy Section titled ExternalTrafficPolicy nullable string?
Specifies how external traffic is routed to the Service's underlying network endpoints.
public string? ExternalTrafficPolicy { get; set; }
The property is used to define whether external traffic routed to the Service should preserve the client source IP address or be routed directly. Acceptable values include: - "Cluster": Traffic is routed via the cluster network and source IP addresses are not preserved. - "Local": Traffic is routed directly to the Service endpoints and source IP addresses are preserved. This setting is particularly useful for load balancing scenarios and for complying with specific application requirements where source IP preservation is a priority.
HealthCheckNodePort Section titled HealthCheckNodePort nullable int?
Gets or sets the health check node port for the Kubernetes Service.
public int? HealthCheckNodePort { get; set; }
This property specifies the port number that is used for health checks when the external traffic policy is set to "Local". If not specified, the system will automatically allocate a node port.
InternalTrafficPolicy Section titled InternalTrafficPolicy nullable string?
Gets or sets the internal traffic policy for the Kubernetes Service.
public string? InternalTrafficPolicy { get; set; }
This property defines the policy dictating how traffic is routed internally within the cluster. It can be used to configure traffic routing behavior for services with internal communication within the cluster.
IpFamilies Section titled IpFamilies List<string>
A list of IP families (e.g., IPv4, IPv6) used by the Kubernetes Service.
public List<string> IpFamilies { get; }
Specifies the IP address families the Service supports or is associated with. The order of families in the list can influence the assignment of IP addresses when the Service is created or updated. This is relevant when defining dual-stack services or specific network configurations requiring certain IP families.
IpFamilyPolicy Section titled IpFamilyPolicy nullable string?
Defines the IP family policy for a Kubernetes Service in API version V1.
public string? IpFamilyPolicy { get; set; }
This property determines the policy under which IP families (IPv4, IPv6) are assigned to the Service. It can control whether the Service prefers or requires a specific IP family or supports both.
LoadBalancerClass Section titled LoadBalancerClass nullable string?
Specifies the class of the load balancer to be used for the service.
public string? LoadBalancerClass { get; set; }
This property allows the user to define a specific load balancer implementation or configuration class for the service. It is especially useful in environments where multiple load balancer options are available, enabling customization based on requirements or provider specifications. When set, this value is used to select the corresponding load balancer class during service creation.
LoadBalancerIp Section titled LoadBalancerIp nullable string?
Gets or sets the IP address to assign to the external LoadBalancer of the Service.
public string? LoadBalancerIp { get; set; }
If specified, this explicitly sets the LoadBalancer's IP address. This property is used when deploying a Service with type set to "LoadBalancer" in Kubernetes. The actual usage of this field depends on the cloud provider or environment where the Kubernetes cluster is hosted. If not set, the IP address will be dynamically assigned by the environment.
LoadBalancerSourceRanges Section titled LoadBalancerSourceRanges List<string>
Specifies a list of IP address ranges that are allowed to access the Kubernetes Service when the Service type is "LoadBalancer".
public List<string> LoadBalancerSourceRanges { get; }
The LoadBalancerSourceRanges property defines a list of CIDR (Classless Inter-Domain Routing) ranges that restrict access to the Service's load balancer. If not set, access is not restricted based on IP ranges and is determined by the cloud provider or default behavior.
Represents the collection of port configurations for a Kubernetes Service.
public List<ServicePortV1> Ports { get; }
This property defines the list of ports through which the service can be accessed. Each port is configured using the ServicePortV1 class, specifying details such as the port number, protocol, target port, and node port. It is key in exposing and routing traffic to the appropriate underlying workloads.
PublishNotReadyAddresses Section titled PublishNotReadyAddresses nullable bool?
Gets or sets a value indicating whether to publish the addresses of not-ready pods for a Kubernetes Service.
public bool? PublishNotReadyAddresses { get; set; }
When set to true, the Service will publish the IP addresses of pods even if the pods are not ready. This can be useful when a Service needs to route traffic to pods during their initialization phase or when readiness probes are not strictly necessary.
Selector Section titled Selector Dictionary<string, string>
Represents the selector field in the Kubernetes Service specification.
public Dictionary<string, string> Selector { get; set; }
The selector is a key-value pair dictionary used to identify a set of pods that the Service targets. The Service routes traffic to these pods based on the selector definition.
SessionAffinity Section titled SessionAffinity nullable string?
Defines the session affinity setting for a Kubernetes Service in API version V1.
public string? SessionAffinity { get; set; }
Session affinity determines how traffic is routed to a service. It helps in maintaining connections from the same client to the same pod, enabling stateful communication and enhancing user experience for applications requiring persistent sessions.
Represents the session affinity configuration for a Kubernetes Service.
public SessionAffinityConfigV1? SessionAffinityConfig { get; set; }
This property specifies the configuration details of session affinity, which ensures that requests from a client are directed to the same backend pod. This is typically used for stateful applications requiring client-based stickiness.
TrafficDistribution Section titled TrafficDistribution nullable string?
Specifies the traffic distribution policy for the Kubernetes Service.
public string? TrafficDistribution { get; set; }
This property defines how network traffic is distributed across the service's associated pods or endpoints. It determines the mechanism or strategy used for traffic routing, which could include methods such as load-balancing or specific traffic shaping configurations.
Gets or sets the type of the Kubernetes Service.
public string Type { get; set; }
Specifies the type of Service to be created. Common types include: "ClusterIP", "NodePort", "LoadBalancer", and "ExternalName". Defaults to "ClusterIP" if not specified.