Storage Module

LogZilla documentation for Storage Module

Storage module manifest

The manifest below defines the Storage module StatefulSet with an InfluxDB sidecar and the storage headless Service. Replace the storageClassName if needed and review resource requests/limits.

yaml
---
apiVersion: v1
kind: Secret
metadata:
  name: sm-influxdb-secret
type: Opaque
stringData:
  INFLUXDB_ADMIN_USER: logzilla
  INFLUXDB_ADMIN_PASSWORD: <set-strong-password>
  INFLUXDB_USER: user
  INFLUXDB_USER_PASSWORD: <set-strong-password>
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: sm-influxdb-multimap
data:
  INFLUXDB_DATA_MAX_VALUES_PER_TAG: "10000"
  INFLUXDB_DATA_MAX_SERIES_PER_DATABASE: "0"
  INFLUXDB_DATA_INDEX_VERSION: inmem
  INFLUXDB_LOGGING_FORMAT: json
  INFLUXDB_LOGGING_LEVEL: warn
  INFLUXDB_COORDINATOR_LOG_QUERIES_AFTER: 5s
  INFLUXDB_HTTP_LOG_ENABLED: "false"
  INFLUXDB_HTTP_ACCESS_LOG_PATH: ""
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: storage
spec:
  serviceName: storage
  podManagementPolicy: Parallel
  replicas: 5
  selector:
    matchLabels:
      name: storage
  template:
    metadata:
      labels:
        name: storage
    spec:
      enableServiceLinks: false
      containers:
      - name: storagemodule
        terminationMessagePolicy: FallbackToLogsOnError
        image: logzilla/runtime:stable
        imagePullPolicy: Always
        resources:
          requests:
            memory: 1Gi
            cpu: 2000m
          limits:
            memory: 4Gi
            cpu: 4000m
        command:
          - /usr/lib/logzilla/bin/module_run
          - StorageModule
        ports:
        - containerPort: 11413
          name: ingest-port
          protocol: TCP
        - containerPort: 81
          name: sm-api-port
          protocol: TCP
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /liveness
            port: sm-api-port
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        startupProbe:
          failureThreshold: 3
          httpGet:
            path: /readiness
            port: sm-api-port
            scheme: HTTP
          timeoutSeconds: 120
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /readiness
            port: sm-api-port
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        envFrom:
          - configMapRef:
              name: log-multimap
          - configMapRef:
              name: module-multimap
          - secretRef:
              name: internal-api-secret
        env:
          - name: DEDUP_WINDOW
            value: "5"
          - name: INFLUXDB_HOST
            value: "localhost"
          - name: INFLUXDB_COUNTERS_HOST
            value: "influxdb"
        volumeMounts:
        - name: sm-data
          mountPath: /var/lib/logzilla/
          readOnly: false
        - name: sm-archives
          mountPath: /var/lib/logzilla-archive/
          readOnly: false
      - name: influxdb
        image: library/influxdb:1.8.10-alpine
        resources:
          requests:
            memory: 1Gi
            cpu: 500m
          limits:
            memory: 4Gi
            cpu: 1000m
        ports:
        - containerPort: 8086
          name: api
          protocol: TCP
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: api
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: api
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        envFrom:
          - configMapRef:
              name: sm-influxdb-multimap
          - secretRef:
              name: sm-influxdb-secret
        volumeMounts:
        - name: influxdb-data
          mountPath: /var/lib/influxdb/
          readOnly: false
  volumeClaimTemplates:
  - metadata:
      name: sm-data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: premium-rwo # replace as needed
      resources:
        requests:
          storage: 10Gi
  - metadata:
      name: sm-archives
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 10Mi
  - metadata:
      name: influxdb-data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
  name: storage
spec:
  clusterIP: None
  ports:
    - port: 11413
      targetPort: ingest-port
      protocol: TCP
      name: sm-ingest-port
    - port: 82
      protocol: TCP
      targetPort: qe-api-port
      name: query-events-api-port
  type: ClusterIP
  selector:
    name: storage

Notes

  • Update storageClassName fields per the cluster configuration, or remove to use the default StorageClass.
  • The Storage module exposes an internal API on port 81 and a ZeroMQ ingest on port 11413. The headless service allows stable DNS names for StatefulSet members (e.g., storage-0.storage).
Storage Module | LogZilla Documentation