Configuring KubeArchive to Monitor a Namespace

A user can configure KubeArchive to monitor a specific namespace using ApiServerSource by creating a KubeArchiveConfig custom resource similar to the following:

---
apiVersion: kubearchive.kubearchive.org/v1alpha1
kind: KubeArchiveConfig
metadata:
  name: kubearchive
  namespace: ns
spec:
  resources:
    - selector:
        apiVersion: v1
        kind: Event
      archiveWhen: status.state != 'Completed'
      deleteWhen: status.state == 'Completed'

The configuration of ApiServerSource is done using the selector keys of the KubeArchiveConfig custom resource. The format of the selectors key can be found in the ApiServerSource reference documentation.

The archiveWhen and deleteWhen keys contain expressions that determine when resources of that kind are archived or deleted.