Monitoring kubernetes pod readiness in stackdriver

8/20/2019

With stackdriver's kubernetes engine integration, I can view real-time information on my pods and services, including how many are ready. I can't find any way to monitor this, however.

Is there a way to set up an alerting policy that triggers if no pods in a deployment or service are ready? I can set up a log-based metric, but this seems like a crude workaround for information that stackdriver logging seems to already have access to.

-- Nick Johnson
google-cloud-monitoring
google-kubernetes-engine
kubernetes
stackdriver

2 Answers

8/21/2019

I am not sure about the Stackdriver support of this feature; however, you can try creating following alerts as a workaround:

  1. In Alerting policy creation user interface, select resource type as "k8s_container", also select a metric that always exists ( for example, 'CPU usage time').
  2. Define any "filter" or you can use "group by" which will trigger the alert conditions.
  3. In aggregation, choose "count" aggregator.
-- userX
Source: StackOverflow

8/21/2019

Based on the Kubernetes metrics documentation there doesn't seems to be such metric in place.

It does however look like a potential Feature Request.

-- Gautham
Source: StackOverflow