Skip to content

Persistence Configuration

Persistent storage is required for multiple components within the KX Insights Platform. This storage can be categorized as either local or shared.

Local is storage that is only required to be read or written to by a single Pod, shared is storage that is required to be accessed by multiple Pods.

The Global Persistence configuration, allows the user to set configuration required for PVC once for all components requiring persistent storage.

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

The persistence key contains two objects local and shared, these represent the two categories of storage within the KX Insights Platform.

local

Variable Type Example
local object See PVC Configuration

Overrides and defaults for PVC treated as local

shared

Variable Type Example
shared object See PVC Configuration

Overrides and defaults for PVC treated as shared

PVC Configuration

The configuration contained within both local and shared

storageClass

Variable Type Example
storageClass string "rook-cephfs"

Where a sub chart has not been configured to use local values, storageClass is used to set the storage class for all PVC.

storageClass

Where the storageClass has been set to "" the cluster default will be used

storageSize

Variable Type Example
storageSize string "2Gi"

storageSize acts as a default, where the sub chart has not defined a storageSize for its PVC, this will be used as the storage request.

accessModes

Variable Type Example
accessModes []string "[ ReadWriteMany ]"

Where a sub chart has not been configured to use local values, accessModes is used to set the access modes for all PVC.

Sub Chart Configuration

Sub charts should contain matching fields under the persistence key.

It may also have additional keys for unique configuration to that chart.

persistence:
  useLocalValues: true
  storageClass: ""
  storageSize: "20Gi"
  accessModes:
  - "ReadWriteOnce"

useLocalValues

Variable Type Example
useLocalValues boolean true

When set to true the sub chart values will take precedence over global configuration for the PVC creation.

This will cause the sub chart storageClass and accessModes to be applied.

accessModes

Variable Type Example
accessModes []string "[ ReadWriteMany ]"

Set the access modes for the sub chart PVC.

Where useLocalValues has been enabled, these access modes will be applied.

accessModes

Where the accessModes is undefined and useLocalValues has been enabled, it will fall back to the global configuration.

storageClass

Variable Type Example
storageClass string "rook-cephfs"

Set the storage class for the sub chart PVC.

Where useLocalValues has been enabled, this storage class will be applied.

storageClass

Where the storageClass is undefined or has been set to "" the cluster default will be used. This varies from accessModes as "" may be the desired storage class.

Charts using PVC

Currently within KX Insights Platform the following charts creates PVC resources and can make use of the above configuration options.

Chart PVC Name PVC Type
insights insights-packages-pvc shared
gui-gateway insights-gui-gateway-insights-gui-gateway-$ORDINAL local
kxi-acc-svc insights-kxi-acc-svc-data-pvc-insights-kxi-acc-svc-$ORDINAL local
kxi-controller insights-kxi-controller-data-pvc local

Release name

It is assumed that the install was deployed with release name insights

Example Configuration

global:
  persistence:
    local:
      storageClass: "defaulted-class"
      storageSize: "20Gi"
      accessModes:
      - "ReadWriteOnce"
    shared:
      storageClass: "rook-cephfs"
      storageSize: "30Gi"
      accessModes:
      - "ReadWriteMany"

PVC

insights-packages-pvc

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

Set to useLocalValues: true, with object fully populated, will not use any global configuration.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: insights-packages-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 20Gi
  storageClassName: sharedfiles

insights-gui-gateway

global:
...
gui:
  gui-gateway:
    persistence:
      useLocalValues: true
      storageClass: "gui-class"

Set to useLocalValues: true, with object partially populated. The global.persistence.local object is used to default the missing storageSize and accessModes fields.

  volumeClaimTemplates:
    - metadata:
        name: insights-gui-gateway
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
        storageClassName: gui-class

insights-kxi-controller-data-pvc

global:
...
kxi-controller:
  persistence:
    useLocalValues: false
    storageClass: "controller-class"
    storageSize: 2Gi
    accessModes:
    - ReadWriteMany

Set to useLocalValues: false, with object fully populated. The global.persistence.local object is used to configure the storageSize and accessModes fields. storageSize is still however taken from the charts values if present.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: insights-kxi-controller-data-pvc
  annotations:
    "helm.sh/resource-policy": keep
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
  storageClassName: defaulted-class