kubernetes reference CSIDriver captures information about a Container Storage Interface CSI volume driver deployed on the cluster autogenerated true kind CSIDriver contenttype apireference apimetadata apiVersion storage k8s io v1 weight 3 title CSIDriver import k8s io api storage v1

Answer:
---
api_metadata:
  apiVersion: "storage.k8s.io/v1"
  import: "k8s.io/api/storage/v1"
  kind: "CSIDriver"
content_type: "api_reference"
description: "CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster."
title: "CSIDriver"
weight: 3
auto_generated: true
---

`apiVersion: storage.k8s.io/v1`

`import "k8s.io/api/storage/v1"`

## CSIDriver {#CSIDriver}

CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced.

- **apiVersion**: storage.k8s.io/v1

- **kind**: CSIDriver

- **metadata** (ObjectMeta)

  Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

- **spec** (CSIDriverSpec), required

  spec represents the specification of the CSI Driver.

## CSIDriverSpec {#CSIDriverSpec}

CSIDriverSpec is the specification of a CSIDriver.

- **attachRequired** (boolean)

  attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the CSIDriverRegistry feature gate is enabled and the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called.

  This field is immutable.

- **fsGroupPolicy** (string)

  fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details.

  This field was immutable in Kubernetes \< 1.29 and now is mutable.

  Defaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce.

- **podInfoOnMount** (boolean)

  podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false.

  The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext.

  The following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. "csi.storage.k8s.io/pod.name": pod.Name "csi.storage.k8s.io/pod.namespace": pod.Namespace "csi.storage.k8s.io/pod.uid": string(pod.UID) "csi.storage.k8s.io/ephemeral": "true" if the volume is an ephemeral inline volume
                                  defined by a CSIVolumeSource, otherwise "false"

  "csi.storage.k8s.io/ephemeral" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the "Persistent" and "Ephemeral" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver.

  This field was immutable in Kubernetes \< 1.29 and now is mutable.

- **requiresRepublish** (boolean)

  requiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false.

  Note: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container.

- **seLinuxMount** (boolean)

  seLinuxMount specifies if the CSI driver supports "-o context" mount option.

  When "true", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with "-o context=xyz" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context.

  When "false", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem.

  Default is "false".

- **storageCapacity** (boolean)

  storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true.

  The check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object.

  Alternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published.

  This field was immutable in Kubernetes \<= 1.22 and now is mutable.

- **tokenRequests** ([]TokenRequest)

  *Atomic: will be replaced during a merge*

  tokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: "csi.storage.k8s.io/serviceAccount.tokens": {
    "\<audience>": {
      "token": \<token>,
      "expirationTimestamp": \<expiration timestamp in RFC3339>,
    },
    ...
  }

  Note: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically.

  *TokenRequest contains parameters of a service account token.*

  - **tokenRequests.audience** (string), required

    audience is the intended audience of the token in "TokenRequestSpec". It will default to the audiences of kube apiserver.

  - **tokenRequests.expirationSeconds** (int64)

    expirationSeconds is the duration of validity of the token in "TokenRequestSpec". It has the same default value of "ExpirationSeconds" in "TokenRequestSpec".

- **volumeLifecycleModes** ([]string)

  *Set: unique values will be kept during a merge*

  volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is "Persistent", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism.

  The other mode is "Ephemeral". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume.

  For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future.

  This field is beta. This field is immutable.

## CSIDriverList {#CSIDriverList}

CSIDriverList is a collection of CSIDriver objects.

- **apiVersion**: storage.k8s.io/v1

- **kind**: CSIDriverList

- **metadata** (ListMeta)

  Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

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

  items is the list of CSIDriver

## Operations {#Operations}

### `get` read the specified CSIDriver

#### HTTP Request

GET /apis/storage.k8s.io/v1/csidrivers/{name}

#### Parameters

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

  name of the CSIDriver

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

  pretty

#### Response

200 (CSIDriver): OK

401: Unauthorized

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

#### HTTP Request

GET /apis/storage.k8s.io/v1/csidrivers

#### 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 (CSIDriverList): OK

401: Unauthorized

### `create` create a CSIDriver

#### HTTP Request

POST /apis/storage.k8s.io/v1/csidrivers

#### Parameters

- **body**: CSIDriver, required

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

  dryRun

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

  fieldManager

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

  fieldValidation

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

  pretty

#### Response

200 (CSIDriver): OK

201 (CSIDriver): Created

202 (CSIDriver): Accepted

401: Unauthorized

### `update` replace the specified CSIDriver

#### HTTP Request

PUT /apis/storage.k8s.io/v1/csidrivers/{name}

#### Parameters

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

  name of the CSIDriver

- **body**: CSIDriver, required

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

  dryRun

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

  fieldManager

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

  fieldValidation

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

  pretty

#### Response

200 (CSIDriver): OK

201 (CSIDriver): Created

401: Unauthorized

### `patch` partially update the specified CSIDriver

#### HTTP Request

PATCH /apis/storage.k8s.io/v1/csidrivers/{name}

#### Parameters

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

  name of the CSIDriver

- **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 (CSIDriver): OK

201 (CSIDriver): Created

401: Unauthorized

