Operator-managed Event Gateway in Evicted state

Symptoms

An operator-managed Event Gateway or Kubernetes Deployment Event Gateway reports an Evicted state due to running out of space.

Causes

Kubernetes pods use ephemeral storage for scratch space, caching, and for logs. If the logs produced by the Event Gateway are not cleaned up in time, the gateway reaches the Evicted state.

Resolving the problem

You can increase the ephemeral storage available to the Event Gateway, so that additional storage is available to clean up logs. Add the ephemeral-storage property to the EventGateway custom resource or Kubernetes Deployment and set a limit. For example:

# excerpt from a Event Gateway CRD 
template:
  pod:
    spec:
      containers:
          name: egw
          resources:
            limits:
              ephemeral-storage: 500Mi

This updates the pod’s ephemeral storage for the Event Gateway, which prevents the gateway instance from overloading the storage and reaching the Evicted state.