kubernetes reference title ResourceSlice v1alpha3 contenttype apireference apiVersion resource k8s io v1alpha3 weight 18 import k8s io api resource v1alpha3 apimetadata ResourceSlice represents one or more resources in a pool of similar resources managed by a common driver autogenerated true kind ResourceSlice

Answer:
---
api_metadata:
  apiVersion: "resource.k8s.io/v1alpha3"
  import: "k8s.io/api/resource/v1alpha3"
  kind: "ResourceSlice"
content_type: "api_reference"
description: "ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver."
title: "ResourceSlice v1alpha3"
weight: 18
auto_generated: true
---

`apiVersion: resource.k8s.io/v1alpha3`

`import "k8s.io/api/resource/v1alpha3"`

## ResourceSlice {#ResourceSlice}

ResourceSlice represents one or more resources in a pool of similar resources, managed by a common driver. A pool may span more than one ResourceSlice, and exactly how many ResourceSlices comprise a pool is determined by the driver.

At the moment, the only supported resources are devices with attributes and capacities. Each device in a given pool, regardless of how many ResourceSlices, must have a unique name. The ResourceSlice in which a device gets published may change over time. The unique identifier for a device is the tuple \<driver name>, \<pool name>, \<device name>.

Whenever a driver needs to update a pool, it increments the pool.Spec.Pool.Generation number and updates all ResourceSlices with that new number and new resource definitions. A consumer must only use ResourceSlices with the highest generation number and ignore all others.

When allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives, a consumer should check the number of ResourceSlices in a pool (included in each ResourceSlice) to determine whether its view of a pool is complete and if not, should wait until the driver has completed updating the pool.

For resources that are not local to a node, the node name is not set. Instead, the driver may use a node selector to specify where the devices are available.

This is an alpha type and requires enabling the DynamicResourceAllocation feature gate.

- **apiVersion**: resource.k8s.io/v1alpha3

- **kind**: ResourceSlice

- **metadata** (ObjectMeta)

  Standard object metadata

- **spec** (ResourceSliceSpec), required

  Contains the information published by the driver.

  Changing the spec automatically increments the metadata.generation number.

## ResourceSliceSpec {#ResourceSliceSpec}

ResourceSliceSpec contains the information published by the driver in one ResourceSlice.

- **driver** (string), required

  Driver identifies the DRA driver providing the capacity information. A field selector can be used to list only ResourceSlice objects with a certain driver name.

  Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. This field is immutable.

- **pool** (ResourcePool), required

  Pool describes the pool that this ResourceSlice belongs to.

  *ResourcePool describes the pool that ResourceSlices belong to.*

  - **pool.generation** (int64), required

    Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.

    Combined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.

  - **pool.name** (string), required

    Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.

    It must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.

  - **pool.resourceSliceCount** (int64), required

    ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero.

    Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.

- **allNodes** (boolean)

  AllNodes indicates that all nodes have access to the resources in the pool.

  Exactly one of NodeName, NodeSelector and AllNodes must be set.

- **devices** ([]Device)

  *Atomic: will be replaced during a merge*

  Devices lists some or all of the devices in this pool.

  Must not have more than 128 entries.

  *Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.*

  - **devices.name** (string), required

    Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.

  - **devices.basic** (BasicDevice)

    Basic defines one device instance.

    *BasicDevice defines one device instance.*

    - **devices.basic.attributes** (map[string]DeviceAttribute)

      Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.

      The maximum number of attributes and capacities combined is 32.

      *DeviceAttribute must have exactly one field set.*

      - **devices.basic.attributes.bool** (boolean)

        BoolValue is a true/false value.

      - **devices.basic.attributes.int** (int64)

        IntValue is a number.

      - **devices.basic.attributes.string** (string)

        StringValue is a string. Must not be longer than 64 characters.

      - **devices.basic.attributes.version** (string)

        VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters.

    - **devices.basic.capacity** (map[string]Quantity)

      Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.

      The maximum number of attributes and capacities combined is 32.

- **nodeName** (string)

  NodeName identifies the node which provides the resources in this pool. A field selector can be used to list only ResourceSlice objects belonging to a certain node.

  This field can be used to limit access from nodes to ResourceSlices with the same node name. It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available.

  Exactly one of NodeName, NodeSelector and AllNodes must be set. This field is immutable.