### `delete` delete a CSIDriver

#### HTTP Request

DELETE /apis/storage.k8s.io/v1/csidrivers/{name}

#### Parameters

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

  name of the CSIDriver

- **body**: DeleteOptions

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

  dryRun

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

  gracePeriodSeconds

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

  pretty

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

  propagationPolicy

#### Response

200 (CSIDriver): OK

202 (CSIDriver): Accepted

401: Unauthorized

### `deletecollection` delete collection of CSIDriver

#### HTTP Request

DELETE /apis/storage.k8s.io/v1/csidrivers

#### 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   storage k8s io v1    import   k8s io api storage v1    kind   CSIDriver  content type   api reference  description   CSIDriver captures information about a Container Storage Interface  CSI  volume driver deployed on the cluster   title   CSIDriver  weight  3 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  storage k8s io v1    import  k8s io api storage v1        CSIDriver   CSIDriver   CSIDriver captures information about a Container Storage Interface  CSI  volume driver deployed on the cluster  Kubernetes attach detach controller uses this object to determine whether attach is required  Kubelet uses this object to determine whether pod information needs to be passed on mount  CSIDriver objects are non namespaced    hr       apiVersion    storage k8s io v1       kind    CSIDriver       metadata     a href    ObjectMeta  a      Standard object metadata  metadata Name indicates the name of the CSI driver that this object refers to  it MUST be the same name returned by the CSI GetPluginName   call for that driver  The driver name must be 63 characters or less  beginning and ending with an alphanumeric character   a z0 9A Z   with dashes      dots      and alphanumerics between  More info  https   git k8s io community contributors devel sig architecture api conventions md metadata      spec     a href    CSIDriverSpec  a    required    spec represents the specification of the CSI Driver          CSIDriverSpec   CSIDriverSpec   CSIDriverSpec is the specification of a CSIDriver    hr       attachRequired    boolean     attachRequired indicates this CSI volume driver requires an attach operation  because it implements the CSI ControllerPublishVolume   method   and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting  The CSI external attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete  If the CSIDriverRegistry feature gate is enabled and the value is specified to false  the attach operation will be skipped  Otherwise the attach operation will be called       This field is immutable       fsGroupPolicy    string     fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted  Refer to the specific FSGroupPolicy values for additional details       This field was immutable in Kubernetes    1 29 and now is mutable       Defaults to ReadWriteOnceWithFSType  which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume  With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume s access mode contains ReadWriteOnce       podInfoOnMount    boolean     podInfoOnMount indicates this CSI volume driver requires additional pod information  like podName  podUID  etc   during mount operations  if set to true  If set to false  pod information will not be passed on mount  Default is false       The CSI driver specifies podInfoOnMount as part of driver deployment  If true  Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume   calls  The CSI driver is responsible for parsing and validating the information passed in as VolumeContext       The following VolumeContext will be passed if podInfoOnMount is set to true  This list might grow  but the prefix will be used   csi storage k8s io pod name   pod Name  csi storage k8s io pod namespace   pod Namespace  csi storage k8s io pod uid   string pod UID   csi storage k8s io ephemeral    true  if the volume is an ephemeral inline volume                                   defined by a CSIVolumeSource  otherwise  false        csi storage k8s io ephemeral  is a new feature in Kubernetes 1 16  It is only required for drivers which support both the  Persistent  and  Ephemeral  VolumeLifecycleMode  Other drivers can leave pod info disabled and or ignore this field  As Kubernetes 1 15 doesn t support this field  drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is  for example via a command line parameter of the driver       This field was immutable in Kubernetes    1 29 and now is mutable       requiresRepublish    boolean     requiresRepublish indicates the CSI driver wants  NodePublishVolume  being periodically called to reflect any possible change in the mounted volume  This field defaults to false       Note  After a successful initial NodePublishVolume call  subsequent calls to NodePublishVolume should only update the contents of the volume  New mount points will not be seen by a running container       seLinuxMount    boolean     seLinuxMount specifies if the CSI driver supports   o context  mount option       When  true   the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different   o context  options  This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes  Kubernetes will call NodeStage   NodePublish with   o context xyz  mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context  In the future  it may be expanded to other volume AccessModes  In any case  Kubernetes will ensure that the volume is mounted only with a single SELinux context       When  false   Kubernetes won t pass any special SELinux mount options to the driver  This is typical for volumes that represent subdirectories of a bigger shared filesystem       Default is  false        storageCapacity    boolean     storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information  if set to true       The check can be enabled immediately when deploying a driver  In that case  provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object       Alternatively  the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published       This field was immutable in Kubernetes     1 22 and now is mutable       tokenRequests      TokenRequest      Atomic  will be replaced during a merge       tokenRequests indicates the CSI driver needs pods  service account tokens it is mounting volume for to do necessary authentication  Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls  The CSI driver should parse and validate the following VolumeContext   csi storage k8s io serviceAccount tokens            audience             token     token          expirationTimestamp     expiration timestamp in RFC3339                           Note  Audience in each TokenRequest should be different and at most one token is empty string  To receive a new token after expiry  RequiresRepublish can be used to trigger NodePublishVolume periodically      a name  TokenRequest    a     TokenRequest contains parameters of a service account token          tokenRequests audience    string   required      audience is the intended audience of the token in  TokenRequestSpec   It will default to the audiences of kube apiserver         tokenRequests expirationSeconds    int64       expirationSeconds is the duration of validity of the token in  TokenRequestSpec   It has the same default value of  ExpirationSeconds  in  TokenRequestSpec        volumeLifecycleModes      string      Set  unique values will be kept during a merge       volumeLifecycleModes defines what kind of volumes this CSI volume driver supports  The default if the list is empty is  Persistent   which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV PVC mechanism       The other mode is  Ephemeral   In this mode  volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod  A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume       For more information about implementing this mode  see https   kubernetes csi github io docs ephemeral local volumes html A driver can support one or more of these modes and more modes may be added in the future       This field is beta  This field is immutable          CSIDriverList   CSIDriverList   CSIDriverList is a collection of CSIDriver objects    hr       apiVersion    storage k8s io v1       kind    CSIDriverList       metadata     a href    ListMeta  a      Standard list metadata More info  https   git k8s io community contributors devel sig architecture api conventions md metadata      items       a href    CSIDriver  a    required    items is the list of CSIDriver         Operations   Operations      hr             get  read the specified CSIDriver       HTTP Request  GET  apis storage k8s io v1 csidrivers  name        Parameters       name     in path    string  required    name of the CSIDriver       pretty     in query    string     a href    pretty  a          Response   200   a href    CSIDriver  a    OK  401  Unauthorized        list  list or watch objects of kind CSIDriver       HTTP Request  GET  apis storage k8s io v1 csidrivers       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    CSIDriverList  a    OK  401  Unauthorized        create  create a CSIDriver       HTTP Request  POST  apis storage k8s io v1 csidrivers       Parameters       body     a href    CSIDriver  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    CSIDriver  a    OK  201   a href    CSIDriver  a    Created  202   a href    CSIDriver  a    Accepted  401  Unauthorized        update  replace the specified CSIDriver       HTTP Request  PUT  apis storage k8s io v1 csidrivers  name        Parameters       name     in path    string  required    name of the CSIDriver       body     a href    CSIDriver  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    CSIDriver  a    OK  201   a href    CSIDriver  a    Created  401  Unauthorized        patch  partially update the specified CSIDriver       HTTP Request  PATCH  apis storage k8s io v1 csidrivers  name        Parameters       name     in path    string  required    name of the CSIDriver       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    CSIDriver  a    OK  201   a href    CSIDriver  a    Created  401  Unauthorized        delete  delete a CSIDriver       HTTP Request  DELETE  apis storage k8s io v1 csidrivers  name        Parameters       name     in path    string  required    name of the CSIDriver       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    CSIDriver  a    OK  202   a href    CSIDriver  a    Accepted  401  Unauthorized        deletecollection  delete collection of CSIDriver       HTTP Request  DELETE  apis storage k8s io v1 csidrivers       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


