<p>We have a use case to monitor kubernetes clusters and I am trying to find the list of exceptions thrown by kubernetes to reflect the status of the k8s server (in a namespace) while trying to submit a job on the UI.</p>
<p>Example: if k8s server throws <code>ClusterNotFound</code> exception that means we cannot submit any more jobs to that api server.</p>
<p>Is there such a comprehensive list?</p>
<p>I came across <a href="https://github.com/kubernetes/apimachinery/blob/master/pkg/api/errors/errors.go" rel="nofollow noreferrer">this</a> in Go Lang.  Will this be it? Does java has something like this?</p>

<p>The file you are referencing is a part of Kubernetes library used by many Kubernetes components for API requests fields validations. As all Kubernetes components are written in Go and I couldn't find any plans to port Kubernetes to Java, it's unlikely to have a Java version of that file.</p>
<p>However, there is an officially supported Kubernetes client library, written in Java, so you can check for the proper modules to validate API requests and process API responses in the <a href="https://github.com/kubernetes-client/java" rel="nofollow noreferrer">java-client repostiory</a> or on the <a href="https://javadoc.io/doc/io.kubernetes/client-java-api/latest/index.html" rel="nofollow noreferrer">javadoc site</a>.</p>
<p>For example, objects that are used to contain proper or improper HTTP replies from Kubernetes apiserver: <a href="https://javadoc.io/doc/io.kubernetes/client-java-api/latest/io/kubernetes/client/openapi/models/V1Status.html" rel="nofollow noreferrer">V1Status</a> and <a href="https://javadoc.io/doc/io.kubernetes/client-java-api/latest/io/kubernetes/client/openapi/ApiException.html" rel="nofollow noreferrer">ApiExceptions</a>, <a href="https://github.com/kubernetes-client/java/blob/8b08ec39ab12542a3fed1f4a92d67b7e7a393e14/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiException.java" rel="nofollow noreferrer">(repository link)</a></p>
<p>Please consider to check java-client usage <a href="https://github.com/kubernetes-client/java/wiki/3.-Code-Examples" rel="nofollow noreferrer">examples</a>  for better understanding.</p>
<p>Detailed Kubernetes RESTful API reference could be found on the <a href="https://kubernetes.io/docs/reference/kubernetes-api/" rel="nofollow noreferrer">official page</a><br />
For example: <a href="https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/deployment-v1/#create-create-a-deployment" rel="nofollow noreferrer">Deployment create request</a></p>
<p>If you are really interested in Kubernetes cluster monitoring and logging aspects, please consider to read the following articles at the beginning:</p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/cluster-administration/system-metrics/" rel="nofollow noreferrer">Metrics For Kubernetes System Components</a></li>
<li><a href="https://www.datadoghq.com/blog/kubernetes-control-plane-monitoring/" rel="nofollow noreferrer">Kubernetes Control Plane monitoring with Datadog</a></li>
<li><a href="https://sysdig.com/blog/monitor-kubernetes-control-plane/" rel="nofollow noreferrer">How to monitor Kubernetes control plane</a></li>
<li><a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/" rel="nofollow noreferrer">Logging Architecture</a></li>
<li><a href="https://logz.io/blog/a-practical-guide-to-kubernetes-logging/" rel="nofollow noreferrer">A Practical Guide to Kubernetes Logging</a></li>
</ul>
