Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting Started with Logging in Kubernetes

Getting Started with Logging in Kubernetes

A good practice when deploying applications in Kubernetes is to set proper instrumentation to gather insights and solve general monitoring needs. Logging is a fundamental piece of the instrumentation cycle and is continually evolving to solve pains associated with unstructured formats, performance and monitoring.

In this presentation you will learn the concepts involved in log processing for containerized applications. You will also be introduced to these hot new features in Logging: metering the logging pipeline with Prometheus, performance improvements, scalability and the ability to customize the log processor behavior through declarative resource annotations.

Eduardo Silva

May 03, 2018
Tweet

More Decks by Eduardo Silva

Other Decks in Technology

Transcript

  1. /about • Open Source Software Engineer at Treasure Data •

    Maintainer of Fluent Bit (a Fluentd ecosystem project) #Logging #Kubernetes #Blockchain #Linux #Scalability /about
  2. /about Logging & Docker Containers STDOUT Application Hey KubeCon! Application

    writes a message to the standard output interface
  3. /about Logging & Docker Containers JSON Map string is appended

    to the Container Log File /var/lib/docker/containers/df0ac7aee...48a3d8df/df0ac7aee...48a3d8df-json.log
  4. /about Logging & Docker Containers Operational perspective • Discover Containers

    log files • Read each log entry = read each JSON Map • Read content of Log key message • Append metadata (container name/id)
  5. Pod Pod Node /about Application in Kubernetes Application Container 1

    Container N Application Application Container 1 Container N Application
  6. Node 1 Node 2 Node 3 Node N Master /about

    Application in Kubernetes
  7. /about Logging & Kubernetes In addition to the container context

    we have: • Pod name and Pod ID • Namespace • Node (Host) • Labels • Annotations
  8. /about Logging & Kubernetes Log Processor • Container name and

    Container ID • Pod name and Pod ID • Namespace • Node (Host) • Labels • Annotations Context
  9. /about Logging & Kubernetes Log Processor • Container name and

    Container ID • Pod name and Pod ID • Namespace • Node (Host) • Labels • Annotations Context File System / Journald
  10. Kubernetes API Server /about Logging & Kubernetes Log Processor •

    Container name and Container ID • Pod name and Pod ID • Namespace • Node (Host) • Labels • Annotations Context File System / Journald
  11. Kubernetes API Server /about Logging & Kubernetes File System /

    Journald Logs Source Log Processor Storage
  12. /about Logging & Kubernetes Node Master /var/log/containers/* Fluent Bit Pod

    Pod 1 Pod N Read Logs from the Filesystem (or Journald) Read Logs
  13. /about Logging & Kubernetes Node Master /var/log/containers/* Fluent Bit Pod

    Pod 1 Pod N Lookup for Metadata Associated with each Pod Read Logs Lookup Metadata
  14. /about What’s new ? • Annotated Pods • Metrics: JSON

    & Prometheus • Throttle Filter • Enterprise Connectors
  15. /about Fluent Bit v0.13 Annotated Pods • fluentbit.io/parser suggest a

    parser • fluentbit.io/exclude suggest to exclude logs
  16. /about Fluent Bit v0.13 Annotated Pods apiVersion: v1 kind: Pod

    metadata: name: apache-logs labels: app: apache-logs annotations: fluentbit.io/parser: apache spec: containers: - name: apache image: edsiper/apache_logs Suggest a Parser
  17. /about Stats • 74 Releases • 32 Contributors in 3

    years • > 50k Docker Pulls (downloads) per day! • > 3M downloads in the last year Fluent Bit Status
  18. /about Roadmap / Join us! We are just starting v0.14

    development! • Features ◦ Load Balancing for output plugins ◦ Nested Multiline in Docker JSON logs • We need help with ◦ Documentation ◦ Unit tests, CI/CD ◦ Multiarch Docker images