---
title: "Get a Kubernetes volume within the given Portainer environment"
method: GET
path: "/kubernetes/{id}/volumes/{namespace}/{volume}"
tags: ["kubernetes"]
---

# Get a Kubernetes volume within the given Portainer environment

`GET /kubernetes/{id}/volumes/{namespace}/{volume}`

Get a Kubernetes volume within the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier.
**Access policy**: Authenticated user.

## Path parameters

- `id` integer, required
- `namespace` string, required
- `volume` string, required

## Response `200`

Success

- KubernetesK8sVolumeInfo
  - `persistentVolume` KubernetesK8sPersistentVolume
    - `accessModes` string[]
    - `annotations` object
    - `capacity` V1ResourceList
    - `claimRef` K8sIoApiCoreV1ObjectReference
      - `apiVersion` string — API version of the referent. +optional
      - `fieldPath` string — If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future. +optional
      - `kind` string — Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds +optional
      - `name` string — Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +optional
      - `namespace` string — Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +optional
      - `resourceVersion` string — Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +optional
      - `uid` string — UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids +optional
    - `creationDate` string
    - `csi` V1CSIPersistentVolumeSource
      - `controllerExpandSecretRef` V1SecretReference
        - `name` string — name is unique within a namespace to reference a secret resource. +optional
        - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
      - `controllerPublishSecretRef` V1SecretReference
        - `name` string — name is unique within a namespace to reference a secret resource. +optional
        - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
      - `driver` string — driver is the name of the driver to use for this volume. Required.
      - `fsType` string — fsType to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". +optional
      - `nodeExpandSecretRef` V1SecretReference
        - `name` string — name is unique within a namespace to reference a secret resource. +optional
        - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
      - `nodePublishSecretRef` V1SecretReference
        - `name` string — name is unique within a namespace to reference a secret resource. +optional
        - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
      - `nodeStageSecretRef` V1SecretReference
        - `name` string — name is unique within a namespace to reference a secret resource. +optional
        - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
      - `readOnly` boolean — readOnly value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write). +optional
      - `volumeAttributes` object — volumeAttributes of the volume to publish. +optional
      - `volumeHandle` string — volumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.
    - `humanReadableAccessModes` V1PersistentVolumeAccessMode[]
    - `labels` object
    - `name` string
    - `persistentVolumeReclaimPolicy` 'Recycle' | 'Delete' | 'Retain'
    - `status` 'Pending' | 'Available' | 'Bound' | 'Released' | 'Failed'
    - `storageClassName` string
    - `volumeMode` 'Block' | 'Filesystem'
  - `persistentVolumeClaim` KubernetesK8sPersistentVolumeClaim
    - `accessModes` string[]
    - `allowVolumeExpansion` boolean
    - `creationDate` string
    - `humanReadableAccessModes` V1PersistentVolumeAccessMode[]
    - `id` string
    - `labels` object
    - `name` string
    - `namespace` string
    - `owningApplications` KubernetesK8sApplication[]
      - `Annotations` object
      - `ApplicationOwner` string
      - `ApplicationType` string
      - `Configurations` KubernetesConfiguration[]
        - `ConfigurationOwner` string
        - `Data` object
        - `Kind` string
      - `Containers` unknown[]
        - unknown
      - `CreationDate` string
      - `CustomResourceMetadata` KubernetesCustomResourceMetadata
        - `apiVersion` string
        - `kind` string
        - `name` string
        - `plural` string
        - `scope` string
      - `DeploymentType` string
      - `Id` string
      - `Image` string
      - `Kind` string
      - `Labels` object
      - `LoadBalancerIPAddress` string
      - `MatchLabels` object
      - `Metadata` KubernetesMetadata
        - `annotations` object
        - `labels` object
      - `Name` string
      - `Namespace` string
      - `Pods` KubernetesPod[]
        - `ContainerName` string
        - `CreationDate` string
        - `Image` string
        - `ImagePullPolicy` string
        - `Name` string
        - `NodeName` string
        - `PodIP` string
        - `Resource` KubernetesK8sApplicationResource
          - `CpuLimit` number
          - `CpuRequest` number
          - `MemoryLimit` integer
          - `MemoryRequest` integer
        - `Status` string
        - `Uid` string
      - `PublishedPorts` KubernetesPublishedPort[]
        - `IngressRules` KubernetesIngressRule[]
          - `Host` string
          - `IP` string
          - `Path` string
          - `TLS` KubernetesTLSInfo[]
            - `hosts` string[]
        - `Port` integer
      - `Resource` KubernetesK8sApplicationResource
        - `CpuLimit` number
        - `CpuRequest` number
        - `MemoryLimit` integer
        - `MemoryRequest` integer
      - `ResourcePool` string
      - `RunningPodsCount` integer
      - `ServiceId` string
      - `ServiceName` string
      - `ServiceType` string
      - `StackId` string
      - `StackKind` string
      - `StackName` string
      - `Status` string
      - `TotalPodsCount` integer
      - `Uid` string
    - `phase` 'Pending' | 'Bound' | 'Lost'
    - `resourcesRequests` V1ResourceList
    - `storage` integer
    - `storageClass` string
    - `storageRequest` string
    - `volumeMode` 'Block' | 'Filesystem'
    - `volumeName` string
  - `storageClass` KubernetesK8sStorageClass
    - `allowVolumeExpansion` boolean
    - `annotations` object
    - `creationDate` string
    - `isDefault` boolean
    - `labels` object
    - `mountOptions` string[]
    - `name` string
    - `parameters` object
    - `provisioner` string
    - `reclaimPolicy` 'Recycle' | 'Delete' | 'Retain'

## Other responses

- `400` — Invalid request
- `500` — Server error

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/versions/ec51a8194ac0/schema)
