---
api_metadata:
  apiVersion: "discovery.k8s.io/v1"
  import: "k8s.io/api/discovery/v1"
  kind: "EndpointSlice"
content_type: "api_reference"
description: "EndpointSlice 代表一组服务端点。"
title: "EndpointSlice"
weight: 3
---

<!--
api_metadata:
  apiVersion: "discovery.k8s.io/v1"
  import: "k8s.io/api/discovery/v1"
  kind: "EndpointSlice"
content_type: "api_reference"
description: "EndpointSlice represents a set of service endpoints."
title: "EndpointSlice"
weight: 3
-->

`apiVersion: discovery.k8s.io/v1`

`import "k8s.io/api/discovery/v1"`

## EndpointSlice {#EndpointSlice}

<!--
EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.
-->
EndpointSlice 表示一组服务端点。大多数 EndpointSlice 由 EndpointSlice
控制器创建，用于表示被 Service 对象选中的 Pod。对于一个给定的服务，可能存在多个
EndpointSlice 对象，这些对象必须被组合在一起以产生完整的端点集合；
你可以通过在服务的命名空间中列出 `kubernetes.io/service-name`
标签包含 Service 名称的 EndpointSlices 来找到给定 Service 的所有 slices。

<hr>

- **apiVersion**：discovery.k8s.io/v1

- **kind**：EndpointSlice

- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)

  <!--
  Standard object's metadata.
  -->
  
  标准的对象元数据。

- **addressType** (string)，<!--required-->必需

  <!--
  addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType "IPv4" and "IPv6". No semantics are defined for the "FQDN" type.
  -->
  
  `addressType` 指定当前 EndpointSlice 携带的地址类型。一个 EndpointSlice 只能携带同一类型的地址。
  EndpointSlice 对象创建完成后不可以再更改 addressType 字段。
  目前支持的地址类型为：

  * IPv4：表示 IPv4 地址。
  * IPv6：表示 IPv6 地址。
  * FQDN：表示完全限定域名。
  * （已弃用）EndpointSlice 控制器仅生成地址类型为 "IPv4" 和 "IPv6" 的切片，
    且 kube-proxy 也仅处理这些类型的切片。对于 "FQDN" 类型，未定义其语义。

  <!--
  Possible enum values:
   - `"FQDN"` represents a FQDN.
   - `"IPv4"` represents an IPv4 Address.
   - `"IPv6"` represents an IPv6 Address.
  -->

  可能的枚举值：

  - `"FQDN"` 表示完全限定域名（FQDN）。
  - `"IPv4"` 表示 IPv4 地址。
  - `"IPv6"` 表示 IPv6 地址。

