GKE Logs

Definition

GKE Logs refer to the logging capabilities provided by Google Kubernetes Engine (GKE) that capture and store logs from various components of a Kubernetes cluster, including system logs, application logs, and audit logs. These logs are essential for monitoring, troubleshooting, and securing Kubernetes workloads. GKE integrates with Google Cloud’s operations suite, allowing users to view and analyze logs through Cloud Logging, which provides centralized log management and analysis tools.

Secure Settings Example

apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  namespace: kube-system
data:
  fluentd.conf: |
    <source>
      @type tail
      path /var/log/containers/*.log
      pos_file /var/log/fluentd-containers.log.pos
      tag kubernetes.*
      format json
    </source>

    <match kubernetes.**>
      @type google_cloud
      buffer_type memory
      buffer_chunk_limit 32m
      buffer_queue_limit 64
      flush_interval 5s
      retry_limit 10
      <buffer>
        @type file
        path /var/log/fluentd-buffers
      </buffer>
    </match>

Insecure Settings Example

apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  namespace: kube-system
data:
  fluentd.conf: |
    <source>
      @type tail
      path /var/log/containers/*.log
      pos_file /var/log/fluentd-containers.log.pos
      tag kubernetes.*
      format json
    </source>

    <match kubernetes.**>
      @type google_cloud
      buffer_type memory
      buffer_chunk_limit 128m
      buffer_queue_limit 256
      flush_interval 60s
      retry_limit 0
      <buffer>
        @type file
        path /var/log/fluentd-buffers
      </buffer>
    </match>