Skip to main content

How can we help you?

Druva Documentation

Application Support

To define your Kubernetes Application Group and prepare for application data backup, you must first define the Application Group detail and the associated backup recipes. This article provides application-specific instructions.

MySQL Applications

Application Group Definition
  • To define the Application Group Detail using matchLabel with multiple conditions, run the following command:

apiVersion: backup.druva.com/v1alpha1
kind: ApplicationGroup
metadata:
  name: standalone-mysql
spec:
  applicationGroupDetail:
    selectors:         
    - matchLabels:
        app.kubernetes.io/instance: mysql-release
        app.kubernetes.io/name: mysql 

where,
matchLabels provides the map of key/value pairs matching to both conditions (labels) mysql-release and mysql 
 

  • To define the Application Group Detail using matchExpression with a single label selector requirement, run the following command:

apiVersion: backup.druva.com/v1alpha1
kind: ApplicationGroup
metadata:
  name: standalone-mysql
spec:
  applicationGroupDetail:
    selectors:         
    - matchExpressions:
      - key: app.kubernetes.io/instance
        operator: In
        values:
        - mysql-release
        - wordpress-release

 

Recipe Definition
  • To define the Application Group Recipe for a standalone MySQL application, run the following command:
 apiVersion: backup.druva.com/v1alpha1 
    kind: ApplicationGroup
    metadata:
      name: restore-appgroup
      namespace: wordpress-prod
    spec:
      applicationGroupDetail:
        helmReleases:
        - helmDriver: Secret
          releaseNames:
          - mysql-release
          - wordpress-release
      applicationGroupRecipes:
        standalone:
          applicationRecipes:
            mysql:
              applicationName: druva-standalone-mysql-application
              env:
              - name: DRUVA_MYSQL_HOST
                value: mysql-release-headless
              - name: DRUVA_MYSQL_SECRET_NAME
                value: mysql-release
  • To define multiple Application Group Recipes, run the following command with the Application Group Detail:
applicationGroupRecipes:
    standalone:
      applicationRecipes:
        mysql:
          applicationName: druva-standalone-mysql-application
          env:
          - name: DRUVA_MYSQL_HOST
            value: mysql-headless
          - name: DRUVA_MYSQL_SECRET_NAME
            value: mysql
    replicated:
      applicationRecipes:
        mysql:
          applicationName: druva-replicated-mysql-application
          env:
          - name: DRUVA_MYSQL_SOURCE_HOST
            value: mysql-primary-headless
          - name: DRUVA_MYSQL_REPLICA_HOST
            value: mysql-secondary-headless
          - name: DRUVA_MYSQL_SECRET_NAME
            value: mysql

 

MongoDB Databases

Application Group Definition

To define the Application Group Detail for MongoDB databases using matchLabel, run the following command:

apiVersion: backup.druva.com/v1alpha1
kind: ApplicationGroup
metadata:
  name: mongo
  namespace: pmongo
spec:
  applicationGroupDetail:
    selectors:
    - matchLabels:
        name: mongo1

 Where every related resource is tagged with the label name=mongo1

PostgreSQL 

Application Group Definition

To define the Application Group Detail for PostgreSQL using matchLabel, run the following command:

apiVersion: backup.druva.com/v1alpha1
kind: ApplicationGroup
metadata:
  name: post
  namespace: postdb
spec:
  applicationGroupDetail:
    selectors:
    - matchLabels:
        name: postgresdb

Where every related resource is tagged with the label name=postgresdb