- **endpoints** ([]Endpoint)

  <!--
  *Atomic: will be replaced during a merge*
  -->
  
  **原子性：合并期间将被替换**

  <!--
  endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
  -->
  
  `endpoints` 是当前 EndpointSlice 中一组唯一的端点。每个 EndpointSlice
  最多可以包含 1000 个端点。

  <a name="Endpoint"></a>

  <!--
  *Endpoint represents a single logical "backend" implementing a service.*
  -->
  
  **端点是实现某 Service 的一个逻辑“后端”。**

  - **endpoints.addresses** ([]string)，<!--required-->必需

    <!--
    *Set: unique values will be kept during a merge*
    -->

    **集合：不重复的值在合并期间会被保留**

    <!--
    addresses of this endpoint. For EndpointSlices of addressType "IPv4" or "IPv6", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.
    -->

    本端点的地址。对于地址类型为 "IPv4" 或 "IPv6" 的 EndpointSlices，
    值是规范形式的 IP 地址。其他地址类型值的语法和语义未定义。
    这必须包含至少一个地址但不超过 100 个。由 EndpointSlice 控制器生成的
    EndpointSlices 将始终只有 1 个地址。对于第一个之后的额外地址，未定义其语义，
    并且 kube-proxy 不会查看它们。

  - **endpoints.conditions** (EndpointConditions)

    <!--
    conditions contains information about the current status of the endpoint.
    -->

    `conditions` 包含和本端点当前状态有关的信息。

    <a name="EndpointConditions"></a>

    <!--
    *EndpointConditions represents the current condition of an endpoint.*
    -->

    **EndpointConditions 是端点的当前状况。**

    - **endpoints.conditions.ready** (boolean)

      <!--
      ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as "true". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.
      -->

      `ready` 说明此端点已经准备好根据相关的系统映射接收流量。nil 值应解释为 "true"。
      通常，如果 endpoint 正在服务且未终止，则应将其标记为 ready，
      尽管在某些情况下可以覆盖此设置，例如当关联的 Service 设置了
      publishNotReadyAddresses 标志时。

    - **endpoints.conditions.serving** (boolean)

      <!--
      serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as "true".
      -->

      `serving` 表示此端点能够接收流量，根据管理端点的系统。对于由 Pod 支持的端点，
      如果 Pod 的 Ready 条件为 True，EndpointSlice 控制器会将端点标记为 `serving`。
      nil 值应解释为 "true"。

    - **endpoints.conditions.terminating** (boolean)

      <!--
      terminating indicates that this endpoint is terminating. A nil value should be interpreted as "false".
      -->

      `terminating` 说明当前端点正在终止过程中。
      nil 值应解释为 "false"。

  - **endpoints.deprecatedTopology** (map[string]string)

    <!--
    deprecatedTopology contains topology information part of the v1beta1 API. This field is deprecated, and will be removed when the v1beta1 API is removed (no sooner than kubernetes v1.24).  While this field can hold values, it is not writable through the v1 API, and any attempts to write to it will be silently ignored. Topology information can be found in the zone and nodeName fields instead.
    -->

    `deprecatedTopology` 包含 v1beta1 API 的拓扑信息部分。目前已经弃用了此字段，
    移除 v1beta1 API 时（不早于 Kubernetes v1.24）会一起移除此字段。
    此字段目前仍然可以存储值，但是不能通过 v1 API 写入数据。
    向此字段写入数据的任何尝试都会被忽略，并且不会通知用户。
    移除此字段后，可以在 zone 和 nodeName 字段中查看拓扑信息。

  - **endpoints.hints** (EndpointHints)

    <!--
    hints contains information associated with how an endpoint should be consumed.
    -->

    `hints` 是关于应该如何使用某端点的提示信息。

    <a name="EndpointHints"></a>

    <!--
    *EndpointHints provides hints describing how an endpoint should be consumed.*
    -->

    **EndpointHints 提供应该如何使用某端点的提示信息。**

    - **endpoints.hints.forNodes** ([]ForNode)

      <!--
      *Atomic: will be replaced during a merge*
      -->

      **原子性：合并期间将被替换**

      <!--
      forNodes indicates the node(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries.
      -->

      `forNodes` 表示在使用拓扑感知路由时，此端点应由哪个（些）节点消费。
      最多可能包含 8 个条目。

      <a name="ForNode"></a>

      <!--
      *ForNode provides information about which nodes should consume this endpoint.*

      - **endpoints.hints.forNodes.name** (string), required

        name represents the name of the node.
      -->

      **ForNode 提供关于哪个节点应调用此端点的信息。**

      - **endpoints.hints.forNodes.name** (string)，必需

        `name` 表示节点的名称。

    - **endpoints.hints.forZones** ([]ForZone)

      <!--
      *Atomic: will be replaced during a merge*
      -->

      **原子性：合并期间将被替换**

      <!--
      forZones indicates the zone(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries.
      -->

      `forZones` 表示在使用拓扑感知路由时，该端点应由哪个（些）区域消费。
      最多可能包含 8 个条目。

      <a name="ForZone"></a>

      <!--
      *ForZone provides information about which zones should consume this endpoint.*
      -->

      **ForZone 指示应该由哪些可用区调度此端点。**

      - **endpoints.hints.forZones.name** (string)，<!--required-->必需

        <!--
        name represents the name of the zone.
        -->

        `name` 代表可用区的名称。

  - **endpoints.hostname** (string)

    <!--
    hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.
    -->

    此端点的主机名称。端点的使用者可以通过此字段区分各个端点（例如，通过 DNS 域名）。
    使用同一主机名称的多个端点应被视为可替换（例如，DNS 中的多个 A 记录）。
    必须为小写字母，并且需要通过 DNS Label (RFC 1123) 验证。

  - **endpoints.nodeName** (string)

    <!--
    nodeName represents the name of the Node hosting this endpoint. This can be used to determine endpoints local to a Node.
    -->

    `nodeName` 是托管此端点的 Node 的名称，使用 `nodeName` 可以决定 Node 本地有哪些端点。

  - **endpoints.targetRef** (<a href="{{< ref "../common-definitions/object-reference#ObjectReference" >}}">ObjectReference</a>)

    <!--
    targetRef is a reference to a Kubernetes object that represents this endpoint.
    -->

    `targetRef` 是对代表此端点的 Kubernetes 对象的引用。

  - **endpoints.zone** (string)

    <!--
    zone is the name of the Zone this endpoint exists in.
    -->

    `zone` 是此端点所在的可用区（Zone）的名称。

- **ports** ([]EndpointPort)

  <!--
  *Atomic: will be replaced during a merge*
  -->

  **原子性：合并期间会被替代**

  <!--
  ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.
  -->
  
  `ports` 列出了当前 EndpointSlice 中各个端点所暴露的网络端口。每个端口的名称不得重复。
  每个切片最多可能包含 100 个端口。Service 总是至少有 1 个端口，因此由 EndpointSlice
  控制器生成的 EndpointSlices 同样总是至少有 1 个端口。用于其他目的的 EndpointSlices
  可能有一个空的 `ports` 列表。

  <a name="EndpointPort"></a>

  <!--
  *EndpointPort represents a Port used by an EndpointSlice*
  -->

  **EndpointPort 是 EndpointSlice 使用的端口。**

  - **ports.port** (int32)

    <!--
    port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.
    -->

    `port` 表示端点的端口号。如果 EndpointSlice 是从 Kubernetes 服务派生的，
    这必须设置为服务的目标端口。用于其他目的的 EndpointSlices 可能有一个 nil 端口。

  - **ports.protocol** (string)

    <!--
    protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.

    Possible enum values:
     - `"SCTP"` is the SCTP protocol.
     - `"TCP"` is the TCP protocol.
     - `"UDP"` is the UDP protocol.
    -->

    `protocol` 表示此端口的 IP 协议。必须为 `UDP`、`TCP` 或 `SCTP`。默认为 `TCP`。

    可能的枚举值：
    - `"SCTP"` 是 SCTP 协议
    - `"TCP"` 是 TCP 协议
    - `"UDP"` 是 UDP 协议

  - **ports.name** (string)

    <!--
    name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.
    -->

    `name` 表示此端口的名称。EndpointSlice 中所有端口的名称都不得重复。
    如果 EndpointSlice 是基于 Kubernetes Service 创建的，
    那么此端口的名称和 `Service.ports[].name` 字段的值一致。默认为空字符串。
    名称必须是空字符串，或者必须通过 DNS_LABEL 验证：

      * 最多包含 63 个字符。
      * 必须包含英文小写字母或'-'。
      * 必须以字母开头并以字母结尾。

  - **ports.appProtocol** (string)

    <!--
    The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:

    * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).

    * Kubernetes-defined prefixed names:
      * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-
      * 'kubernetes.io/ws'  - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455
      * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455

    * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.
    -->

    此端口的应用层协议。字段值被用作提示，允许协议实现为其所理解的协议提供更丰富的行为。
    此字段遵循标准的 Kubernetes 标签句法。有效的取值是：

    * 不带前缀的协议名 - 是 IANA 标准服务的保留名称（参见 RFC-6335 和
      https://www.iana.org/assignments/service-names）。

    * Kubernetes 定义的前缀名称：
      * 'kubernetes.io/h2c' - HTTP/2 通过明文预先了解知识，如
        https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- 中所述。
      * 'kubernetes.io/ws' - 通过明文传输的 WebSocket，详见 https://www.rfc-editor.org/rfc/rfc6455
      * 'kubernetes.io/wss' - 通过 TLS 传输的 WebSocket，详见 https://www.rfc-editor.org/rfc/rfc6455

    * 其他协议应该使用带前缀的名称，例如 `mycompany.com/my-custom-protocol`。

## EndpointSliceList {#EndpointSliceList}

<!--
EndpointSliceList represents a list of endpoint slices
-->
EndpointSliceList 是 EndpointSlice 的列表。

<hr>

- **apiVersion**：discovery.k8s.io/v1

- **kind**：EndpointSliceList

- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)

  <!--
  Standard list metadata.
  -->

  标准的列表元数据。

- **items** ([]<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)，<!--required-->必需

  <!--
  items is the list of endpoint slices
  -->

  `items` 是 EndpointSlice 列表。

<!--
## Operations {#Operations}
-->
## 操作 {#操作}

<hr>

<!--
### `get` read the specified EndpointSlice

#### HTTP Request
-->
### `get` 读取指定的 EndpointSlice

#### HTTP 请求

GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}

