how to create dashborad to monitor gke workload or gke serviceac
I want create dashbord like , if any GKE workload running fine should show in green and any service down should show red in dashboard using terraform code
Good day and welcome to the community!
You may create a dashboard to monitor your GKE workload or service account by using Google Cloud's Workload Identity[1] or Kubernetes service accounts[2]. To create a Kubernetes service account, you can follow the steps below:
gcloud container clusters get-credentials [CLUSTER_NAME] --zone [ZONE] --project [PROJECT_ID]
kubectl create serviceaccount [SERVICE_ACCOUNT_NAME]
kubectl create rolebinding [ROLE_BINDING_NAME] --clusterrole=[CLUSTER_ROLE_NAME] --serviceaccount=[NAMESPACE]:[SERVICE_ACCOUNT_NAME]
You can then use the Kubernetes service account credentials in applications running on GKE clusters[3]. You may create a Kubernetes dashboard on a GKE cluster using Terraform. Try to deploy a 2-node separately managed node pool GKE cluster using Terraform and configure kubectl using Terraform output to deploy a Kubernetes dashboard on the cluster.
You can use the google_monitoring_dashboard resource in Terraform to create a dashboard for monitoring your GKE workloads.
You can use the google_container_cluster resource in Terraform to create a GKE cluster.
Hope this helps.
[1] Use Workload Identity | Google Kubernetes Engine (GKE) - Google Cloud. https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity.
[2] Use Kubernetes service accounts | Google Kubernetes Engine (GKE .... https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts.
[3] Authenticate to Google Cloud using a service account. https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform.
Hi Team,
I am also looking for the same solution that Sridhar is expecting - Is this can be done in Grafana, Looker studio or Kibana - please suggest us the better way to visualize and monitor this for the support team
Thanks,
Pavan