Skip to content

Storage

This page describes how to configure persistent storage options, including local and shared volumes and component-level overrides.

kdb Insights Enterprise uses persistent storage for a number of use-cases. There are two types of storage:

  • local storage is only required by a single pod.
  • shared storage will be accessed by multiple pods.

These two types are configured globally by the application, and can be updated as required. It is also possible to override the storage configuration at a component level.

global:
  persistence:
    local:
      storageClass: ""
      storageSize: "20Gi"
    shared:
      storageClass: "rook-cephfs"
      storageSize: "20Gi"

kxi-controller:
  persistence:
    useLocal: true
    storageClass: "standard"
    storageSize: "30Gi"
    accessMode: "ReadWriteOnce"
  • The global.persistence.local object defines the default storage for components requiring local access patterns.

    Variable Type Example **Description **
    global.persistence.local.storageClass string "" Defines what underlying storage class to use
    global.persistence.local.storageSize string "20Gi" Specifies the default volume size

    kdb Insights Enterprise defaults the storageSize to empty ("") in order to use the cluster default.

  • The global.persistence.shared object defines shared storage defaults.

    Variable Type Example **Description **
    global.persistence.shared.storageClass string "rook-cephfs" Defines what underlying storage class to use and must be configured with a storage class that supports ReadWriteMany semantics
    global.persistence.shared.storageSize string "20Gi" Specifies the default volume size

Read more about Kubernetes Storage classes and Access modes

Overriding defaults

The previous example showed how to override the persistence for a particular component. This reconfigures the kxi-controller component to use a custom storage configuration.

kxi-controller:
  persistence:
    useLocal: true
    storageClass: "standard"
    storageSize: "30Gi"
    accessModes: "ReadWriteOnce"
Variable Description
kxi-controller.persistence.useLocal Override the global settings
kxi-controller.persistence.storageClass Name of storage class to use
kxi-controller.persistence.storageSize Size of volume to provision
kxi-controller.persistence.accessModes Access mode

Package storage

One special case is the storage for kdb Insights Enterprise package definitions. This is part of the main chart and the configuration for modifying it is at the base level.

The default configuration it uses is below. The available fields match previous sections.

global:
..
packages:
  useLocalValues: true
  storageClass: "sharedfiles"
  storageSize: 20Gi

Database Storage

Databases require the use of persistent storage for persisting databases and stream logs.

There are two sections within a Database file where these may be defined.

  • The mounts object relates to database storage.
  • Under spec.elements.[*] the rtLogVolume defines the stream log storage.

As part of the base installation, the default storage configuration may be defined. These are used for any database and stream that doesn't explicitly define their storage.

kxi-operator:
  config:
    mount:
      storageClass: "rook-cephfs"
      accessModes:
      - ReadWriteMany
    element:
      # storageClass: "standard"
      accessModes:
      - ReadWriteOnce
    rt:
      volume:
        # storageClass: "standard"
        accessModes:
        - ReadWriteOnce
Variable Type Example
kxi-operator.config.mount.storageClass string "rook-cephfs"
kxi-operator.config.mount.accessModes []string ["ReadWriteMany"]
kxi-operator.config.element.storageClass string ""
kxi-operator.config.element.accessModes []string ["ReadWriteOnce"]
kxi-operator.config.rt.volume.storageClass string ""
kxi-operator.config.rt.volume.accessModes []string ["ReadWriteOnce"]

The storageClass defines the underlying storage type to use. If not set it defaults to "", allowing the cluster default to be used. The accessModes defines what access modes to request for the created PVC.

Access modes

Not all accessModes are permitted for each storageClass.

Mount

mounts within a database are the Persistent Volumes used for database storage.

Where a database is applied without defining storageClass and accessModes:

apiVersion: insights.kx.com/v1
kind: Assembly
metadata:
  name: sdk-sample-assembly
spec:
  ...
  mounts:
    hdb:
      type: local
      baseURI: file:///data/db/hdb
      partition: date
      dependency:
      - idb
  elements:
    ...

The above kxi-operator.config.mount values defaults the database storage as below

apiVersion: insights.kx.com/v1
kind: Assembly
metadata:
  name: sdk-sample-assembly
spec:
  ...
  mounts:
    hdb:
      type: local
      baseURI: file:///data/db/hdb
      partition: date
      dependency:
      - idb
      volume:
        accessModes:
        - ReadWriteMany
        size: 20Gi
        storageClass: rook-cephfs
  elements:
    ...

Element

The spec.elements object defines components of a package (databases, streams, pipelines). These components may subscribe to stream data and require persistent storage for the logs.

The kxi-operator.config.element configuration object defines the default storage for this if it has not been provided as part of a database.

apiVersion: insights.kx.com/v1
kind: Assembly
metadata:
  name: sdk-sample-assembly
spec:
  ...
  elements:
    dap:
      instances:
        rdb:
          size: 3
          rtLogVolume:
            size: 20Gi
    sm:
      size: 1
      ...
      rtLogVolume:
        size: 20Gi

The above kxi-operator.config.element configuration defaults the stream log storage as below.

apiVersion: insights.kx.com/v1
kind: Assembly
metadata:
  name: sdk-sample-assembly
spec:
  ...
  elements:
    dap:
      instances:
        rdb:
          size: 3
          rtLogVolume:
            accessModes:
            - ReadWriteOnce
            size: 20Gi
          ...
    sm:
      size: 1
      rtLogVolume:
        accessModes:
        - ReadWriteOnce
        size: 20Gi
        ...

RT Volume

The spec.elements.sequencer object defines the RT Stream components known as RT Sequencers within a package.

The kxi-operator.config.rt.volume configuration object defines the default storage for a sequencer if it has not been provided as part of an package.

apiVersion: insights.kx.com/v1
kind: Assembly
metadata:
  name: sdk-sample-assembly
spec:
  ...
  elements:
    ...
    sequencer:
      south:
        volume:
          size: 40Gi
      north:
        external: true

The above kxi-operator.config.rt.volume configuration defaults the RT Sequencer volume.

apiVersion: insights.kx.com/v1
kind: Assembly
metadata:
  name: sdk-sample-assembly
spec:
  ...
  elements:
    ...
    sequencer:
      north:
        external: true
        volume:
          accessModes:
          - ReadWriteOnce
          size: 20Gi
          ...
        ...
      south:
        external: false
        volume:
          accessModes:
          - ReadWriteOnce
          size: 40Gi
          ...
        ...