Skip to content

API Storage

This page describes how to configure the storage used by the API server, and how to persist cached data across container restarts.

values.yaml
api:
data:
# Directory where the API server stores cached data
directory: "/var/lib/kannika"
# Persistence settings for the API server's data directory.
# By default, an emptyDir volume is used, which is deleted when the pod is deleted.
# If you want to use a PersistentVolumeClaim, set `persistentVolume.enabled` to true.
# If you want to use a hostPath, set `storage.hostPath` to the path on the host.
storage:
# Store data on the host using this absolute path.
# This is useful for development and testing, but not recommended for production.
hostPath: "/path/on/host"
# Store data using a PersistentVolumeClaim.
persistentVolume:
# Whether to use a PersistentVolumeClaim to store data.
# Enabling this will take precedence over the other settings.
enabled: false
# The size of the PersistentVolumeClaim.
size: 5Gi
# The storage class to use for the PersistentVolumeClaim.
# If not set, the default storage class will be used.
storageClass: ""
labels: {}
annotations: {}
accessModes:
- ReadWriteOnce
# Used to overwrite the default name of the PersistentVolumeClaim
nameOverwrite: ""

The API stores and caches the following data:

  • Event Hub Topics: Topics fetched from EventHubs are stored and cached for performance reasons.
  • Backup & Restore Metrics: The API stores metrics from backups and restores. See the corresponding documentation for more information.

This list may change in future versions.

By default, the data directory is located at /var/lib/kannika in the API container.

To configure the data directory, set the api.config.data.directory application property.

values.yaml
api:
config:
data:
directory: /var/lib/kannika

A data volume is mounted onto the Pod to the data directory to store the API data.

By default, this volume is an emptyDir . This means that data is not persisted across container restarts.

To use a persistent volume to store the API’s data, set the api.storage.persistentVolume.enabled property to true. This will create a PersistentVolumeClaim .

This is the recommended configuration for production environments, as it ensures that data is persisted across container restarts.

The following properties can be configured:

values.yaml
api:
storage:
persistentVolume:
enabled: true
storageClass: "default"
size: 5Gi
labels: {}
annotations: {}
accessModes:
- ReadWriteOnce
nameOverwrite: ""

To store the API data on the host, set the api.storage.hostPath property to an absolute path on the host. This will create a hostPath . volume.

This is useful for development and testing environments, but it is not recommended for production environments.

values.yaml
api:
storage:
hostPath: /var/lib/kannika

To store the API data in an emptyDir volume, simply do not configure the api.storage property.

This is useful for local development and testing environments, but it is not recommended for production environments.

values.yaml
api:
storage: {}