Review Kubernetes Event request limits

Limit Event floods and verify that required operational Events remain available.

Description

The alpha EventRateLimit plugin limits requests to store Events through the API server. Other types of API requests are outside its scope.

Potential impact

A failing workload or controller can generate enough Events to burden the API server and etcd and obscure important Events.

Remediation

Identify workloads producing excessive Events and check existing limits. On a self-managed cluster, verify version support, enable EventRateLimit and reference its limits from an AdmissionConfiguration. On managed clusters, check which controls the provider offers. Test limits against normal traffic and monitor rejected Events.

Examples

These Kubernetes 1.30.0 excerpts show API server arguments. The first adds AlwaysAdmit, which does not rate-limit Events. Other default plugins can still run.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: kube-apiserver
spec:
  containers:
    - name: kube-apiserver
      image: registry.k8s.io/kube-apiserver:v1.30.0
      command:
        - kube-apiserver
      args:
        - --enable-admission-plugins=AlwaysAdmit

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: kube-apiserver
spec:
  containers:
    - name: kube-apiserver
      image: registry.k8s.io/kube-apiserver:v1.30.0
      command:
        - kube-apiserver
      args:
        - --enable-admission-plugins=EventRateLimit
        - --admission-control-config-file=/etc/kubernetes/eventratelimit.yaml

Mount the AdmissionConfiguration at the second example’s --admission-control-config-file path and make the policy file it references readable by the API server.

References