How do I disable the Stackdriver Logging agent in a cluster?

2/22/2017

Our project recently migrated away from Stackdriver Logging. However, I cannot figure out how to get rid of the fluentd-cloud-logging-* pods in the kube-system namespace. If I delete the individual pods, they come right back.

How do I kill them off for good?

It's not clear to me how they're getting recreated; there is certainly no DaemonSet bringing them back.

I already set monitoringService to none in the configuration described by gcloud container clusters describe.

-- Nate Rook
google-kubernetes-engine

2 Answers

4/21/2020

It depends on your Kubernetes Master version.

  1. From your Google Cloud Dashboard, go to Kubernetes Clusters
  2. Choose your cluster from the list
  3. Click on Edit
  4. Check your Master version and based on that, choose one of the following

1.12.7 or earlier (Legacy Logging)

It is possible to disable Logging by choosing Legacy Logging: Disabled.

Disable Legacy Logging

1.14 or earlier (Kubernetes Engine Monitoring)

You have two options:

  1. Switch to Legacy Logging and disable logging
  2. Disable all logging and monitoring. Bear in mind that this will disable all data collection. Google also warns: Dragons ahead.

Disable Kubernetes Engine Monitoring

1.15.7 or Later

You can select System logging and monitoring only (beta). This will stop log collection from application but system monitoring and log collection will remain. Here is the description of what system logs:

When the system-only option is selected, the following logs are collected:

All pods running in namespaces kube-system, istio-system, knative-serving,gke-system, and config-management-system.

Key services that are not containerized including docker/containerd runtime, kubelet, kubelet-monitor, node-problem-detector, and kube-container-runtime-monitor.

The node’s serial ports output, if the VM instance metadata serial-port-logging-enable is set to true.

Source: https://cloud.google.com/monitoring/kubernetes-engine/installing

-- Halil Kaskavalci
Source: StackOverflow

2/24/2017

The fluentd-cloud-logging pods in the kube-system namespace are defined in the /etc/kubernetes/manifests/ folder of each host machine; that is, they're defined using the Static Pods mechanism.

As of this time, there's no way to change the setting globally. As a workaround, though, I can just delete the file in the manifests folder on each node, using something like the startup script pod. When the file is deleted, the pod will be deleted as well.

(Thanks to GCP support for this answer.)

-- Nate Rook
Source: StackOverflow