kubernetes reference apiVersion v1 weight 2 kind LimitRange contenttype apireference title LimitRange apimetadata autogenerated true LimitRange sets resource usage limits for each kind of resource in a Namespace import k8s io api core v1

Answer:
---
api_metadata:
  apiVersion: "v1"
  import: "k8s.io/api/core/v1"
  kind: "LimitRange"
content_type: "api_reference"
description: "LimitRange sets resource usage limits for each kind of resource in a Namespace."
title: "LimitRange"
weight: 2
auto_generated: true
---

`apiVersion: v1`

`import "k8s.io/api/core/v1"`

## LimitRange {#LimitRange}

LimitRange sets resource usage limits for each kind of resource in a Namespace.

- **apiVersion**: v1

- **kind**: LimitRange

- **metadata** (ObjectMeta)

  Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

- **spec** (LimitRangeSpec)

  Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

## LimitRangeSpec {#LimitRangeSpec}

LimitRangeSpec defines a min/max usage limit for resources that match on kind.

- **limits** ([]LimitRangeItem), required

  *Atomic: will be replaced during a merge*

  Limits is the list of LimitRangeItem objects that are enforced.

  *LimitRangeItem defines a min/max usage limit for any resource that matches on kind.*

  - **limits.type** (string), required

    Type of resource that this limit applies to.

  - **limits.default** (map[string]Quantity)

    Default resource requirement limit value by resource name if resource limit is omitted.

  - **limits.defaultRequest** (map[string]Quantity)

    DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.

  - **limits.max** (map[string]Quantity)

    Max usage constraints on this kind by resource name.

  - **limits.maxLimitRequestRatio** (map[string]Quantity)

    MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.

  - **limits.min** (map[string]Quantity)

    Min usage constraints on this kind by resource name.

## LimitRangeList {#LimitRangeList}

LimitRangeList is a list of LimitRange items.

- **apiVersion**: v1

- **kind**: LimitRangeList

- **metadata** (ListMeta)

  Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

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

  Items is a list of LimitRange objects. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

## Operations {#Operations}

### `get` read the specified LimitRange

#### HTTP Request

GET /api/v1/namespaces/{namespace}/limitranges/{name}

#### Parameters

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

  name of the LimitRange

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

  namespace

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

  pretty

