Loading...

Adding Application-Consistent Protection for Kubernetes

For Kubernetes, to achieve application-consistent protection, you must use both pre-process and post-process script files. You can use pre-scripts and post-scripts for application-consistent protection on both Windows and Linux access nodes.

Pre-scripts and post-scripts are batch files or shell scripts that run before or after certain job phases. The pre-scripts and post-scripts can be either plain bash scripts or scripts with an absolute path to the executable script file inside a pod. The script files are read line by line and executed inside the pod. To use Python scripts, you must pre-install Python in the pod.

Procedure

  1. In the software_installation_directory, create a folder named kscripts as follows:
    • On a Windows access node, create the folder in the ContentStore\Base folder.
    • On a Linux access node, create the folder in the Base directory.
  2. Name the scripts according to what you want to execute them for:
    • To execute the scripts for applications, use the following naming convention:
      • namespace.application_name.prescript
      • namespace.application_name.postscript

        where application_name is the name of the discovered application.

    • To execute the scripts for all namespaces that have the specific application, use the following naming convention:
      • $.application_name.prescript
      • $.application_name.postscript

        where application_name is the name of the discovered application.

Examples

Bash Script File

Pre-process script for MySQL:

# cat /opt/Commvault/Base/kscripts/mydatabase.myapplication.prescript
mysql -h host_name -p password -P port_number -u user_name
flush tables with read lock;

Post-process script for MySQL:

# cat /opt/Commvault/Base/kscripts/mydatabase.myapplication.postscript
unlock tables;
exit;

Absolute Path to the Bash Script File in the Pod

Pre-process script for MySQL:

cat /opt/Commvault/Base/kscripts/mydatabase.myapplication.prescript
/myscripts/quiesce-mysql.sh #Absolute path to file inside pod

Post-process script for MySQL:

cat /opt/Commvault/Base/kscripts/mydatabase.myapplication.postscript
/myscripts/unquiesce-mysql.sh #Absolute path to file inside pod

Absolute Path to the Python Script File In the Pod

Pre-process script for MySQL:

cat /opt/Commvault/Base/kscripts/mydatabase.myapplication.prescript
python /myscripts/quiesce-mysql.py #Absolute path to file inside pod

Post-process script for MySQL:

cat /opt/Commvault/Base/kscripts/mydatabase.myapplication.postscript
python /myscripts/unquiesce-mysql.py #Absolute path to file inside pod

Last modified: 7/29/2021 10:00:33 AM