ASN.1 sFTP Sink Record Recovery Modes

Record recovery has four modes: MOD_RANGE, MOD_RANGE_GLOBAL, MOD_CONTINUE, and MOD_CONTINUE_GLOBAL. Record Recovery Modes describes the modes in two groups.

Table 1. Record Recovery Modes
Recovery Mode Description
MOD_RANGE, MOD_RANGE_GLOBAL Limited, short-lived recovery of records achieved with a Kubernetes job.
MOD_CONTINUE, MOD_CONTINUE_GLOBAL Ongoing recovery of records in a standard ASN.1 sFTP Sink implementation achieved with a Kubernetes StatefulSet.

The Kubernetes job controlling the MOD_RANGE and MOD_RANGE_GLOBAL modes is based on modifications to a provided asn1-kafka-sftp-recovery.yaml file. The job is applied with the following command:

kubectl apply -f asn1-kafka-sftp-recovery.yaml

The following is a listing of the asn1-kafka-sftp-recovery.yaml template:

#------------- SINK RECOVERY MOD_RANGE or MOD_RANGE_GLOBAL JOB ----------------
# Update placeholders as follows:
#     <RELEASE_VERSION>                    name of Helm release used for sba-5gc-events
#     <RECOVERY_PVC_NAME>                  recovery PVC name
#     <RECOVERY_MOUNT_DIRECTORY_PATH>      path to mount recovery, default is /opt/mtx/recovery
#     <RECOVERY_TOPIC_NAME>                inbound topic for route
#     <RECOVERY_TOPIC_SFTP_PATH>           directory path on remote server
#     <KAFKA_BROKERS>                      comma-delimited list of kafka broker urls
# SFTP credentials
#     <SFTP_USER>                          username
#     <SFTP_PASSWORD>                      the password for the remote user
#     <SFTP_HOST>                          the address of the sftp server
#     <SFTP_PORT>                          server port
 
kind: ConfigMap
apiVersion: v1
metadata:
  name: sink-recovery-config
  namespace: matrixx
data:
  # UPDATE AS APPROPRIATE
  asn1-sftp-sink.yaml: |-
    kafka:
      configuration:
        bootstrap.servers: <KAFKA_BROKERS>
    sftp:
      remote:
        user: <SFTP_USER>
        password: SFTP_PASSWORD
        host: <SFTP_HOST>
        port: <SFTP_PORT>
      internal:
        buffer:
          path: <RECOVERY_MOUNT_DIRECTORY_PATH> + "/buffer"
        uploader:
          path: <RECOVERY_MOUNT_DIRECTORY_PATH> + "/internal_upload"
             
        recovery:
          enabled: true
          path: <RECOVERY_MOUNT_DIRECTORY_PATH>
          # MOD_RANGE or MOD_RANGE_GLOBAL
          modRange:
            metadataFiles: []
          modRangeGlobal:
            startTimestamp:
            endTimestamp:
            nodeID:
            fsn:
            rc:
      routes:
        - topic: <RECOVERY_TOPIC_NAME>
          path: <RECOVERY_TOPIC_SFTP_PATH>
          isdefault: true
---
kind: Job
apiVersion: batch/v1
metadata:
  name: sink-recovery-job
  namespace: matrixx
spec:
  template:
    metadata:
      labels:
        app.kubernetes.io/component: sink-recovery
    spec:
      restartPolicy: Never
      volumes:
        - name: sink-recovery-config-vol
          configMap:
            name: sink-recovery-config
        - name: recovery
          persistentVolumeClaim:
            claimName: <RECOVERY_PVC_NAME>
      containers:
        - name: asn1-sftp-sink
          image: mtx-docker-eng-snapshot.j.m0012242008.com/asn1-kafka-sftp:<RELEASE_VERSION>
          imagePullPolicy: Always
          volumeMounts:
            - name: recovery
              mountPath: <RECOVERY_MOUNT_DIRECTORY_PATH>
            - mountPath: /sync/conf
              name: sink-recovery-config-vol