#### Response

200 (LimitRange): OK

401: Unauthorized

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

#### HTTP Request

GET /api/v1/namespaces/{namespace}/limitranges

#### Parameters

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

  namespace

- **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 (LimitRangeList): OK

401: Unauthorized

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

#### HTTP Request

GET /api/v1/limitranges

#### 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 (LimitRangeList): OK

401: Unauthorized

### `create` create a LimitRange

#### HTTP Request

POST /api/v1/namespaces/{namespace}/limitranges

#### Parameters

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

  namespace

- **body**: LimitRange, required

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

  dryRun

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

  fieldManager

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

  fieldValidation

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

  pretty

#### Response

200 (LimitRange): OK

201 (LimitRange): Created

202 (LimitRange): Accepted

401: Unauthorized

### `update` replace the specified LimitRange

#### HTTP Request

PUT /api/v1/namespaces/{namespace}/limitranges/{name}

#### Parameters

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

  name of the LimitRange

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

  namespace

- **body**: LimitRange, required

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

  dryRun

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

  fieldManager

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

  fieldValidation

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

  pretty

#### Response

200 (LimitRange): OK

201 (LimitRange): Created

401: Unauthorized

### `patch` partially update the specified LimitRange

#### HTTP Request

PATCH /api/v1/namespaces/{namespace}/limitranges/{name}

#### Parameters

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

  name of the LimitRange

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

  namespace

- **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 (LimitRange): OK

201 (LimitRange): Created

401: Unauthorized

### `delete` delete a LimitRange

#### HTTP Request

DELETE /api/v1/namespaces/{namespace}/limitranges/{name}

#### Parameters

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

  name of the LimitRange

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

  namespace

- **body**: DeleteOptions

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

  dryRun

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

  gracePeriodSeconds

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

  pretty

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

  propagationPolicy

#### Response

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

### `deletecollection` delete collection of LimitRange

#### HTTP Request

DELETE /api/v1/namespaces/{namespace}/limitranges

#### Parameters

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

  namespace

- **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   v1    import   k8s io api core v1    kind   LimitRange  content type   api reference  description   LimitRange sets resource usage limits for each kind of resource in a Namespace   title   LimitRange  weight  2 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  v1    import  k8s io api core v1        LimitRange   LimitRange   LimitRange sets resource usage limits for each kind of resource in a Namespace    hr       apiVersion    v1       kind    LimitRange       metadata     a href    ObjectMeta  a      Standard object s metadata  More info  https   git k8s io community contributors devel sig architecture api conventions md metadata      spec     a href    LimitRangeSpec  a      Spec defines the limits enforced  More info  https   git k8s io community contributors devel sig architecture api conventions md spec and status         LimitRangeSpec   LimitRangeSpec   LimitRangeSpec defines a min max usage limit for resources that match on kind    hr       limits      LimitRangeItem   required     Atomic  will be replaced during a merge       Limits is the list of LimitRangeItem objects that are enforced      a name  LimitRangeItem    a     LimitRangeItem defines a min max usage limit for any resource that matches on kind          limits type    string   required      Type of resource that this limit applies to         limits default    map string  a href    Quantity  a        Default resource requirement limit value by resource name if resource limit is omitted         limits defaultRequest    map string  a href    Quantity  a        DefaultRequest is the default resource requirement request value by resource name if resource request is omitted         limits max    map string  a href    Quantity  a        Max usage constraints on this kind by resource name         limits maxLimitRequestRatio    map string  a href    Quantity  a        MaxLimitRequestRatio if specified  the named resource must have a request and limit that are both non zero where limit divided by request is less than or equal to the enumerated value  this represents the max burst for the named resource         limits min    map string  a href    Quantity  a        Min usage constraints on this kind by resource name          LimitRangeList   LimitRangeList   LimitRangeList is a list of LimitRange items    hr       apiVersion    v1       kind    LimitRangeList       metadata     a href    ListMeta  a      Standard list metadata  More info  https   git k8s io community contributors devel sig architecture api conventions md types kinds      items       a href    LimitRange  a    required    Items is a list of LimitRange objects  More info  https   kubernetes io docs concepts configuration manage resources containers          Operations   Operations      hr             get  read the specified LimitRange       HTTP Request  GET  api v1 namespaces  namespace  limitranges  name        Parameters       name     in path    string  required    name of the LimitRange       namespace     in path    string  required     a href    namespace  a        pretty     in query    string     a href    pretty  a          Response   200   a href    LimitRange  a    OK  401  Unauthorized        list  list or watch objects of kind LimitRange       HTTP Request  GET  api v1 namespaces  namespace  limitranges       Parameters       namespace     in path    string  required     a href    namespace  a        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    LimitRangeList  a    OK  401  Unauthorized        list  list or watch objects of kind LimitRange       HTTP Request  GET  api v1 limitranges       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    LimitRangeList  a    OK  401  Unauthorized        create  create a LimitRange       HTTP Request  POST  api v1 namespaces  namespace  limitranges       Parameters       namespace     in path    string  required     a href    namespace  a        body     a href    LimitRange  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    LimitRange  a    OK  201   a href    LimitRange  a    Created  202   a href    LimitRange  a    Accepted  401  Unauthorized        update  replace the specified LimitRange       HTTP Request  PUT  api v1 namespaces  namespace  limitranges  name        Parameters       name     in path    string  required    name of the LimitRange       namespace     in path    string  required     a href    namespace  a        body     a href    LimitRange  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    LimitRange  a    OK  201   a href    LimitRange  a    Created  401  Unauthorized        patch  partially update the specified LimitRange       HTTP Request  PATCH  api v1 namespaces  namespace  limitranges  name        Parameters       name     in path    string  required    name of the LimitRange       namespace     in path    string  required     a href    namespace  a        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    LimitRange  a    OK  201   a href    LimitRange  a    Created  401  Unauthorized        delete  delete a LimitRange       HTTP Request  DELETE  api v1 namespaces  namespace  limitranges  name        Parameters       name     in path    string  required    name of the LimitRange       namespace     in path    string  required     a href    namespace  a        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    Status  a    OK  202   a href    Status  a    Accepted  401  Unauthorized        deletecollection  delete collection of LimitRange       HTTP Request  DELETE  api v1 namespaces  namespace  limitranges       Parameters       namespace     in path    string  required     a href    namespace  a        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


