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 Description | Type | Default Value | Required |
---|---|---|---|
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} | Undefined | optional |
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] | Undefined | optional |
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 | str | None | optional |
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] | Undefined | optional |
externalName externalName is the external reference that discovery mechanisms will return as an alias for this service (e.g. a DNS CNAME record). | str | Undefined | optional |
externalTrafficPolicy externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. | str | Undefined | optional |
healthCheckNodePort healthCheckNodePort specifies the healthcheck nodePort for the service. | int | Undefined | optional |
ipFamilyPolicy ipFamilyPolicy represents the dual-stack-ness requested or required by this Service, and is gated by the "IPv6DualStack" feature gate. | str | Undefined | optional |
loadBalancerIP Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. | str | Undefined | optional |
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] | Undefined | optional |
publishNotReadyAddresses publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. | bool | Undefined | optional |
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 | str | Undefined | optional |
sessionAffinityConfig sessionAffinityConfig contains the configurations of session affinity. | {str: any} | Undefined | optional |
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
}
]
}