I have a deployment on google gke, and I can't see the pod logs on the console even though the Cloud logging is enabled on the cluster? So what could be the issue? did I miss something?
Yes, I found the reason,I found out that the cluster was using a specific service account that hasn't logging and monitoring roles assigned. I assigned those roles to that service account and everything is working well.
It sounds like Workload monitoring and logging may not have been enabled and currently it's only doing system monitoring and logging. Please see the docs here on how to change the logging settings: https://cloud.google.com/stackdriver/docs/solutions/gke/installing#installing
If you're using Terraform to manage your GKE cluster, you can enable specific logging components by setting the enable_components
field in your logging_config
. Here's how you can do it:
resource "google_container_cluster" "my_cluster" {
// your other cluster configs
logging_config {
enable_components = ["SYSTEM_COMPONENTS", "WORKLOADS"]
}
}
You can refer to the Terraform documentation for more details: GKE Cluster Logging Config.
If you're managing your cluster through the GCP Console, follow these steps:
- Go to your GKE Cluster configuration.
- Navigate to
Features
->Logging
. - Click the
Edit
button. - Configure the logging components as needed.
Hope it helps!
© 2022 - 2025 — McMap. All rights reserved.
kubectl logs deploy/<deployment>
andkubectl describe deploy/<deployment>
to see what it returns? – Delatorre