Listing

The Bacula Enterprise Kubernetes Plugin supports the “plugin listing” feature of Bacula Enterprise 8.x or newer. This mode allows the plugin to display some useful information about available Kubernetes Objects such as:

  • List of Kubernetes Namespaces and their resources.

  • List of Kubernetes Persistent Volumes.

  • List of Kubernetes Storage Classes Objects.

  • List of Kubernetes Cluster Roles Objects.

  • List of Kubernetes Cluster Roles Bindings Objects.

  • List of Kubernetes VOlume Snapshot Classes Objects.

The feature uses the special .ls command with a plugin=<plugin> parameter.

The command requires the following parameters to be set:

client=<client>

A Bacula Client name with the Kubernetes plugin installed.

plugin=<plugin>

A Plugin name, which would be kubernetes: in this case, with optional plugin parameters as described in section Generic Plugin Parameters.

path=<path>

An object path to display.

The supported values for a path=<path> parameter are:

/

to display resources types available to list.

/namespaces

to display a list of Namespaces.

/namespaces/<namespace>/

to display resources types available to list.

/namespaces/<namespace>/<resources>/

to display Kubernetes Objects of this Kubernetes Resource.

/persistentvolumes

to display a list of Persistent Volumes

/storageclasses

to display a list of Storage Class Objects.

/clusterroles

to display a list of Cluster Roles Objects.

/clusterrolebindings

to display a list of Cluster Role Bindings Objects.

/volumesnapshotclasses

to display a list of Volume Snapshot Classes Objects.

To display available Kubernetes Resources, follow the following command example:

*.ls plugin=kubernetes: client=kubernetes-fd path=/
Connecting to Client kubernetes-fd at localhost:9102
drwxr-xr-x   1 root     root                      0 2024-10-18 13:56:06  /clusterroles/
drwxr-xr-x   1 root     root                      0 2024-10-18 13:56:06  /clusterrolebindings/
drwxr-xr-x   1 root     root                      0 2024-10-18 13:56:06  /namespaces/
drwxr-xr-x   1 root     root                      0 2024-10-18 13:56:06  /persistentvolumes/
drwxr-xr-x   1 root     root                      0 2024-10-18 13:56:06  /storageclasses/
drwxr-xr-x   1 root     root                      0 2024-10-18 13:56:06  /volumesnapshotclasses/
2000 OK estimate files=6 bytes=0

To display the list of all available Kubernetes Namespaces, the following command example can be used:

*.ls plugin=kubernetes: client=kubernetes-fd path=/namespaces
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/cattle-provisioning-capi-system
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/cattle-system
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/cattle-ui-plugin-system
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/cert-manager
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/cluster-fleet-local-local-1a3d67d0a899
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/default
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/fleet-default
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/fleet-local
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/harbor-system
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/kube-node-lease
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/kube-public
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/kube-system
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/local
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/local-path-storage
-rw-r-----   1 root     root                   1024 2024-10-18 13:59:45  /namespaces/longhorn-system
[...]
2000 OK estimate files=36 bytes=36,864

To display available Kubernetes Resources belong to a namespace, follow the following command example:

*.ls plugin=kubernetes: client=kubernetes-fd path=/namespaces/default/
Connecting to Client kubernetes-fd at localhost:9102
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/configmaps/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/daemonsets/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/deployments/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/endpoints/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/ingresses/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/limitranges/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/persistentvolumeclaims/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/pods/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/podtemplates/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/replicasets/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/replicationcontrollers/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/resourcequotas/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/rolebindings/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/roles/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/secrets/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/services/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/serviceaccounts/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/statefulsets/
drwxr-xr-x   1 root     root                      0 2024-10-18 22:53:11  /namespaces/default/volumesnapshots/
2000 OK estimate files=19 bytes=0

To display the list of available Namespaced Kubernetes Objects, use the next command(or similar, it depends on Namespaced Kubernetes Resource indicated):

*.ls plugin=kubernetes: client=kubernetes-fd path=/namespaces/default/pods/
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root                   1024 2024-10-18 22:56:08  /namespaces/default/pods/web-server-nginx
2000 OK estimate files=1 bytes=1,024

To display the list of available Persistent Volume Claims which could be used for PVC Data archive feature selection, you can use the following example command for the mysql namespace:

