You can use the command line to backup your components.

Procedure

  1. Connect to the cluster node 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                    # <------ name of the backup
      labels:
        feature: "dashboard"               # <------ [Optional] label to identify the backup by feature
    spec:
      components:                          # <------ defination of the backup
        postgres:
          enabled: true
          dbs:
            - "grafana"
            - "keycloak"
        collectors:
          enabled: true
        configmaps:
          enabled: true
          nameList:
            - name: "product-info"
              namespace: "default"
        elastic:
          enabled: true
          indices: "ELASTICSEARCH_EVENTS,ELASTICSEARCH_CONFIG,ELASTICSEARCH_KAFKA_MAPPER"
          timeOut: "30m"
        secrets:
          enabled: true
          nameList:
            - name: "collector.tcops-postgres.credentials"
              namespace: "default"
        zookeeper:
          enabled: true
          rootPaths:
            - "/vmware/vsa/gateway"
            - "/vmware/vsa/smarts"
            - "/omega/enrichment"
      retentionPolicy:
        numberOfDaysToKeep: 45              # <------ number of days to keep the backup
    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).
    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.
    feature Enter the feature name to identify the backup by feature. This is an optional field.
    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.