2

I brought up a new Vault cluster using Terraform (https://github.com/sethvargo/vault-on-gke) and everything is working fine with Vault. However I can't seem to see any Container, Node or Pod logs in Stackdriver. The other GKE Cluster we have that was brought up manually is working fine.

I can view the logs on the pods using kubectl logs without a problem.

Existing cluster that works fine

Terraformed vault cluster

I'm completely stumped as to why it's not working. Stackdriver is enabled for the cluster, and the beta Stackdriver box is ticked - same as the working cluster. The Compute service account has Editor role, same in both account.

Any thoughts?

Max DiOrio
  • 31
  • 1
  • 2

2 Answers2

4

You need to make sure that your kubernetes cluster has the correct permissions for logging and monitoring.

To have a properly running cluster, the kubernetes master needs the following oauth scopes (the latter two are for stackdriver):

In addition, the service account of the nodes in the kubernetes cluster need the following permissions:

For more information see:

Phylu
  • 41
  • 3
  • Welcome to serverfault. When the link breaks, your answer becomes worthless later even if the linked material answered the question. Please include at least a summary so the answer can stand on its own. Thank you! – marsh-wiggle Nov 30 '18 at 16:07
  • 1
    Thanks. In my case, I configured a custom service account for the GCE instances and it lacked permissions. – Jonathan Lin Dec 28 '18 at 10:33
  • The part regarding missing roles for service account fixed it for me! I added the log writer and metric writer roles to my default service account for Compute Engine and logs magically started to appear in StackDriver. – Cécile Fecherolle May 19 '21 at 08:26
0

If you are looking for the equivalent of kubectl logs, you should be looking in 'kubernetes pod' or 'kubernetes container' for the logs. 'kubernetes cluster' shows you cluster activity such as resource patches and updates.

The next thing to check is to make sure that logging shows 'Enabled v2(beta)' and that the stackdriver agent is properly running in your cluster using 'kubectl get po -n kube-system | grep fluentd'

If all the above checks out, I recommend creating a public issue tracker as there is likely something wrong with either the cluster version of the beta logging

Patrick W
  • 582
  • 2
  • 8
  • That's exactly my problem. I don't have Kubernetes pod or Kubernetes container showing up in Stackdriver for this cluster. Look at the screen shot in the link Terraformed vault cluster. – Max DiOrio Nov 08 '18 at 17:39
  • Sorry about that Max, I've added more steps. This looks like a bug to me – Patrick W Nov 08 '18 at 20:11
  • Beta is enabled and fluentd is running on all nodes. Thanks for the info. – Max DiOrio Nov 09 '18 at 21:10