*.ls client=bacula-devel-fd plugin="kubernetes:" path=/namespaces/mysql/persitentvolumeclaims/
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root             2147483648 2024-10-18 23:12:09  /namespaces/mysql/persistentvolumeclaims/web-server-mysql
2000 OK estimate files=1 bytes=2,147,483,648

Note

The volume lists display a Volume Storage size which does not reflect the actual configuration size during backup.

To display the list of all available Persistent Volumes, the following command example can be used:

*.ls plugin=kubernetes: client=kubernetes-fd path=/persistentvolumes/
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-cd6d3b67-f72b-4451-ae6e-6e9eb5fc9d2e
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-d5fe7d2b-31b2-469d-962f-89ec87fb5c90
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-e712b02c-472e-4fa1-beae-a7dc0db7afbf
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-e8ad52b4-0d9b-4efd-b98f-5334eae34302
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-ed57261f-096e-4b88-b7cb-7d02e896c602
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-f4f9e72c-7e00-4dd3-bc84-9bedc99097d7
-rw-r-----   1 root     root                   1024 2024-10-18 23:15:14  /persistentvolumes/pvc-fa10cbde-56c2-4268-b5ce-4c2afdc7a868
[...]
2000 OK estimate files=32 bytes=32,768

To display the list of all defined Storage Class Objects, the following command example can be used:

*.ls plugin=kubernetes: client=kubernetes-fd path=/storageclasses/
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/ceph-block
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/ceph-bucket
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/ceph-filesystem
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/local-path
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/local-storage
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/longhorn
-rw-r-----   1 root     root                   1024 2024-10-18 23:21:50  /storageclasses/nfs-client
2000 OK estimate files=7 bytes=7,168

To display the list of all defined Cluster Roles Objects, the following command example can be used:

*.ls plugin=kubernetes: client=kubernetes-fd path=/clusterroles/
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root                   1024 2024-10-18 23:22:57  /clusterroles/admin
-rw-r-----   1 root     root                   1024 2024-10-18 23:22:57  /clusterroles/calico-node
-rw-r-----   1 root     root                   1024 2024-10-18 23:22:57  /clusterroles/capi-aggregated-manager-role
-rw-r-----   1 root     root                   1024 2024-10-18 23:22:57  /clusterroles/capi-manager-role
-rw-r-----   1 root     root                   1024 2024-10-18 23:22:57  /clusterroles/cattle-fleet-local-system-fleet-agent-role
-rw-r-----   1 root     root                   1024 2024-10-18 23:22:57  /clusterroles/cattle-globalrole-admin
[...]
2000 OK estimate files=164 bytes=167,936

To display the list of all defined Cluster Role Bindings Objects, the following command example can be used:

*.ls plugin=kubernetes: client=kubernetes-fd path=/clusterrolesbindings/
Connecting to Client kubernetes-fd at localhost:9102
-rw-r-----   1 root     root                   1024 2024-10-18 23:23:06  /clusterrolebindings/canal-calico
-rw-r-----   1 root     root                   1024 2024-10-18 23:23:06  /clusterrolebindings/canal-flannel
-rw-r-----   1 root     root                   1024 2024-10-18 23:23:06  /clusterrolebindings/capi-manager-rolebinding
-rw-r-----   1 root     root                   1024 2024-10-18 23:23:06  /clusterrolebindings/cattle-fleet-local-system-fleet-agent-role-binding
-rw-r-----   1 root     root                   1024 2024-10-18 23:23:06  /clusterrolebindings/cattle-globalrolebinding-globalrolebinding-nxl4c
-rw-r-----   1 root     root                   1024 2024-10-18 23:23:06  /clusterrolebindings/cattle-globalrolebinding-grb-5jhgc
[...]
2000 OK estimate files=133 bytes=136,192

To display the list of all defined Volume Snapshot Classes Objects, the following command example can be used:

*.ls plugin=kubernetes: client=kubernetes-fd path=/volumesnapshotclasses/
Connecting to Client kubernetes-fd at localhost:9102
kubernetes: Listing returned an empty result
2000 OK estimate files=0 bytes=0

See also

Go back to:

Go to:

Go back to the Kubernetes Operations page.

Go back to the main Kubernetes Plugin page.