kubernetes reference kind NetworkPolicy NetworkPolicy describes what network traffic is allowed for a set of Pods title NetworkPolicy contenttype apireference apimetadata weight 4 autogenerated true import k8s io api networking v1 apiVersion networking k8s io v1

Answer:
---
api_metadata:
  apiVersion: "networking.k8s.io/v1"
  import: "k8s.io/api/networking/v1"
  kind: "NetworkPolicy"
content_type: "api_reference"
description: "NetworkPolicy describes what network traffic is allowed for a set of Pods."
title: "NetworkPolicy"
weight: 4
auto_generated: true
---

`apiVersion: networking.k8s.io/v1`

`import "k8s.io/api/networking/v1"`

## NetworkPolicy {#NetworkPolicy}

NetworkPolicy describes what network traffic is allowed for a set of Pods

- **apiVersion**: networking.k8s.io/v1

- **kind**: NetworkPolicy

- **metadata** (ObjectMeta)

  Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

- **spec** (NetworkPolicySpec)

  spec represents the specification of the desired behavior for this NetworkPolicy.

## NetworkPolicySpec {#NetworkPolicySpec}

NetworkPolicySpec provides the specification of a NetworkPolicy

- **podSelector** (LabelSelector), required

  podSelector selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.

- **policyTypes** ([]string)

  *Atomic: will be replaced during a merge*

  policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8

- **ingress** ([]NetworkPolicyIngressRule)

  *Atomic: will be replaced during a merge*

  ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default)

  *NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.*

  - **ingress.from** ([]NetworkPolicyPeer)

    *Atomic: will be replaced during a merge*

    from is a list of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list.

    *NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed*

    - **ingress.from.ipBlock** (IPBlock)

      ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.

      *IPBlock describes a particular CIDR (Ex. "192.168.1.0/24","2001:db8::/64") that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should not be included within this rule.*

      - **ingress.from.ipBlock.cidr** (string), required

        cidr is a string representing the IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64"

      - **ingress.from.ipBlock.except** ([]string)

        *Atomic: will be replaced during a merge*

        except is a slice of CIDRs that should not be included within an IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" Except values will be rejected if they are outside the cidr range

    - **ingress.from.namespaceSelector** (LabelSelector)

      namespaceSelector selects namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.

      If podSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector. Otherwise it selects all pods in the namespaces selected by namespaceSelector.

    - **ingress.from.podSelector** (LabelSelector)

      podSelector is a label selector which selects pods. This field follows standard label selector semantics; if present but empty, it selects all pods.

      If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the pods matching podSelector in the policy's own namespace.

  - **ingress.ports** ([]NetworkPolicyPort)

    *Atomic: will be replaced during a merge*

    ports is a list of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.

    *NetworkPolicyPort describes a port to allow traffic on*

    - **ingress.ports.port** (IntOrString)

      port represents the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.

      *IntOrString is a type that can hold an int32 or a string.  When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type.  This allows you to have, for example, a JSON field that can accept a name or number.*

    - **ingress.ports.endPort** (int32)

      endPort indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy. This field cannot be defined if the port field is not defined or if the port field is defined as a named (string) port. The endPort must be equal or greater than port.

    - **ingress.ports.protocol** (string)

      protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.

