---
api_metadata:
apiVersion: "resource.k8s.io/v1alpha2"
import: "k8s.io/api/resource/v1alpha2"
kind: "PodSchedulingContext"
content_type: "api_reference"
description: "PodSchedulingContext 对象包含使用 \"WaitForFirstConsumer\" 分配模式的 ResourceClaims 来调度 Pod 所需的信息。"
title: "PodSchedulingContext v1alpha2"
weight: 14
---
`apiVersion: resource.k8s.io/v1alpha2`
`import "k8s.io/api/resource/v1alpha2"`
## PodSchedulingContext {#PodSchedulingContext}
PodSchedulingContext 对象包含调度某些 Pod 所需要的额外信息,这些 Pod 使用了
“WaitForFirstConsumer” 分配模式的 ResourceClaim。
本功能特性是 Alpha 级别的特性,需要启用 DynamicResourceAllocation 特性门控。
- **apiVersion**: resource.k8s.io/v1alpha2
- **kind**: PodSchedulingContext
- **metadata** (}}">ObjectMeta)
标准的对象元数据。
- **spec** (}}">PodSchedulingContextSpec),必需
spec 描述了 Pod 需要在哪里找到资源。
- **status** (}}">PodSchedulingContextStatus)
status 描述了 Pod 的资源可以在哪里分配。
## PodSchedulingContextSpec {#PodSchedulingContextSpec}
PodSchedulingContextSpec 描述了 Pod 所需要的资源在哪里。
- **potentialNodes** ([]string)
**集合:合并期间保留唯一值**
potentialNodes 列出可以运行 Pod 的节点。
该字段的大小限制为 128。对于许多集群来说,这已经足够大了。
较大的集群可能需要更多的尝试去找到一个适合所有待定资源的节点。
这个限制值可能会在以后提高,但不会降低。
- **selectedNode** (string)
selectedNode 是一个节点,由 Pod 引用的 ResourceClaim 将在此节点上尝试,
且尝试的分配模式是 “WaitForFirstConsumer”。
## PodSchedulingContextStatus {#PodSchedulingContextStatus}
PodSchedulingContextStatus 描述 Pod 的资源可以从哪里分配。
- **resourceClaims** ([]ResourceClaimSchedulingStatus)
**映射:键 `name` 的唯一值将在合并过程中保留**
resourceClaims 描述了每个 pod.spec.resourceClaim 条目的资源可用性,
其中对应的 ResourceClaim 使用 “WaitForFirstConsumer” 分配模式。
**ResourceClaimSchedulingStatus 包含关于一个采用 “WaitForFirstConsumer”
分配模式的特定 ResourceClaim 的信息。**
- **resourceClaims.name** (string)
name 与 pod.spec.resourceClaims[*].name 字段匹配。
- **resourceClaims.unsuitableNodes** ([]string)
**集合:合并期间保留唯一值**
unsuitableNodes 列出 ResourceClaim 无法被分配的节点。
该字段的大小限制为 128,与 PodSchedulingSpec.PotentialNodes 相同。
这可能会在以后增加,但不会减少。
## PodSchedulingContextList {#PodSchedulingContextList}
PodSchedulingContextList 是 Pod 调度对象的集合。
- **apiVersion**: resource.k8s.io/v1alpha2
- **kind**: PodSchedulingContextList
- **metadata** (}}">ListMeta)
标准的列表元数据。
- **items** ([]}}">PodSchedulingContext),必需
items 是 PodSchedulingContext 对象的列表。
## 操作 {#Operations}
### `get` 读取指定的 PodSchedulingContext
#### HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
401: Unauthorized
### `get` 读取指定 PodSchedulingContext 的状态
#### HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
401: Unauthorized
### `list` 列出或监视 PodSchedulingContext 类别的对象
#### HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts
#### 参数
- **namespace**(**路径参数**):string,必需
}}">namespace
- **allowWatchBookmarks**(**查询参数**):boolean
}}">allowWatchBookmarks
- **continue**(**查询参数**):string
}}">continue
- **fieldSelector**(**查询参数**):string
}}">fieldSelector
- **labelSelector**(**查询参数**):string
}}">labelSelector
- **limit**(**查询参数**):integer
}}">limit
- **pretty**(**查询参数**):string
}}">pretty
- **resourceVersion**(**查询参数**):string
}}">resourceVersion
- **resourceVersionMatch**(**查询参数**):string
}}">resourceVersionMatch
- **sendInitialEvents**(**查询参数**):boolean
}}">sendInitialEvents
- **timeoutSeconds**(**查询参数**):integer
}}">timeoutSeconds
- **watch**(**查询参数**):boolean
}}">watch
#### 响应
200 (}}">PodSchedulingContextList): OK
401: Unauthorized
### `list` 列出或监视 PodSchedulingContext 类别的对象
#### HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/podschedulingcontexts
#### 参数
- **allowWatchBookmarks**(**查询参数**):boolean
}}">allowWatchBookmarks
- **continue**(**查询参数**):string
}}">continue
- **fieldSelector**(**查询参数**):string
}}">fieldSelector
- **labelSelector**(**查询参数**):string
}}">labelSelector
- **limit**(**查询参数**):integer
}}">limit
- **pretty**(**查询参数**):string
}}">pretty
- **resourceVersion**(**查询参数**):string
}}">resourceVersion
- **resourceVersionMatch**(**查询参数**):string
}}">resourceVersionMatch
- **sendInitialEvents**(**查询参数**):boolean
}}">sendInitialEvents
- **timeoutSeconds**(**查询参数**):integer
}}">timeoutSeconds
- **watch**(**查询参数**):boolean
}}">watch
#### 响应
200 (}}">PodSchedulingContextList): OK
401: Unauthorized
### `create` 创建 PodSchedulingContext
#### HTTP 请求
POST /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts
#### 参数
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">PodSchedulingContext,必需
- **dryRun**(**查询参数**):string
}}">dryRun
- **fieldManager**(**查询参数**):string
}}">fieldManager
- **fieldValidation**(**查询参数**):string
}}">fieldValidation
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
201 (}}">PodSchedulingContext): Created
202 (}}">PodSchedulingContext): Accepted
401: Unauthorized
### `update` 替换指定的 PodSchedulingContext
#### HTTP 请求
PUT /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">PodSchedulingContext,必需
- **dryRun**(**查询参数**):string
}}">dryRun
- **fieldManager**(**查询参数**):string
}}">fieldManager
- **fieldValidation**(**查询参数**):string
}}">fieldValidation
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
201 (}}">PodSchedulingContext): Created
401: Unauthorized
### `update` 替换指定 PodSchedulingContext 的状态
#### HTTP 请求
PUT /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">PodSchedulingContext,必需
- **dryRun**(**查询参数**):string
}}">dryRun
- **fieldManager**(**查询参数**):string
}}">fieldManager
- **fieldValidation**(**查询参数**):string
}}">fieldValidation
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
201 (}}">PodSchedulingContext): Created
401: Unauthorized
### `patch` 部分更新指定的 PodSchedulingContext
#### HTTP 请求
PATCH /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">Patch,必需
- **dryRun**(**查询参数**):string
}}">dryRun
- **fieldManager**(**查询参数**):string
}}">fieldManager
- **fieldValidation**(**查询参数**):string
}}">fieldValidation
- **force**(**查询参数**):boolean
}}">force
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
201 (}}">PodSchedulingContext): Created
401: Unauthorized
### `patch` 部分更新指定 PodSchedulingContext 的状态
#### HTTP 请求
PATCH /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}/status
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">Patch,必需
- **dryRun**(**查询参数**):string
}}">dryRun
- **fieldManager**(**查询参数**):string
}}">fieldManager
- **fieldValidation**(**查询参数**):string
}}">fieldValidation
- **force**(**查询参数**):boolean
}}">force
- **pretty**(**查询参数**):string
}}">pretty
#### 响应
200 (}}">PodSchedulingContext): OK
201 (}}">PodSchedulingContext): Created
401: Unauthorized
### `delete` 删除 PodSchedulingContext
#### HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts/{name}
#### 参数
- **name**(**路径参数**):string,必需
PodSchedulingContext 的名称。
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">DeleteOptions
- **dryRun**(**查询参数**):string
}}">dryRun
- **gracePeriodSeconds**(**查询参数**):integer
}}">gracePeriodSeconds
- **pretty**(**查询参数**):string
}}">pretty
- **propagationPolicy**(**查询参数**):string
}}">propagationPolicy
#### 响应
200 (}}">PodSchedulingContext): OK
202 (}}">PodSchedulingContext): Accepted
401: Unauthorized
### `deletecollection` 删除 PodSchedulingContext 的集合
#### HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/podschedulingcontexts
#### 参数
- **namespace**(**路径参数**):string,必需
}}">namespace
- **body**: }}">DeleteOptions
- **continue**(**查询参数**):string
}}">continue
- **dryRun**(**查询参数**):string
}}">dryRun
- **fieldSelector**(**查询参数**):string
}}">fieldSelector
- **gracePeriodSeconds**(**查询参数**):integer
}}">gracePeriodSeconds
- **labelSelector**(**查询参数**):string
}}">labelSelector
- **limit**(**查询参数**):integer
}}">limit
- **pretty**(**查询参数**):string
}}">pretty
- **propagationPolicy**(**查询参数**):string
}}">propagationPolicy
- **resourceVersion**(**查询参数**):string
}}">resourceVersion
- **resourceVersionMatch**(**查询参数**):string
}}">resourceVersionMatch
- **sendInitialEvents**(**查询参数**):boolean
}}">sendInitialEvents
- **timeoutSeconds**(**查询参数**):integer
}}">timeoutSeconds
#### 响应
200 (}}">Status): OK
401: Unauthorized