<!--
#### Parameters
-->
#### 参数

<!--
- **name** (*in path*): string, required
-->
- **name** (**路径参数**)：string，必需

  <!--
  name of the EndpointSlice
  -->

  EndpointSlice 的名称。

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>): OK

401: Unauthorized

<!--
### `list` list or watch objects of kind EndpointSlice

#### HTTP Request
-->
### `list` 列举或监测 EndpointSlice 类别的对象

#### HTTP 请求

GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices

<!--
#### Parameters
-->
#### 参数

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

<!--
- **allowWatchBookmarks** (*in query*): boolean
-->
- **allowWatchBookmarks** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>

<!--
- **continue** (*in query*): string
-->
- **continue** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>

<!--
- **fieldSelector** (*in query*): string
-->
- **fieldSelector** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>

<!--
- **labelSelector** (*in query*): string
-->
- **labelSelector** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>

<!--
- **limit** (*in query*): integer
-->
- **limit** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
- **resourceVersion** (*in query*): string
-->
- **resourceVersion** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>

<!--
- **resourceVersionMatch** (*in query*): string
-->
- **resourceVersionMatch** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>

<!--
- **sendInitialEvents** (*in query*): boolean
-->
- **sendInitialEvents** (**查询参数**): boolean

  <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>

<!--
- **shardSelector** (*in query*): string
-->
- **shardSelector** (**查询参数**): string
  
  <a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>

