Endpoints
apiVersion: v1
import "k8s.io/api/core/v1"
Endpoints
Endpoints 是一个实现了实际服务的端点集合。例如:
名称: "mysvc", 子集: [ { 地址: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 端口: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] }, { 地址: [{"ip": "10.10.3.3"}], 端口: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] }, ]
Endpoints 是一个旧版 API,不包含所有服务功能的信息。请使用 discoveryv1.EndpointSlice 获取有关服务端点的完整信息。
已弃用:此 API 在 v1.33+ 中已弃用。请使用 discoveryv1.EndpointSlice。
apiVersion: v1
kind:Endpoints
metadata (ObjectMeta)
标准对象的元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
subsets ([]EndpointSubset)
原子性:在合并期间将被替换
所有端点的集合是所有子集的并集。地址根据它们共享的 IP 被放入子集。一个具有多个端口的单个地址,其中一些是就绪的,而另一些不是就绪的(因为它们来自不同的容器),将导致该地址在不同的端口中显示在不同的子集中。在同一个子集中,任何地址都不会同时出现在 Addresses 和 NotReadyAddresses 中。包含服务的一组地址和端口。
*EndpointSubset 是一个具有一组通用端口的地址组。扩展的端点集是 Addresses x Ports 的笛卡尔积。例如,给定
{ 地址: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 端口: [{"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 ]
已弃用:此 API 在 v1.33+ 中已弃用。*
subsets.addresses ([]EndpointAddress)
原子性:在合并期间将被替换
提供相关端口并标记为就绪的 IP 地址。这些端点应被负载均衡器和客户端视为可安全利用。
*EndpointAddress 是描述单个 IP 地址的元组。已弃用:此 API 在 v1.33+ 中已弃用。*
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 地址的元组。已弃用:此 API 在 v1.33+ 中已弃用。*
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 是描述单个端口的元组。已弃用:此 API 在 v1.33+ 中已弃用。*
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 标签语法。有效值可以是
无前缀协议名称 - 保留用于 IANA 标准服务名称(根据 RFC-6335 和 https://www.iana.org/assignments/service-names))。
Kubernetes 定义的带前缀名称
- 'kubernetes.io/h2c' - 根据 https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- 所述,通过明文进行的 HTTP/2 预知。
- 'kubernetes.io/ws' - 根据 https://www.rfc-editor.org/rfc/rfc6455 所述,通过明文进行的 WebSocket。
- 'kubernetes.io/wss' - 根据 https://www.rfc-editor.org/rfc/rfc6455 所述,通过 TLS 进行的 WebSocket。
其他协议应使用实现定义的带前缀名称,例如 mycompany.com/my-custom-protocol。
EndpointsList
EndpointsList 是端点列表。已弃用:此 API 在 v1.33+ 中已弃用。
apiVersion: v1
kind:EndpointsList
metadata (ListMeta)
标准列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]Endpoints), 必需
端点列表。
操作
get
读取指定的 Endpoints
HTTP 请求
GET /api/v1/namespaces/{namespace}/endpoints/{name}
参数
响应
200 (Endpoints): 成功
401: 未授权
list
列出或监视 Endpoints 类型的对象
HTTP 请求
GET /api/v1/namespaces/{namespace}/endpoints
参数
namespace (在路径中): string,必填
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (EndpointsList): 成功
401: 未授权
list
列出或监视 Endpoints 类型的对象
HTTP 请求
GET /api/v1/endpoints
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (EndpointsList): 成功
401: 未授权
create
创建 Endpoints
HTTP 请求
POST /api/v1/namespaces/{namespace}/endpoints
参数
namespace (在路径中): string,必填
body: Endpoints, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (Endpoints): 成功
201 (Endpoints): 已创建
202 (Endpoints): 已接受
401: 未授权
update
替换指定的 Endpoints
HTTP 请求
PUT /api/v1/namespaces/{namespace}/endpoints/{name}
参数
name (在路径中): string,必填
Endpoints 的名称
namespace (在路径中): string,必填
body: Endpoints, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (Endpoints): 成功
201 (Endpoints): 已创建
401: 未授权
patch
部分更新指定的 Endpoints
HTTP 请求
PATCH /api/v1/namespaces/{namespace}/endpoints/{name}
参数
name (在路径中): string,必填
Endpoints 的名称
namespace (在路径中): string,必填
body: Patch,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (Endpoints): 成功
201 (Endpoints): 已创建
401: 未授权
delete
删除 Endpoints
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/endpoints/{name}
参数
name (在路径中): string,必填
Endpoints 的名称
namespace (在路径中): string,必填
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未授权
deletecollection
删除 Endpoints 集合
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/endpoints
参数
namespace (在路径中): string,必填
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): OK
401: 未授权
本页面是自动生成的。
如果你打算报告此页面存在的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。