- **egress** ([]NetworkPolicyEgressRule)

  *Atomic: will be replaced during a merge*

  egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8

  *NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. This type is beta-level in 1.8*

  - **egress.to** ([]NetworkPolicyPeer)

    *Atomic: will be replaced during a merge*

    to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.

    *NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed*

    - **egress.to.ipBlock** (IPBlock)

      ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.

      *IPBlock describes a particular CIDR (Ex. "192.168.1.0/24","2001:db8::/64") that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should not be included within this rule.*

      - **egress.to.ipBlock.cidr** (string), required

        cidr is a string representing the IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64"

      - **egress.to.ipBlock.except** ([]string)

        *Atomic: will be replaced during a merge*

        except is a slice of CIDRs that should not be included within an IPBlock Valid examples are "192.168.1.0/24" or "2001:db8::/64" Except values will be rejected if they are outside the cidr range

    - **egress.to.namespaceSelector** (LabelSelector)

      namespaceSelector selects namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.

      If podSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector. Otherwise it selects all pods in the namespaces selected by namespaceSelector.

    - **egress.to.podSelector** (LabelSelector)

      podSelector is a label selector which selects pods. This field follows standard label selector semantics; if present but empty, it selects all pods.

      If namespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the pods matching podSelector in the policy's own namespace.

  - **egress.ports** ([]NetworkPolicyPort)

    *Atomic: will be replaced during a merge*

    ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.

    *NetworkPolicyPort describes a port to allow traffic on*

    - **egress.ports.port** (IntOrString)

      port represents the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.

      *IntOrString is a type that can hold an int32 or a string.  When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type.  This allows you to have, for example, a JSON field that can accept a name or number.*

    - **egress.ports.endPort** (int32)

      endPort indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy. This field cannot be defined if the port field is not defined or if the port field is defined as a named (string) port. The endPort must be equal or greater than port.

    - **egress.ports.protocol** (string)

      protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.

## NetworkPolicyList {#NetworkPolicyList}

NetworkPolicyList is a list of NetworkPolicy objects.

- **apiVersion**: networking.k8s.io/v1

- **kind**: NetworkPolicyList

- **metadata** (ListMeta)

  Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

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

  items is a list of schema objects.

## Operations {#Operations}

### `get` read the specified NetworkPolicy

#### HTTP Request

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

#### Parameters

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

  name of the NetworkPolicy

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

  namespace

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

  pretty

#### Response

200 (NetworkPolicy): OK

401: Unauthorized

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

#### HTTP Request

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

#### Parameters

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

  namespace

- **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 (NetworkPolicyList): OK

401: Unauthorized

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

#### HTTP Request

GET /apis/networking.k8s.io/v1/networkpolicies

#### 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 (NetworkPolicyList): OK

401: Unauthorized

### `create` create a NetworkPolicy

#### HTTP Request

POST /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

#### Parameters

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

  namespace

- **body**: NetworkPolicy, required

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

  dryRun

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

  fieldManager

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

  fieldValidation

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

  pretty

#### Response

200 (NetworkPolicy): OK

201 (NetworkPolicy): Created

202 (NetworkPolicy): Accepted

401: Unauthorized

### `update` replace the specified NetworkPolicy

#### HTTP Request

PUT /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

#### Parameters

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

  name of the NetworkPolicy

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

  namespace

- **body**: NetworkPolicy, required

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

  dryRun

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

  fieldManager

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

  fieldValidation

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

  pretty

#### Response

200 (NetworkPolicy): OK

201 (NetworkPolicy): Created

401: Unauthorized

### `patch` partially update the specified NetworkPolicy

#### HTTP Request

PATCH /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

#### Parameters

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

  name of the NetworkPolicy

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

  namespace

- **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 (NetworkPolicy): OK

201 (NetworkPolicy): Created

401: Unauthorized

### `delete` delete a NetworkPolicy

#### HTTP Request

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

#### Parameters

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

  name of the NetworkPolicy

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

  namespace

- **body**: DeleteOptions

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

  dryRun

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

  gracePeriodSeconds

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

  pretty

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

  propagationPolicy

#### Response

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

### `deletecollection` delete collection of NetworkPolicy

#### HTTP Request

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

#### Parameters

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

  namespace