- **nodeSelector** (NodeSelector)

  NodeSelector defines which nodes have access to the resources in the pool, when that pool is not limited to a single node.

  Must use exactly one term.

  Exactly one of NodeName, NodeSelector and AllNodes must be set.

  *A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.*

  - **nodeSelector.nodeSelectorTerms** ([]NodeSelectorTerm), required

    *Atomic: will be replaced during a merge*

    Required. A list of node selector terms. The terms are ORed.

    *A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.*

    - **nodeSelector.nodeSelectorTerms.matchExpressions** ([]NodeSelectorRequirement)

      *Atomic: will be replaced during a merge*

      A list of node selector requirements by node's labels.

    - **nodeSelector.nodeSelectorTerms.matchFields** ([]NodeSelectorRequirement)

      *Atomic: will be replaced during a merge*

      A list of node selector requirements by node's fields.

## ResourceSliceList {#ResourceSliceList}

ResourceSliceList is a collection of ResourceSlices.

- **apiVersion**: resource.k8s.io/v1alpha3

- **kind**: ResourceSliceList

- **items** ([]ResourceSlice), required

  Items is the list of resource ResourceSlices.

- **metadata** (ListMeta)

  Standard list metadata

## Operations {#Operations}

### `get` read the specified ResourceSlice

#### HTTP Request

GET /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

#### Parameters

- **name** (*in path*): string, required

  name of the ResourceSlice

- **pretty** (*in query*): string

  pretty

#### Response

200 (ResourceSlice): OK

401: Unauthorized

### `list` list or watch objects of kind ResourceSlice

#### HTTP Request

GET /apis/resource.k8s.io/v1alpha3/resourceslices

#### Parameters

- **allowWatchBookmarks** (*in query*): boolean

  allowWatchBookmarks

- **continue** (*in query*): string

  continue

- **fieldSelector** (*in query*): string

  fieldSelector

- **labelSelector** (*in query*): string

  labelSelector

- **limit** (*in query*): integer

  limit

- **pretty** (*in query*): string

  pretty

- **resourceVersion** (*in query*): string

  resourceVersion

- **resourceVersionMatch** (*in query*): string

  resourceVersionMatch

- **sendInitialEvents** (*in query*): boolean

  sendInitialEvents

- **timeoutSeconds** (*in query*): integer

  timeoutSeconds

- **watch** (*in query*): boolean

  watch

#### Response

200 (ResourceSliceList): OK

401: Unauthorized

### `create` create a ResourceSlice

#### HTTP Request

POST /apis/resource.k8s.io/v1alpha3/resourceslices

#### Parameters

- **body**: ResourceSlice, required

- **dryRun** (*in query*): string

  dryRun

- **fieldManager** (*in query*): string

  fieldManager

- **fieldValidation** (*in query*): string

  fieldValidation

- **pretty** (*in query*): string

  pretty

#### Response

200 (ResourceSlice): OK

201 (ResourceSlice): Created

202 (ResourceSlice): Accepted

401: Unauthorized

### `update` replace the specified ResourceSlice

#### HTTP Request

PUT /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

#### Parameters

- **name** (*in path*): string, required

  name of the ResourceSlice

- **body**: ResourceSlice, required

- **dryRun** (*in query*): string

  dryRun

- **fieldManager** (*in query*): string

  fieldManager

- **fieldValidation** (*in query*): string

  fieldValidation

- **pretty** (*in query*): string

  pretty

#### Response

200 (ResourceSlice): OK

201 (ResourceSlice): Created

401: Unauthorized

### `patch` partially update the specified ResourceSlice

#### HTTP Request

PATCH /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

#### Parameters

- **name** (*in path*): string, required

  name of the ResourceSlice

- **body**: Patch, required

- **dryRun** (*in query*): string

  dryRun

- **fieldManager** (*in query*): string

  fieldManager

- **fieldValidation** (*in query*): string

  fieldValidation

- **force** (*in query*): boolean

  force

- **pretty** (*in query*): string

  pretty

#### Response

200 (ResourceSlice): OK

201 (ResourceSlice): Created

401: Unauthorized

### `delete` delete a ResourceSlice

