EndpointSlice
apiVersion: discovery.k8s.io/v1
import "k8s.io/api/discovery/v1"
EndpointSlice
EndpointSlice 表示实现服务的端点子集。对于给定的服务,可能存在多个 EndpointSlice 对象,通过标签选择,这些对象必须合并以生成端点的完整集合。
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata (ObjectMeta)
标准对象的元数据。
addressType (string), required
addressType 指定此 EndpointSlice 所承载的地址类型。此切片中的所有地址必须是相同的类型。此字段在创建后不可变。当前支持以下地址类型:* IPv4:表示 IPv4 地址。* IPv6:表示 IPv6 地址。* FQDN:表示完全限定域名。
endpoints ([]Endpoint), required
原子:在合并期间将被替换
endpoints 是此切片中唯一端点的列表。每个切片最多可以包含 1000 个端点。
endpoints.addresses ([]string), required
集:在合并期间将保留唯一值
此端点的地址。此字段的内容根据相应的 EndpointSlice addressType 字段进行解释。消费者必须在自身功能的上下文中处理不同类型的地址。这必须包含至少一个地址,但不能超过 100 个。这些都被假定为可互换的,客户端可以选择仅使用第一个元素。参考:https://issue.k8s.io/106267
endpoints.conditions (EndpointConditions)
conditions 包含有关端点当前状态的信息。
endpoints.conditions.ready (boolean)
ready 表示此端点已准备好接收流量,根据管理端点的任何系统。空值表示未知状态。在大多数情况下,消费者应将此未知状态解释为已准备就绪。出于兼容性原因,ready 永远不应为终止端点设置为“true”,除非明确覆盖正常的就绪行为,例如,当关联的服务设置了 publishNotReadyAddresses 标志时。
endpoints.conditions.serving (boolean)
serving 与 ready 相同,只是它无论端点的终止状态如何都会被设置。此条件应为已准备就绪的正在终止的端点设置为 true。如果为空,消费者应转而使用 ready 条件。
endpoints.conditions.terminating (boolean)
terminating 表示此端点正在终止。空值表示未知状态。消费者应将此未知状态解释为端点未终止。
endpoints.deprecatedTopology (map[string]string)
deprecatedTopology 包含 v1beta1 API 部分的拓扑信息。此字段已弃用,将在 v1beta1 API 被删除时删除(不早于 kubernetes v1.24)。虽然此字段可以保存值,但它不能通过 v1 API 写入,任何尝试写入它的操作都将被静默忽略。拓扑信息可以在 zone 和 nodeName 字段中找到。
endpoints.hints (EndpointHints)
hints 包含与如何使用端点相关联的信息。
endpoints.hostname (string)
此端点的主机名。消费者可以使用此字段来区分彼此的端点(例如,在 DNS 名称中)。使用相同主机名的多个端点应被视为可互换的(例如,DNS 中的多个 A 值)。必须为小写并通过 DNS 标签(RFC 1123)验证。
endpoints.nodeName (string)
nodeName 表示托管此端点的节点的名称。这可以用来确定本地于节点的端点。
endpoints.targetRef (ObjectReference)
targetRef 是对表示此端点的 Kubernetes 对象的引用。
endpoints.zone (string)
zone 是此端点所在的区域的名称。
ports ([]EndpointPort)
原子:在合并期间将被替换
ports 指定此切片中每个端点公开的网络端口列表。每个端口必须具有唯一的名称。当 ports 为空时,表示没有定义端口。当端口定义为 nil 端口值时,表示“所有端口”。每个切片最多可以包含 100 个端口。
EndpointPort 表示 EndpointSlice 使用的端口
ports.port (int32)
port 表示端点的端口号。如果未指定,则端口不受限制,必须在特定消费者的上下文中进行解释。
ports.protocol (string)
protocol 表示此端口的 IP 协议。必须是 UDP、TCP 或 SCTP。默认值为 TCP。
ports.name (string)
name 表示此端口的名称。EndpointSlice 中的所有端口必须具有唯一的名称。如果 EndpointSlice 来自 Kubernetes 服务,则这对应于 Service.ports[].name。名称必须为空字符串或通过 DNS_LABEL 验证:* 长度不超过 63 个字符。* 必须由小写字母数字字符或 '-' 组成。* 必须以字母数字字符开头和结尾。默认为空字符串。
ports.appProtocol (string)
此端口的应用程序协议。这被用作实现的提示,以便为它们理解的协议提供更丰富的行为。此字段遵循标准 Kubernetes 标签语法。有效值为
无前缀协议名称 - 为 IANA 标准服务名称保留(根据 RFC-6335 和 https://www.iana.org/assignments/service-names).
Kubernetes 定义的前缀名称
- 'kubernetes.io/h2c' - HTTP/2 over cleartext,如 https://www.rfc-editor.org/rfc/rfc7540 中所述
- 'kubernetes.io/ws' - WebSocket over cleartext,如 https://www.rfc-editor.org/rfc/rfc6455 中所述
- 'kubernetes.io/wss' - WebSocket over TLS,如 https://www.rfc-editor.org/rfc/rfc6455 中所述
其他协议应使用实现定义的前缀名称,例如 mycompany.com/my-custom-protocol。
EndpointSliceList
EndpointSliceList 表示端点切片的列表
apiVersion: discovery.k8s.io/v1
kind: EndpointSliceList
metadata (ListMeta)
标准列表元数据。
items ([]EndpointSlice), required
items 是端点切片的列表
操作
get
读取指定的 EndpointSlice
HTTP 请求
GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
参数
name (in path): string, required
EndpointSlice 的名称
namespace (in path): string, required
pretty (in query): string
响应
200 (EndpointSlice): OK
401: 未经授权
list
列出或监视 EndpointSlice 类型的对象
HTTP 请求
GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
参数
namespace (in path): string, required
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (EndpointSliceList): OK
401: 未经授权
list
列出或监视 EndpointSlice 类型的对象
HTTP 请求
GET /apis/discovery.k8s.io/v1/endpointslices
参数
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
响应
200 (EndpointSliceList): OK
401: 未经授权
create
创建 EndpointSlice
HTTP 请求
POST /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
参数
namespace (in path): string, required
body: EndpointSlice, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (EndpointSlice): OK
201 (EndpointSlice): 已创建
202 (EndpointSlice): 已接受
401: 未经授权
update
替换指定的 EndpointSlice
HTTP 请求
PUT /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
参数
name (in path): string, required
EndpointSlice 的名称
namespace (in path): string, required
body: EndpointSlice, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (EndpointSlice): OK
201 (EndpointSlice): 已创建
401: 未经授权
patch
部分更新指定的 EndpointSlice
HTTP 请求
PATCH /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
参数
name (in path): string, required
EndpointSlice 的名称
namespace (in path): string, required
body: Patch, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (查询中): 布尔值
pretty (in query): string
响应
200 (EndpointSlice): OK
201 (EndpointSlice): 已创建
401: 未经授权
delete
删除 EndpointSlice
HTTP 请求
DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
参数
name (in path): string, required
EndpointSlice 的名称
namespace (in path): string, required
body: DeleteOptions
dryRun (in query): string
gracePeriodSeconds (查询中): 整数
pretty (in query): string
propagationPolicy (查询中): 字符串
响应
200 (Status): OK
202 (Status): Accepted
401: 未经授权
deletecollection
删除 EndpointSlice 集合
HTTP 请求
DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
参数
namespace (in path): string, required
body: DeleteOptions
continue (in query): string
dryRun (in query): string
fieldSelector (in query): string
gracePeriodSeconds (查询中): 整数
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
propagationPolicy (查询中): 字符串
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
响应
200 (Status): OK
401: 未经授权
此页面自动生成。
如果您要报告此页面的问题,请在问题描述中提及页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。