---
title: "GET /api/v1/services"
method: GET
path: "/api/v1/services"
tags: ["core_v1"]
---

# GET /api/v1/services

`GET /api/v1/services`

list or watch objects of kind Service

## Response `200`

OK

- V1ServiceList — ServiceList holds a list of services.
  - `items` V1Service[], required — List of services
    - `metadata` V1ObjectMeta — ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
      - `annotations` object — Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
      - `clusterName` string — The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
      - `creationTimestamp` string, date-time
      - `deletionGracePeriodSeconds` integer — Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.
      - `deletionTimestamp` string, date-time
      - `finalizers` string[] — Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.
      - `generateName` string — GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). Applied only if Name is not specified. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency
      - `generation` integer — A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.
      - `labels` object — Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
      - `name` string — Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names
      - `namespace` string — Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
      - `ownerReferences` V1OwnerReference[] — List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.
        - `apiVersion` string, required — API version of the referent.
        - `controller` boolean — If true, this reference points to the managing controller.
        - `kind` string, required — Kind of the referent. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
        - `name` string, required — Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names
        - `uid` string, required — UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids
      - `resourceVersion` string — An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
      - `selfLink` string — SelfLink is a URL representing this object. Populated by the system. Read-only.
      - `uid` string — UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids
    - `spec` V1ServiceSpec — ServiceSpec describes the attributes that a user creates on a service.
      - `clusterIP` string — 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: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies
      - `deprecatedPublicIPs` string[] — deprecatedPublicIPs is deprecated and replaced by the externalIPs field with almost the exact same semantics. This field is retained in the v1 API for compatibility until at least 8/20/2016. It will be removed from any new API revisions. If both deprecatedPublicIPs *and* externalIPs are set, deprecatedPublicIPs is used.
      - `externalIPs` string[] — 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. A previous form of this functionality exists as the deprecatedPublicIPs field. When using this field, callers should also clear the deprecatedPublicIPs field.
      - `externalName` string — 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 DNS name and requires Type to be ExternalName.
      - `loadBalancerIP` string — 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.
      - `loadBalancerSourceRanges` string[] — 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: http://kubernetes.io/docs/user-guide/services-firewalls
      - `ports` V1ServicePort[], required — The list of ports that are exposed by this service. More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies
        - `name` string — The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.
        - `nodePort` integer — The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: http://kubernetes.io/docs/user-guide/services#type--nodeport
        - `port` integer, required — The port that will be exposed by this service.
        - `protocol` string — The IP protocol for this port. Supports "TCP" and "UDP". Default is TCP.
        - `targetPort` string, int-or-string
      - `selector` object — 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: http://kubernetes.io/docs/user-guide/services#overview
      - `sessionAffinity` string — 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: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies
      - `type` string — 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: http://kubernetes.io/docs/user-guide/services#overview
    - `status` V1ServiceStatus — ServiceStatus represents the current status of a service.
      - `loadBalancer` V1LoadBalancerStatus — LoadBalancerStatus represents the status of a load-balancer.
        - `ingress` V1LoadBalancerIngress[] — Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.
          - `hostname` string — Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)
          - `ip` string — IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)
  - `metadata` UnversionedListMeta — ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
    - `resourceVersion` string — String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
    - `selfLink` string — SelfLink is a URL representing this object. Populated by the system. Read-only.

## Changes

- **2016-12-17** `9ff77080fa88` — 1 info
  - removed the non-success response with the status `401`

[Change history](https://skmtc.dev/kubeup/apis/generic-api-server/changes/api/v1/services/get.md)

---

[API](https://skmtc.dev/kubeup/apis/generic-api-server.md) · [All operations](https://skmtc.dev/kubeup/apis/generic-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kubeup/generic-api-server/revisions/9ff77080fa88/schema)