#### HTTP Request

DELETE /apis/resource.k8s.io/v1alpha3/resourceslices/{name}

#### Parameters

- **name** (*in path*): string, required

  name of the ResourceSlice

- **body**: DeleteOptions

- **dryRun** (*in query*): string

  dryRun

- **gracePeriodSeconds** (*in query*): integer

  gracePeriodSeconds

- **pretty** (*in query*): string

  pretty

- **propagationPolicy** (*in query*): string

  propagationPolicy

#### Response

200 (ResourceSlice): OK

202 (ResourceSlice): Accepted

401: Unauthorized

### `deletecollection` delete collection of ResourceSlice

#### HTTP Request

DELETE /apis/resource.k8s.io/v1alpha3/resourceslices

#### Parameters

- **body**: DeleteOptions

- **continue** (*in query*): string

  continue

- **dryRun** (*in query*): string

  dryRun

- **fieldSelector** (*in query*): string

  fieldSelector

- **gracePeriodSeconds** (*in query*): integer

  gracePeriodSeconds

- **labelSelector** (*in query*): string

  labelSelector

- **limit** (*in query*): integer

  limit

- **pretty** (*in query*): string

  pretty

- **propagationPolicy** (*in query*): string

  propagationPolicy

- **resourceVersion** (*in query*): string

  resourceVersion

- **resourceVersionMatch** (*in query*): string

  resourceVersionMatch

- **sendInitialEvents** (*in query*): boolean

  sendInitialEvents

- **timeoutSeconds** (*in query*): integer

  timeoutSeconds

#### Response

200 (Status): OK

401: Unauthorized

