Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.
object
Property | Type | Description |
---|---|---|
|
|
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources |
|
|
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds |
|
Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata |
|
|
|
ServiceSpec describes the attributes that a user creates on a service. |
|
|
ServiceStatus represents the current status of a service. |
ServiceSpec describes the attributes that a user creates on a service.
object
Property | Type | Description |
---|---|---|
|
|
clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are "None", empty string (""), or a valid IP address. "None" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, nodeport, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies |
|
|
externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system. |
|
|
externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName. |
|
|
externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. "Local" preserves the client source IP and avoids a second hop for LoadBalancer and nodeport type services, but risks potentially imbalanced traffic spreading. "Cluster" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. |
|
|
healthChecknodeport specifies the healthcheck nodeport for the service. If not specified, HealthChecknodeport is created by the service api backend with the allocated nodeport. Will use user-specified nodeport value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local. |
|
|
Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. |
|
|
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/configure-cloud-provider-firewall/ |
|
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 |
|
|
|
publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet’s Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery. |
|
|
Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, nodeport, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/ |
|
|
Supports "ClientIP" and "None". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies |
|
sessionAffinityConfig contains the configurations of session affinity. |
|
|
|
type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, nodeport, and LoadBalancer. "ExternalName" maps to the specified externalName. "ClusterIP" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is "None", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. "nodeport" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. "LoadBalancer" builds on nodeport and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types |
ServiceStatus represents the current status of a service.
object
Property | Type | Description |
---|---|---|
|
|
LoadBalancerStatus represents the status of a load-balancer. |
LoadBalancerStatus represents the status of a load-balancer.
object
Property | Type | Description |
---|---|---|
|
Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points. |
The following API endpoints are available:
/api/v1/services
GET
: list or watch objects of kind Service
/api/v1/namespaces/{namespace}/services
GET
: list or watch objects of kind Service
POST
: create a Service
/api/v1/namespaces/{namespace}/services/{name}
DELETE
: delete a Service
GET
: read the specified Service
PATCH
: partially update the specified Service
PUT
: replace the specified Service
/api/v1/namespaces/{namespace}/services/{name}/proxy
DELETE
: connect DELETE requests to proxy of Service
GET
: connect GET requests to proxy of Service
HEAD
: connect HEAD requests to proxy of Service
OPTIONS
: connect OPTIONS requests to proxy of Service
PATCH
: connect PATCH requests to proxy of Service
POST
: connect POST requests to proxy of Service
PUT
: connect PUT requests to proxy of Service
/api/v1/namespaces/{namespace}/services/{name}/status
GET
: read status of the specified Service
PATCH
: partially update status of the specified Service
PUT
: replace status of the specified Service
/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}
DELETE
: connect DELETE requests to proxy of Service
GET
: connect GET requests to proxy of Service
HEAD
: connect HEAD requests to proxy of Service
OPTIONS
: connect OPTIONS requests to proxy of Service
PATCH
: connect PATCH requests to proxy of Service
POST
: connect POST requests to proxy of Service
PUT
: connect PUT requests to proxy of Service
Parameter | Type | Description |
---|---|---|
|
|
The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. |
|
|
A selector to restrict the list of returned objects by their fields. Defaults to everything. |
|
|
If true, partially initialized resources are included in the response. |
|
|
A selector to restrict the list of returned objects by their labels. Defaults to everything. |
|
|
limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. |
|
|
If 'true', then the output is pretty printed. |
|
|
When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
|
|
Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
|
|
Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
GET
list or watch objects of kind Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
Parameter | Type | Description |
---|---|---|
|
|
object name and auth scope, such as for teams and projects |
Parameter | Type | Description |
---|---|---|
|
|
If 'true', then the output is pretty printed. |
GET
list or watch objects of kind Service
Parameter | Type | Description |
---|---|---|
|
|
The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. |
|
|
A selector to restrict the list of returned objects by their fields. Defaults to everything. |
|
|
If true, partially initialized resources are included in the response. |
|
|
A selector to restrict the list of returned objects by their labels. Defaults to everything. |
|
|
limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. |
|
|
When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
|
|
Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
|
|
Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
POST
create a Service
Parameter | Type | Description |
---|---|---|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized |
Empty |
Parameter | Type | Description |
---|---|---|
|
|
name of the Service |
|
|
object name and auth scope, such as for teams and projects |
Parameter | Type | Description |
---|---|---|
|
|
If 'true', then the output is pretty printed. |
DELETE
delete a Service
Parameter | Type | Description |
---|---|---|
|
|
The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. |
|
|
Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. |
|
|
Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. |
Parameter | Type | Description |
---|---|---|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
GET
read the specified Service
Parameter | Type | Description |
---|---|---|
|
|
Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. |
|
|
Should this value be exported. Export strips fields that a user can not specify. |
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PATCH
partially update the specified Service
Parameter | Type | Description |
---|---|---|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PUT
replace the specified Service
Parameter | Type | Description |
---|---|---|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
401 - Unauthorized |
Empty |
Parameter | Type | Description |
---|---|---|
|
|
name of the Service |
|
|
object name and auth scope, such as for teams and projects |
Parameter | Type | Description |
---|---|---|
|
|
Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. |
DELETE
connect DELETE requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
GET
connect GET requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
HEAD
connect HEAD requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
OPTIONS
connect OPTIONS requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PATCH
connect PATCH requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
POST
connect POST requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PUT
connect PUT requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
Parameter | Type | Description |
---|---|---|
|
|
name of the Service |
|
|
object name and auth scope, such as for teams and projects |
Parameter | Type | Description |
---|---|---|
|
|
If 'true', then the output is pretty printed. |
GET
read status of the specified Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PATCH
partially update status of the specified Service
Parameter | Type | Description |
---|---|---|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PUT
replace status of the specified Service
Parameter | Type | Description |
---|---|---|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
401 - Unauthorized |
Empty |
Parameter | Type | Description |
---|---|---|
|
|
name of the Service |
|
|
object name and auth scope, such as for teams and projects |
|
|
path to the resource |
Parameter | Type | Description |
---|---|---|
|
|
Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. |
DELETE
connect DELETE requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
GET
connect GET requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
HEAD
connect HEAD requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
OPTIONS
connect OPTIONS requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PATCH
connect PATCH requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
POST
connect POST requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |
PUT
connect PUT requests to proxy of Service
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized |
Empty |