<!--
- **timeoutSeconds** (*in query*): integer
-->
- **timeoutSeconds** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>

<!--
- **watch** (*in query*): boolean
-->
- **watch** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSliceList" >}}">EndpointSliceList</a>): OK

401: Unauthorized

<!--
### `list` list or watch objects of kind EndpointSlice

#### HTTP Request
-->
### `list` 列举或监测 EndpointSlice 类别的对象

#### HTTP 请求

GET /apis/discovery.k8s.io/v1/endpointslices

<!--
#### Parameters
-->
#### 参数

<!--
- **allowWatchBookmarks** (*in query*): boolean
-->
- **allowWatchBookmarks** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>

<!--
- **continue** (*in query*): string
-->
- **continue** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>

<!--
- **fieldSelector** (*in query*): string
-->
- **fieldSelector** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>

<!--
- **labelSelector** (*in query*): string
-->
- **labelSelector** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>

<!--
- **limit** (*in query*): integer
-->
- **limit** (**查询参数**)：integer
  
  <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string
  
  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
- **resourceVersion** (*in query*): string
-->
- **resourceVersion** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>

<!--
- **resourceVersionMatch** (*in query*): string
-->
- **resourceVersionMatch** (*查询参数*)：string

  <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>

<!--
- **sendInitialEvents** (*in query*): boolean
-->
- **sendInitialEvents** (**查询参数**): boolean

  <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>

<!--
- **shardSelector** (*in query*): string
-->
- **shardSelector** (**查询参数**): string
  
  <a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>

<!--
- **timeoutSeconds** (*in query*): integer
-->
- **timeoutSeconds** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>

<!--
- **watch** (*in query*): boolean
-->
- **watch** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSliceList" >}}">EndpointSliceList</a>): OK

401: Unauthorized

<!--
### `create` create an EndpointSlice
-->
### `create` 创建 EndpointSlice

<!--
#### HTTP Request
-->
#### HTTP 请求

POST /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices

<!--
#### Parameters
-->
#### 参数

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

- **body**：<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>，<!--required-->必需

<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>

<!--
- **fieldManager** (*in query*): string
-->
- **fieldManager** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>

<!--
- **fieldValidation** (*in query*): string
-->
- **fieldValidation** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：OK

201 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：Created

202 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：Accepted

401：Unauthorized

<!--
### `update` replace the specified EndpointSlice

#### HTTP Request
-->
### `update` 替换指定的 EndpointSlice

#### HTTP 请求

PUT /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}

<!--
#### Parameters
-->
#### 参数

<!--
- **name** (*in path*): string, required
-->
- **name** (**路径参数**)：string，必需

  <!--
  name of the EndpointSlice
  -->
  
  EndpointSlice 的名称。

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

- **body**：<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>，<!-- required-->必需

<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>

<!--
- **fieldManager** (*in query*): string
-->
- **fieldManager** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>

