Stayen
November 28, 2023, 1:24pm
1
I can’t figure out how to send applications logs (those visible via “kubectl logs pod-ID”) to Cloud Logging.
The pods are being run in “default” K8S namespace. According to
https://cloud.google.com/logging/docs/
docs, GKE sends all application logs to whatever cloud logging routing configured. However, I can’t find any of the logs I see via “kubectl logs pod-ID” in cloud logging explorer.
How that can be done?
DamianS
November 28, 2023, 1:33pm
2
Stayen
November 29, 2023, 12:14pm
3
Thanks for the references.
I tried both fluent-bit and fluentd approaches - nothing happens.
I mean, test-logger pod is running, daemonsets are created, bu there’s no “k8s_container” resources mentioned in Cloud Logs explorer.
Is there a working solution for the latest GKE versions (such as 1.27.* and later)?
Have you enabled WORKLOAD logging on the cluster? By default, only SYSTEM logging is enabled.
gcloud container clusters update --logging=SYSTEM,WORKLOAD $CLUSTER_NAME --region $REGION
See https://cloud.google.com/sdk/gcloud/reference/container/clusters/update#–logging
3 Likes