# No kubernetes labels for volumes exported?

**URL:** <https://discuss.elastic.co/t/no-kubernetes-labels-for-volumes-exported/195894>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 20, 2019, 10:51am UTC](https://discuss.elastic.co/t/no-kubernetes-labels-for-volumes-exported/195894 "2019-08-20T10:51:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [August 20, 2019, 10:51am UTC](https://discuss.elastic.co/t/no-kubernetes-labels-for-volumes-exported/195894/1 "2019-08-20T10:51:04Z")

</div>

Hi,

I am fetching volume information from kubernetes cluster.

The labels are missing in the metricbeat event:

```
{
  "@timestamp": "2019-08-20T10:39:59.823Z",
  "@metadata": {
    "beat": "metricbeat",
    "type": "_doc",
    "version": "7.3.0"
  },
  "host": {
    "name": "server"
  },
  "event": {
    "dataset": "kubernetes.volume",
    "module": "kubernetes",
    "duration": 54769839
  },
  "metricset": {
    "name": "volume"
  },
  "service": {
    "address": "localhost:10255",
    "type": "kubernetes"
  },
  "kubernetes": {
    "volume": {
      "_module": {
        "pod": {
          "name": "poc-redis-0"
        },
        "namespace": "default",
        "node": {
          "name": "server"
        }
      },
      "name": "redis-database-store",
      "fs": {
        "available": {
          "bytes": 29895442432
        },
        "capacity": {
          "bytes": 31572529152
        },
        "used": {
          "bytes": 49696768
        },
        "inodes": {
          "count": 1966080,
          "used": 12,
          "free": 1966068
        }
      }
    }
  },
  "agent": {
    "hostname": "server",
    "id": "6e59cee0-fc61-448e-b5f8-e6f069bc3cba",
    "version": "7.3.0",
    "type": "metricbeat",
    "ephemeral_id": "1577b3e5-85cc-43db-8570-5de6e817a52a"
  },
  "ecs": {
    "version": "1.0.1"
  }
}

```

But in Kubernetes PVC and PV are labeled:

```
kubectl describe pvc redis-database-store-poc-redis-0
Name: redis-database-store-poc-redis-0
Namespace: default
StorageClass: local-storage
Status: Bound
Volume: poc-redis
Labels: appl=redis
               cluster=poc
               type=pvc
Annotations: pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 30Gi
Access Modes: RWO
VolumeMode: Filesystem
Events: <none>
Mounted By: poc-redis-0

kubectl describe pv poc-redis
Name: poc-redis
Labels: appl=redis
                   cluster=poc
                   part-of=elasticStack
Annotations: kubectl.kubernetes.io/last-applied-configuration:
                     {"apiVersion":"v1","kind":"PersistentVolume","metadata":{"annotations":{},"labels":{"appl":"redis","cluster":"poc","part-of":"elasticStack...
                   pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pv-protection]
StorageClass: local-storage
Status: Bound
Claim: default/redis-database-store-poc-redis-0
Reclaim Policy: Delete
Access Modes: RWO
VolumeMode: Filesystem
Capacity: 30Gi
Node Affinity:
  Required Terms:
    Term 0: kubernetes.io/hostname in [server]
Message:
Source:
    Type: LocalVolume (a persistent volume backed by local storage on a node)
    Path: /kubernetes_local_storage/poc-redis

```

Is there any flag I missed to set?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 17, 2019, 10:51am UTC](https://discuss.elastic.co/t/no-kubernetes-labels-for-volumes-exported/195894/2 "2019-09-17T10:51:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
