Unable to read the systemd logs while running in kubernetes Cluster

1,040 views
Skip to first unread message

Akshay Dubey

unread,
Dec 4, 2018, 8:57:42 PM12/4/18
to Fluent-Bit
Hi All, 
When I am running fluentbit using the docker run command I am getting the systemd logs:-

docker run -v /run/log/journal:/var/run/systemd/journal/ -v /home/app/:/fluent-bit/etc/ -v /var/log/containers:/var/log/containers hub.docker.prod.walmart.com/fluent/fluent-bit:0.14.8

But while running the same thing in kubernetes cluster I am not getting any logs, please do find all my config files (Helm chart) below:-

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: fluent-bit
  namespace: logging
  labels:
    app: mls-fluentbit-logging-mls-fluentbit
spec:
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: mls-fluentbit-logging-mls-fluentbit
      annotations:
        checksum/config: 5b9eaf4c75b8d5294d2e0b95e901466ad1a2c1023d3daa89ccf7be4120593a2d
    spec:
      serviceAccountName: logging-admin-sa
      containers:
      - name: fluent-bit
        image: "hub.docker.prod.walmart.com/fluent/fluent-bit:0.14.8"
        imagePullPolicy: "Always"
        env:
          []

        resources:
          limits:
            memory: 1Gi
          requests:
            cpu: 2
            memory: 512Mi

        ports:
          - name: metrics
            containerPort: 2020
            protocol: TCP
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: config
          mountPath: /fluent-bit/etc/fluent-bit.conf
          subPath: fluent-bit.conf
        - name: journald-socket1
          mountPath: /run/systemd/journal/
          readOnly: true
        - name: journald-socket2
          mountPath: /var/run/systemd/journal
          readOnly: true

      terminationGracePeriodSeconds: 10
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: journald-socket1
        hostPath:
          path:  /run/systemd/journal/
      - name: journald-socket2
        hostPath:
          path:  /var/run/systemd/journal
      - name: config
        configMap:
          name: mls-fluentbit-logging-mls-fluentbit-config

apiVersion: v1
kind: ConfigMap
metadata:
  name: mls-fluentbit-logging-mls-fluentbit-config
  namespace: logging
  labels:
    app: mls-fluentbit-logging-mls-fluentbit
data:
  fluent-bit.conf: |-
    [SERVICE]
        Flush        1
        Daemon       Off
        Log_Level    debug
        HTTP_Server  On
        HTTP_Listen  0.0.0.0
        HTTP_Port    2020
    [INPUT]
        Name            systemd
        Tag             host.*
        Path            /run/systemd/journal/

    [OUTPUT]
        Name  stdout
        Match *

  parsers.conf: |-
    [PARSER]
        Name        docker
        Format      json
        Time_Keep    true
        Time_Key    time
        Time_Format %Y-%m-%dT%H:%M:%S.%L
        Decode_Field_As escaped_utf8 log
 

Eduardo Silva

unread,
Dec 5, 2018, 12:15:40 AM12/5/18
to akshayd...@gmail.com, Fluent-Bit
please log into the Fluent Bit container and see if you can get any logs with journalctl tool:

journalctl -u kubelet.service 

--
You received this message because you are subscribed to the Google Groups "Fluent-Bit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluent-bit+...@googlegroups.com.
To post to this group, send email to fluen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fluent-bit/4f505a83-ba07-4baf-9cd2-3ead795b8912%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Eduardo Silva
Open Source, Treasure Data
http://www.treasuredata.com/opensource

http://twitter.com/edsiper
  http://www.linkedin.com/in/edsiper
Reply all
Reply to author
Forward
0 new messages