« Back to Resources

Monitoring TrilioVault For Kubernetes Resources with BotKube

This blog is the second in a series of How-To blogs and was written by solutions engineer Baghirath Hapse. Read on for hands-on instruction from a Trilio expert. To start the series from the beginning, visit this blog

This article provides step-by-step instructions to install and configure BotKube to monitor TrilioVault for Kubernetes (TVK) operations and other native Kubernetes resources from Slack.


In today’s fast paced environment, it’s more important than ever to simplify backup management. Trilio is ready to help by providing an easy way to receive notifications from your Kubernetes applications in your communication tools of choice. This includes Slack, one of the fastest-growing communication tools in use today. In order to provide a more consistent user experience across ecosystem tools, you can set up support for TVK resource notifications in Slack through BotKube. This way users can view all of their notifications in the same communication tool that they are already using, saving time and effort.

This guide provides detailed instructions for how to install BotKube on a Kubernetes cluster, configure it to integrate with Slack and monitor TVK resources via notifications within Slack channels.

What is TrilioVault for Kubernetes?

TrilioVault for Kubernetes is a trusted cloud-native data protection platform specifically designed to protect Kubernetes-based applications across multiple cloud environments. It provides application-centric backup, allowing you to backup and restore all data, metadata and Kubernetes objects associated with the application. TrilioVault provides insight into and discovery of Kubernetes applications while allowing you to run backup operations across  namespace, label, Helm and Operator-based applications. Since metadata is vital to everything from container orchestration to managing applications, TrilioVault stores data and metadata together, making them simple to manage.

What is BotKube and Why Should You Use It?

BotKube is a messaging bot for monitoring and debugging Kubernetes clusters. It can be integrated with multiple messaging platforms, like Slack, Mattermost, Microsoft Teams, Discord and more, to help you monitor TVK/Kubernetes resources.

Install and Configure TVK

Here are the detailed steps to install and configure TVK. Along with TVK, the user needs to configure a few resources before they can start the backup. Begin by learning how to get started with TVK and how to install TrilioVault for Kubernetes.

Install and Configure BotKube with Slack

Install BotKube App in Slack Workspace

Search for the BotKube application in the Apps section on Slack and install the application using the Add to Slack button provided. After you authorize the application, you will get a BOT Access token. Take note of this token as it will be required during the deployment of the BotKube backend on the Kubernetes cluster.

Follow the steps below to install and configure BotKube with TrilioVault for Kubernetes and Slack in order to receive all of your notifications about changes happening on the Kubernetes cluster in one place.

Add BotKube App as a User on Slack Channel

Once the BotKube application is installed in the Slack workspace, you’ll see the BotKube user handle (@Botkube). Add the BotKube user to the slack channel from which you want to monitor the TVK resources.

Install BotKube Backend in the Kubernetes Cluster
  1. Add infracloudio chart repository to the Kubernetes cluster.

>helm repo add infracloudio https://infracloudio.github.io/charts
helm repo update

     2.  Install BotKube backend with the required input parameters to configure Slack communication.

helm install --version v0.12.1 botkube --namespace botkube \
  --set communications.slack.enabled=true \
  --set communications.slack.channel=<SLACK_CHANNEL_NAME> \
  --set communications.slack.token=<xoxb-SLACK_API_TOKEN_FOR_THE_BOT> \
  --set config.settings.clustername=<K8S_CLUSTER_NAME> \
  --set config.settings.kubectl.enabled=<ALLOW_KUBECTL_true_or_false>\
  --set image.repository=infracloudio/botkube \
  --set image.tag=v0.12.1 \

     3. Verify that the botkube controller pod is in a running state.

kubectl get pod -n botkube
NAME                     READY   STATUS    RESTARTS   AGE
botkube-6fdf477b-gskb7   1/1     Running   9          12d

Note: After the above installation with the default configuration, BotKube will watch all the resources in all the namespaces for create, delete and error events in the configured Kubernetes cluster.

Configure TrilioVault for Kubernetes Resource Monitoring

  1. Along with default configurations, update the botkube-configmap with TVK custom resources for monitoring.

kubectl get configmap -n botkube
NAME                DATA   AGE
botkube-configmap   1      14d
kube-root-ca.crt    1      15d

     2. Add TVK custom resources to the BotKube configmap.

