LogoLogo
5.0.X
5.0.X
  • About Trilio for Kubernetes
    • Welcome to Trilio For Kubernetes
    • Version 5.0.X Release Highlights
    • Compatibility Matrix
    • Marketplace Support
    • Features
    • Use Cases
  • Getting Started
    • Getting Started with Trilio on Red Hat OpenShift (OCP)
    • Getting Started with Trilio for Upstream Kubernetes (K8S)
    • Getting Started with Trilio for AWS Elastic Kubernetes Service (EKS)
    • Getting Started with Trilio on Google Kubernetes Engine (GKE)
    • Getting Started with Trilio on VMware Tanzu Kubernetes Grid (TKG)
    • More Trilio Supported Kubernetes Distributions
      • General Installation Prerequisites
      • Rancher Deployments
      • Azure Cloud AKS
      • Digital Ocean Cloud
      • Mirantis Kubernetes Engine
      • IBM Cloud
    • Licensing
    • Using Trilio
      • Overview
      • Post-Install Configuration
      • Management Console
        • About the UI
        • Navigating the UI
          • UI Login
          • Cluster Management (Home)
          • Backup & Recovery
            • Namespaces
              • Namespaces - Actions
              • Namespaces - Bulk Actions
            • Applications
              • Applications - Actions
              • Applications - Bulk Actions
            • Virtual Machines
              • Virtual Machine -Actions
              • Virtual Machine - Bulk Actions
            • Backup Plans
              • Create Backup Plans
              • Backup Plans - Actions
            • Targets
              • Create New Target
              • Targets - Actions
            • Hooks
              • Create Hook
              • Hooks - Actions
            • Policies
              • Create Policies
              • Policies - Actions
          • Monitoring
          • Guided Tours
        • UI How-to Guides
          • Multi-Cluster Management
          • Creating Backups
            • Pause Schedule Backups and Snapshots
            • Cancel InProgress Backups
            • Cleanup Failed Backups
          • Restoring Backups & Snapshots
            • Cross-Cluster Restores
            • Namespace & application scoped
            • Cluster scoped
          • Disaster Recovery Plan
          • Continuous Restore
      • Command-Line Interface
        • YAML Examples
        • Trilio Helm Operator Values
    • Upgrade
    • Air-Gapped Installations
    • Uninstall
  • Reference Guides
    • T4K Pod/Job Capabilities
      • Resource Quotas
    • Trilio Operator API Specifications
    • Custom Resource Definition - Application
  • Advanced Configuration
    • AWS S3 Target Permissions
    • Management Console
      • KubeConfig Authenticaton
      • Authentication Methods Via Dex
      • UI Authentication
      • RBAC Authentication
      • Configuring the UI
    • Resource Request Requirements
      • Fine Tuning Resource Requests and Limits
    • Observability
      • Observability of Trilio with Prometheus and Grafana
      • Exported Prometheus Metrics
      • Observability of Trilio with Openshift Monitoring
      • T4K Integration with Observability Stack
    • Modifying Default T4K Configuration
  • T4K Concepts
    • Supported Application Types
    • Support for Helm Releases
    • Support for OpenShift Operators
    • T4K Components
    • Backup and Restore Details
      • Immutable Backups
      • Application Centric Backups
    • Retention Process
      • Retention Use Case
    • Continuous Restore
      • Architecture and Concepts
  • Performance
    • S3 as Backup Target
      • T4K S3 Fuse Plugin performance
    • Measuring Backup Performance
  • Ecosystem
    • T4K Integration with Slack using BotKube
    • Monitoring T4K Logs using ELK Stack
    • Rancher Navigation Links for Trilio Management Console
    • Optimize T4K Backups with StormForge
    • T4K GitHub Runner
    • AWS RDS snapshots using T4K hooks
    • Deploying Trilio For Kubernetes with Openshift ACM Policies
  • Krew Plugins
    • T4K QuickStart Plugin
    • Trilio for Kubernetes Preflight Checks Plugin
    • T4K Log Collector Plugin
    • T4K Cleanup Plugin
  • Support
    • Troubleshooting Guide
    • Known Issues and Workarounds
    • Contacting Support
  • Appendix
    • Ignored Resources
    • OpenSource Software Disclosure
    • CSI Drivers
      • Installing VolumeSnapshot CRDs
      • Install AWS EBS CSI Driver
    • T4K Product Quickview
    • OpenShift OperatorHub Custom CatalogSource
      • Custom CatalogSource in a restricted environment
    • Configure OVH Object Storage as a Target
    • Connect T4K UI hosted with HTTPS to another cluster hosted with HTTP or vice versa
    • Fetch DigitalOcean Kubernetes Cluster kubeconfig for T4K UI Authentication
    • Force Update T4K Operator in Rancher Marketplace
    • Backup and Restore Virtual Machines running on OpenShift
    • T4K For Volumes with Generic Storage
    • T4K Best Practices
