<p>I want to react to certain Kubernetes/Openshift events,
therefor I need a list of all possible (Kubernetes) events with their type (normal vs. warning).</p>
<p><a href="https://docs.openshift.com/container-platform/3.11/dev_guide/events.html#events-reference" rel="nofollow noreferrer">Openshift event list (but without type info)</a></p>
<p>Event data example:</p>
<pre><code>   {
      &quot;metadata&quot;: {
         ...
      },
      &quot;involvedObject&quot;: {
         ...
      },
      &quot;reason&quot;: &quot;Created&quot;,
      &quot;firstTimestamp&quot;: &quot;...&quot;,
      &quot;lastTimestamp&quot;: &quot;...&quot;,
      &quot;count&quot;: 1,
      &quot;type&quot;: &quot;Normal&quot;,
      &quot;eventTime&quot;: null,
    }
</code></pre>
<p>Is there any relation between the type and the reason of the event?</p>
<p>How can I create/find such a comprehensive list (event reasons + type + involved object kind)?</p>

<p>Posting this answer as a community wiki to give more of a baseline to the question than the actual solution. Feel free to expand it.</p>
<p>I haven't found the Kubernetes equivalent of the OpenShift documentation like used in the question:</p>
<ul>
<li><em><a href="https://docs.openshift.com/container-platform/3.11/dev_guide/events.html#events-reference" rel="nofollow noreferrer">Docs.openshift.com: Container platform: 3.11: Dev guide: Events</a></em></li>
</ul>
<hr />
<p>From Kubernetes perspective you can look on the source code of the components to see what events they can send.</p>
<p><code>Kubelet</code> example:</p>
<ul>
<li><em><a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/events/event.go" rel="nofollow noreferrer">Github.com: Kubernetes: Kubelets: Events: event.go</a></em></li>
</ul>
<pre class="lang-golang prettyprint-override"><code>
const (
    FailedToKillPod                = &quot;FailedKillPod&quot;
    FailedToCreatePodContainer     = &quot;FailedCreatePodContainer&quot;
    FailedToMakePodDataDirectories = &quot;Failed&quot;
    NetworkNotReady                = &quot;NetworkNotReady&quot;
)

const (
    CreatedContainer        = &quot;Created&quot;
    StartedContainer        = &quot;Started&quot;
    FailedToCreateContainer = &quot;Failed&quot;
    FailedToStartContainer  = &quot;Failed&quot;
    KillingContainer        = &quot;Killing&quot;
    PreemptContainer        = &quot;Preempting&quot;
    BackOffStartContainer   = &quot;BackOff&quot;
    ExceededGracePeriod     = &quot;ExceededGracePeriod&quot;
)
</code></pre>
<hr />
<p>The relation between the type and a reason for an event could be described as:</p>
<ul>
<li><em><a href="https://github.com/kubernetes/kubernetes/blob/b11d0fbdd58394a62622787b38e98a620df82750/pkg/apis/core/types.go#L4670" rel="nofollow noreferrer">Github.com: Kubernetes: Pkg: Apis: Core: types.go: Line 4670</a></em></li>
</ul>
<pre class="lang-golang prettyprint-override"><code>// Valid values for event types (new types could be added in future)
const (
    // Information only and will not cause any problems
    EventTypeNormal string = &quot;Normal&quot;
    // These events are to warn that something might go wrong
    EventTypeWarning string = &quot;Warning&quot;
)
</code></pre>
<p>As you can see below the <code>Normal</code> type event was for the information that is not causing any issues. The <code>Warning</code> type event was created where there was an issue (trying to download not existent image: <code>fake</code>):</p>
<pre class="lang-sh prettyprint-override"><code>11s         Warning   Failed              pod/fake-f68cd66bc-hgxxv      Error: ErrImagePull
11s         Normal    BackOff             pod/fake-f68cd66bc-hgxxv      Back-off pulling image &quot;fake&quot;
11s         Warning   Failed              pod/fake-f68cd66bc-hgxxv      Error: ImagePullBackOff
14s         Normal    SuccessfulCreate    replicaset/fake-f68cd66bc     Created pod: fake-f68cd66bc-hgxxv
14s         Normal    ScalingReplicaSet   deployment/fake               Scaled up replica set fake-f68cd66bc to 1
50s         Normal    Scheduled           pod/nginx-6799fc88d8-ks76h    Successfully assigned default/nginx-6799fc88d8-ks76h to docker-desktop
</code></pre>
<p>To have a list of the events that happened in the cluster you could try to use dedicated application inside Kubernetes cluster to watch on the events and store them in a storage option of your choosing.</p>
<hr />
<p>Additional resources:</p>
<ul>
<li><em><a href="https://www.cncf.io/blog/2020/12/10/the-top-kubernetes-apis-for-cloud-native-observability-part-1-the-kubernetes-metrics-service-container-apis-3/" rel="nofollow noreferrer">Cncf.io: Blog: 2020-12-10: The top Kubernetes APIs for cloud native observability:  Part 1: Kuberentes metrics service container apis 3</a></em></li>
<li><em><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#event-v1-core" rel="nofollow noreferrer">Kubernetes.io: Docs: Reference: Generated: Kubernetes api: v1.20: Event v1 core</a></em></li>
</ul>
