查询联邦工作负载 - ShowProxyUnitedWorkload
功能介绍
查询联邦工作负载
URI
GET /v1/clustergroups/{clustergroupid}/unitedworkload
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
clustergroupid |
是 |
String |
容器舰队id |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
kind |
是 |
String |
工作负载的类型 |
|
namespace |
否 |
String |
命名空间 |
|
name |
否 |
String |
工作负载的名称 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
否 |
String |
身份认证信息,调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
kind |
String |
资源类型,有以下取值: |
|
apiVersion |
String |
API版本 |
|
metadata |
ObjectMeta object |
工作负载元数据 |
|
template |
Object |
要部署的应用模板 |
|
propagationPolicy |
PropagationPolicy object |
资源在多个集群间传播的策略 |
|
overridePolicy |
OverridePolicy object |
资源覆盖策略 |
|
resourceBinding |
ResourceBinding object |
资源与传播策略的绑定关系 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
kind |
String |
API类型,固定值“PropagationPolicy” |
|
apiVersion |
String |
API版本 |
|
metadata |
ObjectMeta object |
基本信息 |
|
spec |
PropagationSpec object |
传播策略的具体说明 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
resourceSelectors |
Array of ResourceSelector objects |
资源选择器,用于选择要传播的资源 |
|
propagateDeps |
Boolean |
是否自动传播引用的资源 |
|
placement |
Placement object |
定义资源传播到哪些集群的规则 |
|
priority |
Integer |
策略的优先级,默认值为0 |
|
schedulerName |
String |
调度器名称,默认值为“default-scheduler” |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
kind |
String |
API类型,固定值“OverridePolicy” |
|
apiVersion |
String |
API版本 |
|
spec |
OverrideSpec object |
覆盖策略的具体说明 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
resourceSelectors |
Array of ResourceSelector objects |
资源选择器,限制该覆盖策略适用的资源类型 |
|
overriders |
Object |
将应用于资源的覆盖规则 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
apiVersion |
String |
目标资源的API版本 |
|
kind |
String |
目标资源的类型 |
|
namespace |
String |
目标资源的名称 |
|
name |
String |
目标资源所在命名空间 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
kind |
String |
API类型,固定值“ResourceBinding” |
|
apiVersion |
String |
API版本 |
|
metadata |
ObjectMeta object |
资源的元数据 |
|
spec |
ResourceBindingSpec object |
表示资源绑定的期望行为 |
|
status |
ResourceBindingStatus object |
表示资源绑定的当前实际状态 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
uid |
String |
资源ID |
|
name |
String |
资源名称 |
|
generateName |
String |
当未提供name时,服务器使用的前缀来生成唯一名称 |
|
namespace |
String |
命名空间 |
|
labels |
Map<String,String> |
标签 |
|
annotations |
Map<String,String> |
注解 |
|
creationTimestamp |
String |
创建时间 |
|
updateTimestamp |
String |
更新时间 |
|
resourceVersion |
String |
资源内部版本 |
|
generation |
String |
资源期望状态的代数 |
|
managedFields |
Array of ManagedFieldsEntry objects |
记录哪些字段由哪些工作流管理 |
|
ownerReferences |
Array of OwnerReference objects |
用于定义对象间所有权关系,管理对象的依赖关系和垃圾回收机制,支持控制器对资源的管理 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
manager |
String |
管理者的名称 |
|
operation |
String |
记录导致此条目创建的操作类型,只能是 Apply 或 Update 两种操作类型 |
|
apiVersion |
String |
该管理者定义字段时所依据的资源 API 版本 |
|
time |
String |
此管理条目被创建或最后一次更新的时间戳 |
|
fieldsType |
String |
固定为 "FieldsV1",标记字段结构格式 |
|
fieldsV1 |
Object |
用于存储实际被管理的字段信息 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
apiVersion |
String |
标识引用对象的API版本 |
|
kind |
String |
引用对象的类型 |
|
name |
String |
引用对象的名称 |
|
uid |
String |
引用对象的uid |
|
controller |
Boolean |
如果为true,表示该引用指向管理该资源的控制器 |
|
blockOwnerDeletion |
Boolean |
当为true且拥有者有名为"foregroundDeletion"的finalizer 时,会阻止拥有者被删除,直到这个引用被移除 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
resource |
Object |
要传播的Kubernetes资源引用 |
|
propagateDeps |
Boolean |
是否自动传播相关资源 |
|
replicaRequirements |
Object |
定义每个副本的需求 |
|
replicas |
Integer |
要创建的副本数量 |
|
placement |
Placement object |
集群选择规则 |
|
clusters |
Array of TargetCluster objects |
目标成员集群列表 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
clusterAffinity |
ClusterAffinity object |
集群亲和性规则 |
|
clusterTolerations |
Array of Toleration objects |
集群容忍规则 |
|
replicaScheduling |
Object |
定义如何在成员集群间分配副本 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
clusterNames |
Array of strings |
指定要选择的集群名称列表 |
|
exclude |
Array of strings |
指定要排除的集群名称列表 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
key |
String |
表示要容忍的污点键名 |
|
operator |
String |
定义Key与Value之间的关系,可选值为Exists或Equal,默认为Equal |
|
value |
String |
表示要匹配的污点值,当Operator为Exists时,Value应为空 |
|
effect |
String |
指定要匹配的污点效果,可选值为 NoSchedule、PreferNoSchedule或NoExecute,如果为空,表示匹配所有效果 |
|
tolerationSeconds |
Integer |
仅对NoExecute效果有效,表示Pod能容忍污点的时间 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
schedulerObservedGeneration |
Integer |
记录调度器当前观察到的资源生成版本代数 |
|
conditions |
Array of ConditionStatus objects |
资源的各种状态条件 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
type |
String |
状态类型 |
|
status |
String |
状态 |
|
observedgeneration |
Integer |
状态对象的版本 |
|
lastTransitionTime |
String |
上次状态更新的时间 |
|
reason |
String |
状态原因 |
|
message |
String |
状态信息 |
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
- |
String |
- |
状态码:403
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
- |
String |
- |
状态码:404
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
- |
String |
- |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
- |
String |
- |
请求示例
无
响应示例
状态码:200
查询到的联邦工作负载信息
{
"kind": "Deployment",
"apiVersion": "apps/v1",
"metadata": {
"name": "test1111111",
"namespace": "default",
"creationTimestamp": null
},
"template": {},
"propagationPolicy": {
"kind": "PropagationPolicy",
"apiVersion": "policy.karmada.io/v1alpha1",
"metadata": {
"name": "test1111111-deployment",
"namespace": "default",
"uid": "ba1c3027-0084-4194-9cb9-e29adaf88712",
"resourceVersion": "62874",
"generation": 2,
"creationTimestamp": "2025-10-30T13:03:02Z",
"labels": {
"propagationpolicy.karmada.io/permanent-id": "51b25f78-1c19-4e0b-82b2-93a7f92b01f8"
},
"finalizers": [
"karmada.io/propagation-policy-controller"
]
},
"spec": {
"resourceSelectors": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"namespace": "default",
"name": "test1111111"
}
],
"propagateDeps": true,
"placement": {
"clusterAffinity": {
"clusterNames": [
"test"
]
},
"clusterTolerations": [
{
"key": "cluster.karmada.io/not-ready",
"operator": "Exists"
}
]
},
"priority": 0,
"schedulerName": "default-scheduler"
}
},
"overridePolicy": {
"kind": "OverridePolicy",
"apiVersion": "policy.karmada.io/v1alpha1",
"metadata": {
"name": "test1111111-deployment",
"namespace": "default",
"uid": "9def0688-474c-4cb9-bdaa-55ddb689e76c",
"resourceVersion": "60554",
"generation": 1,
"creationTimestamp": "2025-10-30T13:03:02Z"
},
"spec": {
"resourceSelectors": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"namespace": "default",
"name": "test1111111"
}
],
"overriders": {}
}
},
"resourceBinding": {
"kind": "ResourceBinding",
"apiVersion": "work.karmada.io/v1alpha2",
"metadata": {
"name": "test1111111-deployment",
"namespace": "default",
"uid": "ae97e9db-3550-4ef8-b737-191ea87a7fa1",
"resourceVersion": "86599",
"generation": 13,
"creationTimestamp": "2025-10-30T13:03:03Z",
"labels": {
"propagationpolicy.karmada.io/name": "test1111111-deployment",
"propagationpolicy.karmada.io/namespace": "default"
},
"ownerReferences": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"name": "test1111111",
"uid": "84cffd49-f561-4214-afcd-e58dae2670bb",
"controller": true,
"blockOwnerDeletion": true
}
],
"finalizers": [
"karmada.io/binding-controller",
"karmada.io/binding-dependencies-distributor"
],
},
"spec": {
"resource": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"namespace": "default",
"name": "test1111111",
"uid": "84cffd49-f561-4214-afcd-e58dae2670bb",
"resourceVersion": "69362"
},
"propagateDeps": true,
"replicaRequirements": {},
"replicas": 1,
"clusters": [
{
"name": "test",
"replicas": 1
}
],
"placement": {
"clusterAffinity": {
"clusterNames": [
"test"
]
}
},
"schedulerName": "default-scheduler"
},
"status": {
"schedulerObservedGeneration": 13,
"conditions": [
{
"type": "FullyApplied",
"status": "True",
"lastTransitionTime": "2025-10-30T14:23:19Z",
"reason": "FullyAppliedSuccess",
"message": "All works have been successfully applied"
}
]
}
}
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
查询到的联邦工作负载信息 |
|
400 |
客户端请求错误,服务器无法执行请求 |
|
403 |
服务器拒绝执行请求 |
|
404 |
资源不存在 |
|
500 |
服务器内部错误 |
错误码
请参见错误码。