Kubernetes metadata not showing up for init-Containers

In Kubernetes you Init Containers can be specified for a Deployment. Unfortunately it appears that the kubernetes metadata fields are not showing up for logs from an init-container in a pod. The logs from the main app container (in this case Nginx) are being populated fine. See the following screenshot for an example. The sleep and terminating log messages were from an init container.

Is there something I'm missing from a configuration perspective? Since the one container works but the other doesn't I think it might be an oversight or a particular way the metadata is gathered?

Any guidance appreciated. This is using v6.0.0-alpha2. Below is a Deployment that could be used to reproduce:

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.13.1
        ports:
        - containerPort: 80
      initContainers:
      - name: slowness
        image: busybox
        command: ['sh', '-c', 'echo "Sleeping 10 sceonds..." && sleep 10'] 

This looks like a bug to me, thank you for reporting it! would you mind to open a new issue in github? https://github.com/elastic/beats/issues/new

I guess we will just need to index initContainers along with common containers :slight_smile:

Sure thing, here we go - https://github.com/elastic/beats/issues/4825

Thanks a lot!

This topic was automatically closed after 21 days. New replies are no longer allowed.