<!--
- **fieldValidation** (*in query*): string
-->
- **fieldValidation** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：OK

201 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：Created

401：Unauthorized

<!--
### `patch` partially update the specified EndpointSlice
-->
### `patch` 部分更新指定的 EndpointSlice

<!--
#### HTTP Request
-->
#### HTTP 请求

PATCH /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}

<!--
#### Parameters
-->
#### 参数

<!--
- **name** (*in path*): string, required
-->
- **name** (**路径参数**): string，必需

  <!--name of the EndpointSlice-->
  EndpointSlice 的名称。

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

- **body**：<a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch</a>，<!--required-->必需

<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>

<!--
- **fieldManager** (*in query*): string
-->
- **fieldManager** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>

<!--
- **fieldValidation** (*in query*): string
-->
- **fieldValidation** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>

<!--
- **force** (*in query*): boolean
-->
- **force** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：OK

201 (<a href="{{< ref "../service-resources/endpoint-slice-v1#EndpointSlice" >}}">EndpointSlice</a>)：Created

401：Unauthorized

<!--
### `delete` delete an EndpointSlice
-->
### `delete` 删除 EndpointSlice

<!--
#### HTTP Request
-->
#### HTTP 请求

DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}

<!--
#### Parameters
-->
#### 参数

<!--
- **name** (*in path*): string, required
-->
- **name** (**路径参数**)：string，必需

  <!--
  name of the EndpointSlice
  -->
  EndpointSlice 的名称。

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

- **body**：<a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions</a>

<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>

<!--
- **gracePeriodSeconds** (*in query*): integer
-->
- **gracePeriodSeconds** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds</a>

<!--
- **ignoreStoreReadErrorWithClusterBreakingPotential** (*in query*): boolean

  <a href="{{< ref "../common-parameters/common-parameters#ignoreStoreReadErrorWithClusterBreakingPotential" >}}">ignoreStoreReadErrorWithClusterBreakingPotential</a>
-->
- **ignoreStoreReadErrorWithClusterBreakingPotential** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#ignoreStoreReadErrorWithClusterBreakingPotential" >}}">ignoreStoreReadErrorWithClusterBreakingPotential</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
- **propagationPolicy** (*in query*): string
-->
- **propagationPolicy** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>)：OK

202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>)：Accepted

401：Unauthorized

<!--
### `deletecollection` delete collection of EndpointSlice
-->
### `deletecollection` 删除 EndpointSlice 的集合

<!--
#### HTTP Request
-->
#### HTTP 请求

DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices

<!--
#### Parameters
-->
#### 参数

<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**路径参数**)：string，必需

  <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>

- **body**：<a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions</a>

<!--
- **continue** (*in query*): string
-->
- **continue** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>

<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>

<!--
- **fieldSelector** (*in query*): string
-->
- **fieldSelector** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>

<!--
- **gracePeriodSeconds** (*in query*): integer
-->
- **gracePeriodSeconds** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds</a>

<!--
- **ignoreStoreReadErrorWithClusterBreakingPotential** (*in query*): boolean
-->
- **ignoreStoreReadErrorWithClusterBreakingPotential** (**查询参数**)：boolean

  <a href="{{< ref "../common-parameters/common-parameters#ignoreStoreReadErrorWithClusterBreakingPotential" >}}">ignoreStoreReadErrorWithClusterBreakingPotential</a>

<!--
- **labelSelector** (*in query*): string
-->
- **labelSelector** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>

<!--
- **limit** (*in query*): integer
-->
- **limit** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>

<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>

<!--
- **propagationPolicy** (*in query*): string
-->
- **propagationPolicy** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy</a>

<!--
- **resourceVersion** (*in query*)：string
-->
- **resourceVersion** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>

<!--
- **resourceVersionMatch** (*in query*): string
-->
- **resourceVersionMatch** (**查询参数**)：string

  <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>

<!--
- **sendInitialEvents** (*in query*): boolean
-->
- **sendInitialEvents** (**查询参数**): boolean

  <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>

<!--
- **shardSelector** (*in query*): string
-->
- **shardSelector** (**查询参数**): string

  <a href="{{< ref "../common-parameters/common-parameters#shardSelector" >}}">shardSelector</a>

<!--
- **timeoutSeconds** (*in query*): integer
-->
- **timeoutSeconds** (**查询参数**)：integer

  <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>

<!--
#### Response
-->
#### 响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK

401: Unauthorized
