Information in this document may be out of date

This document has an older update date than the original, so the information it contains may be out of date. If you're able to read English, see the English version for the most up-to-date information: Endpoints

Endpoints

Endpoints 是实现实际服务的端点的集合。

apiVersion: v1

import "k8s.io/api/core/v1"

Endpoints

Endpoints 是实现实际服务的端点的集合。举例:

 Name: "mysvc",
 Subsets: [
   {
     Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
     Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
   },
   {
     Addresses: [{"ip": "10.10.3.3"}],
     Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
   },
]

  • apiVersion: v1

  • kind: Endpoints

  • metadata (ObjectMeta)

    标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

  • subsets ([]EndpointSubset)

    所有端点的集合是所有 subsets 的并集。不同地址会根据其 IP 地址被放入不同子集。 对于具有多个端口的单个地址,如果其中一些端口已就绪,而另一些端口未就绪(因为它们来自不同的容器), 将导致地址显示在不同端口的不同子集中。 任何地址都不可以同时出现在 addresses 和 notReadyAddress 中的相同子集内。

    EndpointSubset 是一组具有公共端口集的地址。扩展的端点集是 addresses 和 ports 的笛卡尔乘积。例如假设:

    { Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] }

    则最终的端点集可以看作:

    a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ]*

    • subsets.addresses ([]EndpointAddress)

      提供标记为就绪的相关端口的 IP 地址。 这些端点应该被认为是负载均衡器和客户端可以安全使用的。

      EndpointAddress 是描述单个 IP 地址的元组。

      • subsets.addresses.ip (string), 必需

        端点的 IP。不可以是本地回路(127.0.0.0/8 或 ::1)、 链路本地(169.254.0.0/16 或 fe80::/10)或链路本地多播(224.0.0.0/24 或 ff02::/16))地址。

      • subsets.addresses.hostname (string)

        端点主机名称。

      • subsets.addresses.nodeName (string)

        可选:承载此端点的节点。此字段可用于确定一个节点的本地端点。

      • subsets.addresses.targetRef (ObjectReference)

        对提供端点的对象的引用。

    • subsets.notReadyAddresses ([]EndpointAddress)

      提供相关端口但由于尚未完成启动、最近未通过就绪态检查或最近未通过活跃性检查而被标记为当前未就绪的 IP 地址。 EndpointAddress 是描述单个 IP 地址的元组。

      • subsets.notReadyAddresses.ip (string), 必需

        端点的 IP。不可以是本地环路(127.0.0.0/8 或 ::1)、 链路本地(169.254.0.0/16 或 fe80::/10)或链路本地多播(224.0.0.0/24 或 ff02::/16)地址。

      • subsets.notReadyAddresses.hostname (string)

        端点主机名称。

      • subsets.notReadyAddresses.nodeName (string)

        可选:承载此端点的节点。此字段可用于确定节点的本地端点。

      • subsets.notReadyAddresses.targetRef (ObjectReference)

        对提供端点的对象的引用。

    • subsets.ports ([]EndpointPort)

      相关 IP 地址上可用的端口号。

      EndpointPort 是描述单个端口的元组。

      • subsets.ports.port (int32), 必需

        端点的端口号。

      • subsets.ports.protocol (string)

        此端口的 IP 协议。必须是 UDP、TCP 或 SCTP。默认值为 TCP。

      • subsets.ports.name (string)

        端口的名称。此字段必须与相应 ServicePort 中的 name 字段匹配。必须是 DNS_LABEL。 仅当定义了一个端口时才可选。

      • subsets.ports.appProtocol (string)

        端口的应用程序协议。这被用作实现的提示,为他们理解的协议提供更丰富的行为。 此字段遵循标准的 Kubernetes 标签语法。有效值为:

EndpointsList

EndpointsList 是端点列表。


  • items ([]Endpoints), 必需

    端点列表。

操作


get 读取指定的 Endpoints

HTTP 请求

GET /api/v1/namespaces/{namespace}/endpoints/{name}

参数

  • name (路径参数):string,必需

    Endpoints 的名称。

  • namespace (路径参数):string,必需

    namespace

  • pretty (查询参数):string

    pretty

响应

200 (Endpoints): OK

401: Unauthorized

list 列出或监测 Endpoints 类型的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/endpoints

参数

  • namespace (路径参数):string,必需

    namespace

  • continue (查询参数):string

    continue

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

  • watch (查询参数):boolean

    watch

响应

200 (EndpointsList): OK

401: Unauthorized

list 列出或监测 Endpoints 类型的对象

HTTP 请求

GET /api/v1/endpoints

参数

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

响应

200 (EndpointsList): OK

401: Unauthorized

create 创建 Endpoints

HTTP 请求

POST /api/v1/namespaces/{namespace}/endpoints

参数

响应

200 (Endpoints): OK

201 (Endpoints): Created

202 (Endpoints): Accepted

401: Unauthorized

update 替换指定的 Endpoints

HTTP 请求

PUT /api/v1/namespaces/{namespace}/endpoints/{name}

参数

  • name (路径参数):string,必需

    Endpoints 名称

响应

200 (Endpoints): OK

201 (Endpoints): Created

401: Unauthorized

patch 部分更新指定的 Endpoints

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/endpoints/{name}

参数

  • name (路径参数):string,必需

    Endpoints 名称

  • namespace (路径参数):string,必需

    namespace

  • body: Patch, 必需

  • pretty (查询参数):string

    pretty

响应

200 (Endpoints): OK

201 (Endpoints): Created

401: Unauthorized

delete 删除 Endpoints

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/endpoints/{name}

参数

  • name (路径参数):string,必需

    Endpoints 名称

  • dryRun (查询参数):string

    dryRun

  • pretty (查询参数):string

    pretty

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 Endpoints 组

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/endpoints

参数

  • continue (查询参数):string

    continue

  • dryRun (查询参数):string

    dryRun

  • limit (查询参数):integer

    limit

  • pretty (查询参数):string

    pretty

响应

200 (Status): OK

401: Unauthorized

最后修改 May 14, 2023 at 12:04 PM PST: [zh-cn] sync endpoints-v1.md and ingress-class-v1.md (2b5693b841)