Powered by GitBook
On this page
  • Introduction
  • What is BotKube
  • Install and configure BotKube with Slack
  • Install BotKube backend in Kubernetes Cluster
  • Configure T4K Resource Monitoring
  • Configure T4K Resource Commands to execute from Slack
  • Usage of commands and verbs
  • Remove BotKube from Kubernetes cluster

Was this helpful?

  1. Ecosystem

T4K Integration with Slack using BotKube

This section provides step by step instructions to install and configure BotKube to monitor T4K resources from Slack along with other native Kubernetes resources.

PreviousMeasuring Backup PerformanceNextMonitoring T4K Logs using ELK Stack

Was this helpful?

Introduction

In today's world, it's imperative to be able to receive notifications for your Kubernetes environments into communication and notification tools of choice. Slack is a new-age communication tool leveraged by a lot of different teams and organizations today. In order to keep a consistent user experience across ecosystem tools leveraged by T4K users, notifications can be supported within Slack for T4K resources through BotKube.

This page guides you with detailed instructions to install BotKube on a Kubernetes cluster, configure it to integrate with Slack, and monitor T4K resources to provide notifications around T4K activity within Slack channels directly.

What is BotKube

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 to help you monitor T4K resources and other Kubernetes resources.

Install and configure BotKube with Slack

Install BotKube App to Slack workspace

  1. Search for the BotKube application in the Apps section on Slack, install the application using the Add to Slack button provided.

  2. After you authorize the application, you will get a BOT Access token. Note down this token as it will be required during deployment of BotKube backend on Kubernetes cluster.

Add BotKube App as a user to Slack Channel

Once the BotKube application is installed to the Slack workspace, you can see BotKube user (@Botkube) present. Add this Botkube user to your slack channel from where you want to monitor the T4K resources.

Install BotKube backend in 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 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 \
  infracloudio/botkube

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

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

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

Configure T4K Resource Monitoring

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

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

2. Add T4K custom resources to the BotKube configmap

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

The above configuration is for the Cluster scoped installation of T4K. We have specified to include all namespaces for notifications using the following syntax namespaces: -> include: -> -all

In the case of namespace scoped installation of T4K, you can include only the specific namespace where T4K is installed.

3. This update will start populating any operations done on the T4K resources.

Configure T4K 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 T4K resources.

kubectl edit configmap botkube-configmap -n botkube

2. Add the commands that can be executed on the T4K resources along with the verbs under settings.kubectl.commands.resources and settings.kubectl.commands.verbs section

    settings:
      clustername: east-2-rke-120
      configwatcher: true
      kubectl:
        commands:
          resources:
          - deployments
          - pods
          - namespaces
          - daemonsets
          - statefulsets
          - storageclasses
          - nodes
          - licenses
          - policies
          - hooks
          - targets
          - backupplans
          - backups
          - restores
          - triliovaultmanagers
          verbs:
          - 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 can see the updated commands list from slack

Usage of commands and verbs

You can execute above commands directly from slack to monitor the T4K resources

Remove BotKube from Kubernetes cluster

We installed BotKube using helm, execute the following command to completely remove BotKube and related resources.

helm delete --purge botkube -n botkube

For integrations with other tools such as Mattermost, Microsoft Teams, Discord, Elastic Search configurations, users can follow .

BotKube documentations
Search and install BotKube application on Slack
BotKube user in Slack workspace
Invite the BotKube user to Slack channel
T4K target resource is created
T4K policy resource is created
Commands lists on slack after updating the configmap
Get backupplan command execution from Slack
Get backup command execution from Slack