You can use the command line to backup your components.

Procedure

  1. Connect to the deployer VM and execute below command:
    export KUBECONFIG=/root/.kube/<KubeConfig File>
  2. In a text editor, create the configuration file for the backup in YAML format.

    The examples files are located in the tcx-deployer/examples/backup-and-restore/backup.yaml.example.

    Use the following template for the component backup:
    apiVersion: tcx.vmware.com/v1alpha1
    kind: Backup
    metadata:
      name: <backup-name>
    spec:
      acrossClusters:
        enabled: true
      components:
        postgres:
          enabled: true
          timeout: 10m
          dbs:
            - "analyticsservice"
            - "alarmservice"
            - "collector"
            - "grafana"
            - "keycloak"
        collectors:
          enabled: true
          timeout: 10m
        configmaps:
          enabled: true
          timeout: 10m
          nameList:
            - name: "product-info"
              namespace: "default"
        elastic:
          enabled: true
          timeout: 30m
          indices: "ELASTICSEARCH_EVENTS,ELASTICSEARCH_CONFIG,ELASTICSEARCH_KAFKA_MAPPER"
          removeAndAddRepository: false
          cleanUpIndices: ""
        secrets:
          enabled: true
          timeout: 10m
          nameList:
            - name: "collector.tcops-postgres.credentials"
              namespace: "default"
        zookeeper:
          enabled: true
          timeout: 10m
          rootPaths:
            - "/vmware/vsa/gateway"
            - "/vmware/vsa/smarts"
            - "/omega/enrichment"
            - "/omega/kpi"
            #- "/vmware/vsa/ncm"
      retentionPolicy:
        numberOfDaysToKeep: 45
    The value for the indices attribute in the CR, given in the example are called as Mapping Tags. Each Mapping Tags maps to the actual ElasticSearch database indices.
    Note: You can provide one or more Mapping Tags in the CR, separated by ',' (comma).

    Uncomment #- "/vmware/vsa/ncm" to take backup of NCM reports.

    The indices mapped by each Mapping Tags are below:
    • ELASTICSEARCH_EVENTS: "vsa_chaining_history-*,vsa_events_history-*,vsa_audit-*"
    • ELASTICSEARCH_CONFIG: "vsarole,policy,userpreference,vsa_metadata,.vsa-metricservice-jobs,mapping-metadata,mnr-metadata,vsa_catalog"
    • ELASTICSEARCH_KAFKA_MAPPER: "gateway-mappings".
    Option Description
    name Enter a name for the backup. The alphanumeric string can include special characters (-) and (_). This is a mandatory field.
    enabled Enter the name of the component to include in the backup.
    components Defines which components should be backed up.
    numberOfDaysToKeep The maximum number of days to retain the backup. Enter an integer greater than 0. This is a mandatory field.
    Note: You must avoid parallel backup execution, as it may creates invalid behavior.
  3. To create the backup, run the following command:
    kubectl apply -f <configuration YAML file>
    The output:
    backup.tcx.vmware.com/backup-name created
    Note: Once the backup is complete, you cannot undo a backup. The backup can be deleted and once deleted it will be removed from MinIO. Also, to take another backup, create another backup custom resource instead of editing an existing backup custom resource. Editing existing backup custom resource will have no change.