<p>I need to calculate the availability  of a pod in kubernetes over a period of time in percentage using PromQL.  Any suggestions are welcome.</p>

Mukund Sharma
<p>I was able to achieve it with below query:</p>

<blockquote>
  <p>(sum_over_time((sum(kube_pod_status_ready{cluster="$cluster",condition="true", namespace="$namespace"}))[$availability_span:5m]))
  /
  (sum_over_time((sum(kube_pod_status_ready{cluster="$cluster",namespace="$namespace"}))[$availability_span:5m]))
  * 100</p>
</blockquote>
