Customizing Fluentd for GKE Sample Code

This is the sample code for customizing fluentd in Google Kubernetes Engine (GKE). The tutorial explains how to run a custom fluentd daemonset inside GKE that sends logs to Google Cloud Logging.

Overview

The repository contains:

  • a convenience script that creates a GKE cluster with logging disabled (create-cluster.sh)
  • Manifests for deploying a test logging program and the fluentd daemonset in Kubernetes
  • The test logging program source and Dockerfile in test-logger

Contact Us

Please use issue tracker on GitHub to report any bugs, comments or questions regarding SDK development.

We welcome all usage-related questions on Stack Overflow tagged with google-cloud-kubernetes-engine.

Instructions

  1. Open this repo in Cloud Shell with the below button

Open in Cloud Shell

2. Set project with the command replacing VALUE for your project
 gcloud config set project VALUE
  1. Run the create-cluster.sh script to create a test cluster on GKE
./create-cluster.sh
  1. Run the test logger, fluentd configmap, and fluentd daemonset
kubectl apply -f kubernetes/test-logger.yaml
kubectl apply -f kubernetes/fluentd-configmap.yaml
kubectl apply -f kubernetes/fluentd-daemonset.yaml

More Information