api metadata    apiVersion   resource k8s io v1alpha3    import   k8s io api resource v1alpha3    kind   ResourceSlice  content type   api reference  description   ResourceSlice represents one or more resources in a pool of similar resources  managed by a common driver   title   ResourceSlice v1alpha3  weight  18 auto generated  true           The file is auto generated from the Go source code of the component using a generic  generator  https   github com kubernetes sigs reference docs    To learn how to generate the reference documentation  please read  Contributing to the reference documentation   docs contribute generate ref docs    To update the reference content  please follow the   Contributing upstream   docs contribute generate ref docs contribute upstream   guide  You can file document formatting bugs against the  reference docs  https   github com kubernetes sigs reference docs   project        apiVersion  resource k8s io v1alpha3    import  k8s io api resource v1alpha3        ResourceSlice   ResourceSlice   ResourceSlice represents one or more resources in a pool of similar resources  managed by a common driver  A pool may span more than one ResourceSlice  and exactly how many ResourceSlices comprise a pool is determined by the driver   At the moment  the only supported resources are devices with attributes and capacities  Each device in a given pool  regardless of how many ResourceSlices  must have a unique name  The ResourceSlice in which a device gets published may change over time  The unique identifier for a device is the tuple   driver name     pool name     device name    Whenever a driver needs to update a pool  it increments the pool Spec Pool Generation number and updates all ResourceSlices with that new number and new resource definitions  A consumer must only use ResourceSlices with the highest generation number and ignore all others   When allocating all resources in a pool matching certain criteria or when looking for the best solution among several different alternatives  a consumer should check the number of ResourceSlices in a pool  included in each ResourceSlice  to determine whether its view of a pool is complete and if not  should wait until the driver has completed updating the pool   For resources that are not local to a node  the node name is not set  Instead  the driver may use a node selector to specify where the devices are available   This is an alpha type and requires enabling the DynamicResourceAllocation feature gate    hr       apiVersion    resource k8s io v1alpha3       kind    ResourceSlice       metadata     a href    ObjectMeta  a      Standard object metadata      spec     a href    ResourceSliceSpec  a    required    Contains the information published by the driver       Changing the spec automatically increments the metadata generation number          ResourceSliceSpec   ResourceSliceSpec   ResourceSliceSpec contains the information published by the driver in one ResourceSlice    hr       driver    string   required    Driver identifies the DRA driver providing the capacity information  A field selector can be used to list only ResourceSlice objects with a certain driver name       Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver  This field is immutable       pool    ResourcePool   required    Pool describes the pool that this ResourceSlice belongs to      a name  ResourcePool    a     ResourcePool describes the pool that ResourceSlices belong to          pool generation    int64   required      Generation tracks the change in a pool over time  Whenever a driver changes something about one or more of the resources in a pool  it must change the generation in all ResourceSlices which are part of that pool  Consumers of ResourceSlices should only consider resources from the pool with the highest generation number  The generation may be reset by drivers  which should be fine for consumers  assuming that all ResourceSlices in a pool are updated to match or deleted           Combined with ResourceSliceCount  this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state         pool name    string   required      Name is used to identify the pool  For node local devices  this is often the node name  but this is not required           It must not be longer than 253 characters and must consist of one or more DNS sub domains separated by slashes  This field is immutable         pool resourceSliceCount    int64   required      ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number  Must be greater than zero           Consumers can use this to check whether they have seen all ResourceSlices belonging to the same pool       allNodes    boolean     AllNodes indicates that all nodes have access to the resources in the pool       Exactly one of NodeName  NodeSelector and AllNodes must be set       devices      Device      Atomic  will be replaced during a merge       Devices lists some or all of the devices in this pool       Must not have more than 128 entries      a name  Device    a     Device represents one individual hardware instance that can be selected based on its attributes  Besides the name  exactly one field must be set          devices name    string   required      Name is unique identifier among all devices managed by the driver in the pool  It must be a DNS label         devices basic    BasicDevice       Basic defines one device instance        a name  BasicDevice    a       BasicDevice defines one device instance            devices basic attributes    map string DeviceAttribute         Attributes defines the set of attributes for this device  The name of each attribute must be unique in that set               The maximum number of attributes and capacities combined is 32          a name  DeviceAttribute    a         DeviceAttribute must have exactly one field set              devices basic attributes bool    boolean           BoolValue is a true false value             devices basic attributes int    int64           IntValue is a number             devices basic attributes string    string           StringValue is a string  Must not be longer than 64 characters             devices basic attributes version    string           VersionValue is a semantic version according to semver org spec 2 0 0  Must not be longer than 64 characters           devices basic capacity    map string  a href    Quantity  a          Capacity defines the set of capacities for this device  The name of each capacity must be unique in that set               The maximum number of attributes and capacities combined is 32       nodeName    string     NodeName identifies the node which provides the resources in this pool  A field selector can be used to list only ResourceSlice objects belonging to a certain node       This field can be used to limit access from nodes to ResourceSlices with the same node name  It also indicates to autoscalers that adding new nodes of the same type as some old node might also make new resources available       Exactly one of NodeName  NodeSelector and AllNodes must be set  This field is immutable       nodeSelector    NodeSelector     NodeSelector defines which nodes have access to the resources in the pool  when that pool is not limited to a single node       Must use exactly one term       Exactly one of NodeName  NodeSelector and AllNodes must be set      a name  NodeSelector    a     A node selector represents the union of the results of one or more label queries over a set of nodes  that is  it represents the OR of the selectors represented by the node selector terms          nodeSelector nodeSelectorTerms      NodeSelectorTerm   required       Atomic  will be replaced during a merge           Required  A list of node selector terms  The terms are ORed        a name  NodeSelectorTerm    a       A null or empty node selector term matches no objects  The requirements of them are ANDed  The TopologySelectorTerm type implements a subset of the NodeSelectorTerm            nodeSelector nodeSelectorTerms matchExpressions       a href    NodeSelectorRequirement  a           Atomic  will be replaced during a merge               A list of node selector requirements by node s labels           nodeSelector nodeSelectorTerms matchFields       a href    NodeSelectorRequirement  a           Atomic  will be replaced during a merge               A list of node selector requirements by node s fields          ResourceSliceList   ResourceSliceList   ResourceSliceList is a collection of ResourceSlices    hr       apiVersion    resource k8s io v1alpha3       kind    ResourceSliceList       items       a href    ResourceSlice  a    required    Items is the list of resource ResourceSlices       metadata     a href    ListMeta  a      Standard list metadata         Operations   Operations      hr             get  read the specified ResourceSlice       HTTP Request  GET  apis resource k8s io v1alpha3 resourceslices  name        Parameters       name     in path    string  required    name of the ResourceSlice       pretty     in query    string     a href    pretty  a          Response   200   a href    ResourceSlice  a    OK  401  Unauthorized        list  list or watch objects of kind ResourceSlice       HTTP Request  GET  apis resource k8s io v1alpha3 resourceslices       Parameters       allowWatchBookmarks     in query    boolean     a href    allowWatchBookmarks  a        continue     in query    string     a href    continue  a        fieldSelector     in query    string     a href    fieldSelector  a        labelSelector     in query    string     a href    labelSelector  a        limit     in query    integer     a href    limit  a        pretty     in query    string     a href    pretty  a        resourceVersion     in query    string     a href    resourceVersion  a        resourceVersionMatch     in query    string     a href    resourceVersionMatch  a        sendInitialEvents     in query    boolean     a href    sendInitialEvents  a        timeoutSeconds     in query    integer     a href    timeoutSeconds  a        watch     in query    boolean     a href    watch  a          Response   200   a href    ResourceSliceList  a    OK  401  Unauthorized        create  create a ResourceSlice       HTTP Request  POST  apis resource k8s io v1alpha3 resourceslices       Parameters       body     a href    ResourceSlice  a   required           dryRun     in query    string     a href    dryRun  a        fieldManager     in query    string     a href    fieldManager  a        fieldValidation     in query    string     a href    fieldValidation  a        pretty     in query    string     a href    pretty  a          Response   200   a href    ResourceSlice  a    OK  201   a href    ResourceSlice  a    Created  202   a href    ResourceSlice  a    Accepted  401  Unauthorized        update  replace the specified ResourceSlice       HTTP Request  PUT  apis resource k8s io v1alpha3 resourceslices  name        Parameters       name     in path    string  required    name of the ResourceSlice       body     a href    ResourceSlice  a   required           dryRun     in query    string     a href    dryRun  a        fieldManager     in query    string     a href    fieldManager  a        fieldValidation     in query    string     a href    fieldValidation  a        pretty     in query    string     a href    pretty  a          Response   200   a href    ResourceSlice  a    OK  201   a href    ResourceSlice  a    Created  401  Unauthorized        patch  partially update the specified ResourceSlice       HTTP Request  PATCH  apis resource k8s io v1alpha3 resourceslices  name        Parameters       name     in path    string  required    name of the ResourceSlice       body     a href    Patch  a   required           dryRun     in query    string     a href    dryRun  a        fieldManager     in query    string     a href    fieldManager  a        fieldValidation     in query    string     a href    fieldValidation  a        force     in query    boolean     a href    force  a        pretty     in query    string     a href    pretty  a          Response   200   a href    ResourceSlice  a    OK  201   a href    ResourceSlice  a    Created  401  Unauthorized        delete  delete a ResourceSlice       HTTP Request  DELETE  apis resource k8s io v1alpha3 resourceslices  name        Parameters       name     in path    string  required    name of the ResourceSlice       body     a href    DeleteOptions  a            dryRun     in query    string     a href    dryRun  a        gracePeriodSeconds     in query    integer     a href    gracePeriodSeconds  a        pretty     in query    string     a href    pretty  a        propagationPolicy     in query    string     a href    propagationPolicy  a          Response   200   a href    ResourceSlice  a    OK  202   a href    ResourceSlice  a    Accepted  401  Unauthorized        deletecollection  delete collection of ResourceSlice       HTTP Request  DELETE  apis resource k8s io v1alpha3 resourceslices       Parameters       body     a href    DeleteOptions  a            continue     in query    string     a href    continue  a        dryRun     in query    string     a href    dryRun  a        fieldSelector     in query    string     a href    fieldSelector  a        gracePeriodSeconds     in query    integer     a href    gracePeriodSeconds  a        labelSelector     in query    string     a href    labelSelector  a        limit     in query    integer     a href    limit  a        pretty     in query    string     a href    pretty  a        propagationPolicy     in query    string     a href    propagationPolicy  a        resourceVersion     in query    string     a href    resourceVersion  a        resourceVersionMatch     in query    string     a href    resourceVersionMatch  a        sendInitialEvents     in query    boolean     a href    sendInitialEvents  a        timeoutSeconds     in query    integer     a href    timeoutSeconds  a          Response   200   a href    Status  a    OK  401  Unauthorized