Fileset Examples

CommunityEnterprise

In the example below, all Kubernetes Namespaces, Objects and Persistent Volume Configurations will be backed up using the default Kubernetes API access credentials.

FileSet {
  Name = FS_Kubernetes_All
  Include {
    Plugin = "kubernetes:"
  }
}

In this example, we will backup a single Kubernetes Namespace using the Bearer Token authorization method.

FileSet {
  Name = FS_Kubernetes_plugintest
  Include {
    Plugin = "kubernetes: host=http://10.0.0.1/k8s/clusters/test \
        token=kubeconfig-user:cbhssdxq8vv8hrcw8jdxs2 namespace=plugintest"
  }
}

The same example as above, but with a Persistent Volume:

FileSet {
  Name = FS_Kubernetes_mcache1
  Include {
    Plugin = "kubernetes: host=http://10.0.0.1/k8s/clusters/test \
        token=kubeconfig-user:cbhssdxq8vv8hrcw8jdxs2 \
        namespace=plugintest persistentvolume=myvol"
  }
}

This example backs up a single Namespace and all detected PVCs in this Namespace using a defined listening and entry point address and the default connection port:

FileSet {
  Name = FS_Kubernetes_test_namespace
  Include {
    Plugin = "kubernetes: namespace=test pvcdata fdaddress=10.0.10.10"
  }
}

The same example as above, but using different listening and entry point addresses as may be found when the service is behind a firewall using port forwarding features:

FileSet {
  Name = FS_Kubernetes_test_namespace_through_firewall
  Include {
    Plugin = "kubernetes: namespace=test pvcdata=plugin-storage fdaddress=10.0.10.10 \
        pluginhost=backup.example.com pluginport=8080"
  }
}

This example shows PVC Data archive backup with the Bacula File Daemon inside a Kubernetes cluster:

FileSet {
  Name = FS_Kubernetes_incluster
  Include {
    Plugin = "kubernetes: incluster namespace=test pvcdata \
        pluginhost=backup.bacula.svc.cluster.local"
  }
}

The configuration above is designed for use in situations where the Bacula server components are located on-premise and behind a firewall with no external ports allowed in, but must back up data on an external Kubernetes cluster.

In the following example, we present a set of filesets designed to implement parallel backups in the same namespace. We will backup the persistent volume claims, specifically pvc1 and pvc2, which both belong to same namespace (ns-1):

Fileset {
  Name = "Test-K8S-Set-0006-5"
  Include { Options { signature=SHA1 }
    Plugin = "kubernetes: pluginhost=10.255.3.208 pvcdata=pvc1 namespace=ns-1 pluginport=9104  fdport=9104"
  }
}

Fileset {
  Name = "Test-K8S-Set-0006-6"
  Include { Options { signature=SHA1 }
    Plugin = "kubernetes: pluginhost=10.255.3.208 pvcdata=pvc2 namespace=ns-1 pluginport=9105 fdport=9105"
  }
}

Note

It is necessary to verify that the fdport is not being used by any other process.

Go back to: Configuration.