- **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   networking k8s io v1    import   k8s io api networking v1    kind   NetworkPolicy  content type   api reference  description   NetworkPolicy describes what network traffic is allowed for a set of Pods   title   NetworkPolicy  weight  4 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  networking k8s io v1    import  k8s io api networking v1        NetworkPolicy   NetworkPolicy   NetworkPolicy describes what network traffic is allowed for a set of Pods   hr       apiVersion    networking k8s io v1       kind    NetworkPolicy       metadata     a href    ObjectMeta  a      Standard object s metadata  More info  https   git k8s io community contributors devel sig architecture api conventions md metadata      spec     a href    NetworkPolicySpec  a      spec represents the specification of the desired behavior for this NetworkPolicy          NetworkPolicySpec   NetworkPolicySpec   NetworkPolicySpec provides the specification of a NetworkPolicy   hr       podSelector     a href    LabelSelector  a    required    podSelector selects the pods to which this NetworkPolicy object applies  The array of ingress rules is applied to any pods selected by this field  Multiple network policies can select the same set of pods  In this case  the ingress rules for each are combined additively  This field is NOT optional and follows standard label selector semantics  An empty podSelector matches all pods in this namespace       policyTypes      string      Atomic  will be replaced during a merge       policyTypes is a list of rule types that the NetworkPolicy relates to  Valid options are   Ingress      Egress    or   Ingress    Egress    If this field is not specified  it will default based on the existence of ingress or egress rules  policies that contain an egress section are assumed to affect egress  and all policies  whether or not they contain an ingress section  are assumed to affect ingress  If you want to write an egress only policy  you must explicitly specify policyTypes    Egress     Likewise  if you want to write a policy that specifies that no egress is allowed  you must specify a policyTypes value that include  Egress   since such a policy would not include an egress section and would otherwise default to just    Ingress      This field is beta level in 1 8      ingress      NetworkPolicyIngressRule      Atomic  will be replaced during a merge       ingress is a list of ingress rules to be applied to the selected pods  Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod  and cluster policy otherwise allows the traffic   OR if the traffic source is the pod s local node  OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod  If this field is empty then this NetworkPolicy does not allow any traffic  and serves solely to ensure that the pods it selects are isolated by default      a name  NetworkPolicyIngressRule    a     NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec s podSelector  The traffic must match both ports and from          ingress from      NetworkPolicyPeer        Atomic  will be replaced during a merge           from is a list of sources which should be able to access the pods selected for this rule  Items in this list are combined using a logical OR operation  If this field is empty or missing  this rule matches all sources  traffic not restricted by source   If this field is present and contains at least one item  this rule allows traffic only if the traffic matches at least one item in the from list        a name  NetworkPolicyPeer    a       NetworkPolicyPeer describes a peer to allow traffic to from  Only certain combinations of fields are allowed           ingress from ipBlock    IPBlock         ipBlock defines policy on a particular IPBlock  If this field is set then neither of the other fields can be          a name  IPBlock    a         IPBlock describes a particular CIDR  Ex   192 168 1 0 24   2001 db8   64   that is allowed to the pods matched by a NetworkPolicySpec s podSelector  The except entry describes CIDRs that should not be included within this rule              ingress from ipBlock cidr    string   required          cidr is a string representing the IPBlock Valid examples are  192 168 1 0 24  or  2001 db8   64             ingress from ipBlock except      string            Atomic  will be replaced during a merge                   except is a slice of CIDRs that should not be included within an IPBlock Valid examples are  192 168 1 0 24  or  2001 db8   64  Except values will be rejected if they are outside the cidr range          ingress from namespaceSelector     a href    LabelSelector  a          namespaceSelector selects namespaces using cluster scoped labels  This field follows standard label selector semantics  if present but empty  it selects all namespaces               If podSelector is also set  then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector  Otherwise it selects all pods in the namespaces selected by namespaceSelector           ingress from podSelector     a href    LabelSelector  a          podSelector is a label selector which selects pods  This field follows standard label selector semantics  if present but empty  it selects all pods               If namespaceSelector is also set  then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector  Otherwise it selects the pods matching podSelector in the policy s own namespace         ingress ports      NetworkPolicyPort        Atomic  will be replaced during a merge           ports is a list of ports which should be made accessible on the pods selected for this rule  Each item in this list is combined using a logical OR  If this field is empty or missing  this rule matches all ports  traffic not restricted by port   If this field is present and contains at least one item  then this rule allows traffic only if the traffic matches at least one port in the list        a name  NetworkPolicyPort    a       NetworkPolicyPort describes a port to allow traffic on           ingress ports port    IntOrString         port represents the port on the given protocol  This can either be a numerical or named port on a pod  If this field is not provided  this matches all port names and numbers  If present  only traffic on the specified protocol AND port will be matched          a name  IntOrString    a         IntOrString is a type that can hold an int32 or a string   When used in JSON or YAML marshalling and unmarshalling  it produces or consumes the inner type   This allows you to have  for example  a JSON field that can accept a name or number            ingress ports endPort    int32         endPort indicates that the range of ports from port to endPort if set  inclusive  should be allowed by the policy  This field cannot be defined if the port field is not defined or if the port field is defined as a named  string  port  The endPort must be equal or greater than port           ingress ports protocol    string         protocol represents the protocol  TCP  UDP  or SCTP  which traffic must match  If not specified  this field defaults to TCP       egress      NetworkPolicyEgressRule      Atomic  will be replaced during a merge       egress is a list of egress rules to be applied to the selected pods  Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod  and cluster policy otherwise allows the traffic   OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod  If this field is empty then this NetworkPolicy limits all outgoing traffic  and serves solely to ensure that the pods it selects are isolated by default   This field is beta level in 1 8     a name  NetworkPolicyEgressRule    a     NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec s podSelector  The traffic must match both ports and to  This type is beta level in 1 8         egress to      NetworkPolicyPeer        Atomic  will be replaced during a merge           to is a list of destinations for outgoing traffic of pods selected for this rule  Items in this list are combined using a logical OR operation  If this field is empty or missing  this rule matches all destinations  traffic not restricted by destination   If this field is present and contains at least one item  this rule allows traffic only if the traffic matches at least one item in the to list        a name  NetworkPolicyPeer    a       NetworkPolicyPeer describes a peer to allow traffic to from  Only certain combinations of fields are allowed           egress to ipBlock    IPBlock         ipBlock defines policy on a particular IPBlock  If this field is set then neither of the other fields can be          a name  IPBlock    a         IPBlock describes a particular CIDR  Ex   192 168 1 0 24   2001 db8   64   that is allowed to the pods matched by a NetworkPolicySpec s podSelector  The except entry describes CIDRs that should not be included within this rule              egress to ipBlock cidr    string   required          cidr is a string representing the IPBlock Valid examples are  192 168 1 0 24  or  2001 db8   64             egress to ipBlock except      string            Atomic  will be replaced during a merge                   except is a slice of CIDRs that should not be included within an IPBlock Valid examples are  192 168 1 0 24  or  2001 db8   64  Except values will be rejected if they are outside the cidr range          egress to namespaceSelector     a href    LabelSelector  a          namespaceSelector selects namespaces using cluster scoped labels  This field follows standard label selector semantics  if present but empty  it selects all namespaces               If podSelector is also set  then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the namespaces selected by namespaceSelector  Otherwise it selects all pods in the namespaces selected by namespaceSelector           egress to podSelector     a href    LabelSelector  a          podSelector is a label selector which selects pods  This field follows standard label selector semantics  if present but empty  it selects all pods               If namespaceSelector is also set  then the NetworkPolicyPeer as a whole selects the pods matching podSelector in the Namespaces selected by NamespaceSelector  Otherwise it selects the pods matching podSelector in the policy s own namespace         egress ports      NetworkPolicyPort        Atomic  will be replaced during a merge           ports is a list of destination ports for outgoing traffic  Each item in this list is combined using a logical OR  If this field is empty or missing  this rule matches all ports  traffic not restricted by port   If this field is present and contains at least one item  then this rule allows traffic only if the traffic matches at least one port in the list        a name  NetworkPolicyPort    a       NetworkPolicyPort describes a port to allow traffic on           egress ports port    IntOrString         port represents the port on the given protocol  This can either be a numerical or named port on a pod  If this field is not provided  this matches all port names and numbers  If present  only traffic on the specified protocol AND port will be matched          a name  IntOrString    a         IntOrString is a type that can hold an int32 or a string   When used in JSON or YAML marshalling and unmarshalling  it produces or consumes the inner type   This allows you to have  for example  a JSON field that can accept a name or number            egress ports endPort    int32         endPort indicates that the range of ports from port to endPort if set  inclusive  should be allowed by the policy  This field cannot be defined if the port field is not defined or if the port field is defined as a named  string  port  The endPort must be equal or greater than port           egress ports protocol    string         protocol represents the protocol  TCP  UDP  or SCTP  which traffic must match  If not specified  this field defaults to TCP          NetworkPolicyList   NetworkPolicyList   NetworkPolicyList is a list of NetworkPolicy objects    hr       apiVersion    networking k8s io v1       kind    NetworkPolicyList       metadata     a href    ListMeta  a      Standard list metadata  More info  https   git k8s io community contributors devel sig architecture api conventions md metadata      items       a href    NetworkPolicy  a    required    items is a list of schema objects          Operations   Operations      hr             get  read the specified NetworkPolicy       HTTP Request  GET  apis networking k8s io v1 namespaces  namespace  networkpolicies  name        Parameters       name     in path    string  required    name of the NetworkPolicy       namespace     in path    string  required     a href    namespace  a        pretty     in query    string     a href    pretty  a          Response   200   a href    NetworkPolicy  a    OK  401  Unauthorized        list  list or watch objects of kind NetworkPolicy       HTTP Request  GET  apis networking k8s io v1 namespaces  namespace  networkpolicies       Parameters       namespace     in path    string  required     a href    namespace  a        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    NetworkPolicyList  a    OK  401  Unauthorized        list  list or watch objects of kind NetworkPolicy       HTTP Request  GET  apis networking k8s io v1 networkpolicies       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    NetworkPolicyList  a    OK  401  Unauthorized        create  create a NetworkPolicy       HTTP Request  POST  apis networking k8s io v1 namespaces  namespace  networkpolicies       Parameters       namespace     in path    string  required     a href    namespace  a        body     a href    NetworkPolicy  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    NetworkPolicy  a    OK  201   a href    NetworkPolicy  a    Created  202   a href    NetworkPolicy  a    Accepted  401  Unauthorized        update  replace the specified NetworkPolicy       HTTP Request  PUT  apis networking k8s io v1 namespaces  namespace  networkpolicies  name        Parameters       name     in path    string  required    name of the NetworkPolicy       namespace     in path    string  required     a href    namespace  a        body     a href    NetworkPolicy  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    NetworkPolicy  a    OK  201   a href    NetworkPolicy  a    Created  401  Unauthorized        patch  partially update the specified NetworkPolicy       HTTP Request  PATCH  apis networking k8s io v1 namespaces  namespace  networkpolicies  name        Parameters       name     in path    string  required    name of the NetworkPolicy       namespace     in path    string  required     a href    namespace  a        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    NetworkPolicy  a    OK  201   a href    NetworkPolicy  a    Created  401  Unauthorized        delete  delete a NetworkPolicy       HTTP Request  DELETE  apis networking k8s io v1 namespaces  namespace  networkpolicies  name        Parameters       name     in path    string  required    name of the NetworkPolicy       namespace     in path    string  required     a href    namespace  a        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    Status  a    OK  202   a href    Status  a    Accepted  401  Unauthorized        deletecollection  delete collection of NetworkPolicy       HTTP Request  DELETE  apis networking k8s io v1 namespaces  namespace  networkpolicies       Parameters       namespace     in path    string  required     a href    namespace  a        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