kubectl edit configmap botkube-configmap -n botkube
apiVersion: v1
  resource_config.yaml: |
    recommendations: true
    - events:
      - all
      name: triliovault.trilio.io/v1/licenses
        - null
        - all
    - events:
      - all
      name: triliovault.trilio.io/v1/targets
        - null
        - all
    - events:
      - all
      name: triliovault.trilio.io/v1/policies
        - null
        - all
    - events:
      - all
      name: triliovault.trilio.io/v1/hooks
        - null
        - all
    - events:
      - all
      name: triliovault.trilio.io/v1/backupplans
        - null
        - all
    - events:
      - all
      name: triliovault.trilio.io/v1/backups
        - null
        - all
    - events:
      - all
      name: triliovault.trilio.io/v1/restores
        - null
        - all

Note: Theabove configuration is for the Cluster-scoped installation of TVK. This includes all namespaces using labels, such as: data.resource_config.yaml.resources[0].events.namespaces.include[0].all For the namespace-scoped installation of TVK, you can include only the namespace where the TVK installation is present.   

     3. After botkube-configmap is updated, it will start populating notifications for any operations performed on the TVK resources.

Configure TVK Resource Commands to execute from Slack

  1. You can expand the list of commands that can be executed from Slack directly onto the Kubernetes resources and TVK resources.

kubectl edit configmap botkube-configmap -n botkube
     2. Add the commands that can be executed on the TVK resources along with the verbs, as shown in the sections below.


      clustername: east-2-rke-120
      configwatcher: true
          - deployments
          - pods
          - namespaces
          - daemonsets
          - statefulsets
          - storageclasses
          - nodes
          - licenses
          - policies
          - hooks
          - targets
          - backupplans
          - backups
          - restores
          - triliovaultmanagers
          - api-resources
          - api-versions
          - cluster-info
          - describe
          - diff
          - explain
          - get
          - logs
          - top
          - auth
          - create
          - get
          - edit
          - delete
        defaultNamespace: default

      3. Once the botkube-configmap is updated, you’ll be able to see the updated commands list from Slack.

Usage of Commands and Verbs

You can execute the above commands directly from Slack to monitor the TVK resources.

  1. Get backupplans from all namespaces through Slack.

     2. Get backups of default namespace through Slack.

Perform a Backup/Restore Operation on a Sample Application Using TVK

  1. Deploy a sample MySQL database application using Helm charts.

[email protected]:~# helm ls -n sourcens
NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
mysql-qa        sourcens        1               2021-07-20 10:08:06.476467405 +0000 UTC deployed        mysql-1.6.9     5.7.30
[email protected]:~# kubectl get pods -n sourcens
NAME                        READY   STATUS    RESTARTS   AGE
mysql-qa-69f56f9966-cpj2f   1/1     Running   0          44h

    2. Create the backup target required to upload and store the backup metadata and volume data.

[email protected]:~# kubectl get target -n sourcens
demo-s3-target   ObjectStore   100Gi                AWS      Available


     3. Create a hook for data consistency while performing the backup operation.

[email protected]:~# kubectl get hooks -n sourcens
NAME         AGE
mysql-hook   45h

     4. Createthe backupplan required to perform the namespace backup sourcens.
[email protected]:~# kubectl get backupplan -n sourcens
mysql-backupplan   demo-s3-target                                                                    Available

      5. Now, we can perform the namespace backup of sourcens.

[email protected]:~# kubectl get backup -n sourcens
NAME                          BACKUPPLAN         BACKUP TYPE   STATUS      DATA SIZE   START TIME             END TIME               PERCENTAGE COMPLETED   BACKUP SCOPE
mysql-hook-helm-full-backup   mysql-backupplan   Full          Available   362151936   2021-07-20T16:28:22Z   2021-07-20T16:33:15Z   100                    Namespace

     6. Since we already have a backup created and stored to the backup target location, use that same backup to perform a restore operation on a different namespace restorens.

[email protected]:~# kubectl get restore -n restorens
NAME                 BACKUP                        BACKUP NAMESPACE   STATUS      DATA SIZE   START TIME             END TIME               PERCENTAGE COMPLETED   RESTORE SCOPE
mysql-helm-restore   mysql-hook-helm-full-backup   sourcens           Completed   219618872   2021-07-20T16:34:54Z   2021-07-20T16:37:59Z   100                    Namespace
Remove BotKube from Kubernetes ClusterInstall the BotKube back-end using Helm and execute the command below to remove BotKube and its related resources completely.

helm delete --purge botkube -n botkube


Slack is one of the fastest growing communication tools leveraged by many organizations involved in cloud-native application development and delivery. InfraCloud’s BotKube simplifies the integration of Kubernetes applications into Slack. BotKube can also be configured with TVK for the same purpose. With BotKube, users can receive notifications and manage TVK from the communication tool they’re already using, adding another layer of convenience.  Additional integrations with other communication tools (Mattermost, MFST Teams, etc.) are also available from BotKube.

BHagirath Hapse, Solutions Engineer