Skip to main content

service

Source: base/pkg/kusion_models/kube/frontend/service/service.k

Schema Service

Service are Kubernetes objects which partition a single Kubernetes cluster into multiple virtual clusters.
More info: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/\#Service

Base Schema

@base.pkg.kusion_models.kube.frontend.common.Metadata

Attributes

Name and DescriptionTypeDefault ValueRequired
selector
Route service traffic to pods with label keys and values matching this selector.
More info: https://kubernetes.io/docs/concepts/services-networking/service/
{str: str}Undefinedoptional
ports
The list of ports that are exposed by this service.
More info: https://kubernetes.io/docs/concepts/services-networking/service/\#virtual-ips-and-service-proxies
[v1.ServicePort]Undefinedoptional
clusterIP
clusterIP is the IP address of the service and is usually assigned randomly by the master.
More info: https://kubernetes.io/docs/concepts/services-networking/service/\#virtual-ips-and-service-proxies
strNoneoptional
type
determines how the Service is exposed.
More info: https://kubernetes.io/docs/concepts/services-networking/service/\#publishing-services-service-types
str"ClusterIP"optional
externalIPs
externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service.
[str]Undefinedoptional
externalName
externalName is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record).
strUndefinedoptional
externalTrafficPolicy
externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints.
strUndefinedoptional
healthCheckNodePort
healthCheckNodePort specifies the healthcheck nodePort for the service.
intUndefinedoptional
ipFamilyPolicy
ipFamilyPolicy represents the dual-stack-ness requested or required by this Service, and is gated by the "IPv6DualStack" feature gate.
strUndefinedoptional
loadBalancerIP
Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field.
strUndefinedoptional
loadBalancerSourceRanges
If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs.
This field will be ignored if the cloud-provider does not support the feature.
More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/
[str]Undefinedoptional
publishNotReadyAddresses
publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready.
boolUndefinedoptional
sessionAffinity
Supports "ClientIP" and "None". Used to maintain session affinity.
More info: https://kubernetes.io/docs/concepts/services-networking/service/\#virtual-ips-and-service-proxies
strUndefinedoptional
sessionAffinityConfig
sessionAffinityConfig contains the configurations of session affinity.
{str: any}Undefinedoptional

Examples

service = Service {
name = "my-service-name"
namespace = "my-service-name"
labels.env = "dev"
ports = [
{
name = "grpc-xds"
port = 15010
}
{
name = "https-xds"
port = 15011
}
]
}