ServiceSpecV1 Properties
Class Properties 20 members
Defines the specification for a Kubernetes Service resource.
Indicates whether node ports should be automatically allocated for a service of type LoadBalancer.
public bool? AllocateLoadBalancerNodePorts { get; set; }Remarks
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.
Specifies the IP address assigned to the Kubernetes Service within the cluster.
public string? ClusterIp { get; set; }Remarks
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.
Represents a list of cluster IP addresses assigned to the Kubernetes Service.
public List<string> ClusterIPs { get; }Remarks
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.
Represents a list of external IP addresses associated with the service.
public List<string> ExternalIPs { get; }Remarks
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.
Specifies the external DNS name for the Kubernetes Service associated with a ServiceSpecV1.
public string? ExternalName { get; set; }Remarks
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.
Specifies how external traffic is routed to the Service's underlying network endpoints.
public string? ExternalTrafficPolicy { get; set; }Remarks
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.
Gets or sets the health check node port for the Kubernetes Service.
public int? HealthCheckNodePort { get; set; }Remarks
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.
Gets or sets the internal traffic policy for the Kubernetes Service.
public string? InternalTrafficPolicy { get; set; }Remarks
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.
A list of IP families (e.g., IPv4, IPv6) used by the Kubernetes Service.
public List<string> IpFamilies { get; }Remarks
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.
Defines the IP family policy for a Kubernetes Service in API version V1.
public string? IpFamilyPolicy { get; set; }Remarks
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.
Specifies the class of the load balancer to be used for the service.
public string? LoadBalancerClass { get; set; }Remarks
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.
Gets or sets the IP address to assign to the external LoadBalancer of the Service.
public string? LoadBalancerIp { get; set; }Remarks
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.
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; }Remarks
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; }Remarks
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. Gets or sets a value indicating whether to publish the addresses of not-ready pods for a Kubernetes Service.
public bool? PublishNotReadyAddresses { get; set; }Remarks
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.
Represents the selector field in the Kubernetes Service specification.
public Dictionary<string, string> Selector { get; set; }Remarks
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.
Defines the session affinity setting for a Kubernetes Service in API version V1.
public string? SessionAffinity { get; set; }Remarks
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; }Remarks
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.
Specifies the traffic distribution policy for the Kubernetes Service.
public string? TrafficDistribution { get; set; }Remarks
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; }Remarks
Specifies the type of Service to be created. Common types include: "ClusterIP", "NodePort", "LoadBalancer", and "ExternalName". Defaults to "ClusterIP" if not specified.