Skip to content

Running Custom Commands in Ranger TagSync

Overview

  • Ranger Tagsync supports running custom commands on Kubernetes. You can run custom commands to the Ranger Tagsync service to perform additional tasks. This document provides the steps to run the custom commands to the Ranger Tagsync service.

Configuration steps to run custom commands in Ranger TagSync

To run the custom commands in Ranger TagSync Pod, follow the below steps:

  1. SSH into the instance where Privacera Manager is installed.
  2. Navigate to the privacera-manager directory using the following command:
    Bash
    cd ~/privacera/privacera-manager/
    
  3. Enable Ranger TagSync by copying var.ranger-tagsync.yml to the custom-vars folder.
    Bash
     cp -n config/sample-vars/vars.ranger-tagsync.yml config/custom-vars/
    
  4. Edit the 'var.ranger-tagsync.yml' file and follow the below steps to configure Ranger TagSync in Privacera.
    Bash
     vi config/custom-vars/vars.ranger-tagsync.yml
    
  5. Uncomment TAGSYNC_K8S_CONTAINER_COMMAND_ENABLE, TAGSYNC_K8S_CONTAINER_COMMAND_LIST properties to enable custom command execution. In the command list variable, pass all the commands you want to run. Here is the example:

    Property Description Default value
    TAGSYNC_K8S_CONTAINER_COMMAND_ENABLE Set to true to allow commands to be executed by Tagsync on Kubernetes False
    TAGSYNC_K8S_CONTAINER_COMMAND_LIST List of commands that Tagsync should execute on Kubernetes. The syntax of the value of the property should be as shown below Blank
  6. If you want to provide the custom entrypoint script, you can do so by uncommenting the TAGSYNC_K8S_CONTAINER_COMMAND_ENTRYPOINT property in the vars.ranger-tagsync.yml file.

    Bash
     vi config/custom-vars/vars.ranger-tagsync.yml
    

  7. Add the below property in the yml file:

    Property Description Default Value
    TAGSYNC_K8S_CONTAINER_ENTRYPOINT_COMMAND Path to a custom entry point for commands "/entrypoint/ranger-tagsync-entrypoint.sh start”

    Here is an example of the vars.ranger-tagsync.yml file with the custom command configuration:

    YAML
    1
    2
    3
    4
    5
    TAGSYNC_K8S_CONTAINER_ENTRYPOINT_COMMAND: "/entrypoint/tagsync-restart.sh start"
    TAGSYNC_K8S_CONTAINER_COMMAND_LIST: 
        - "wget http://someRandomUrl/SomeJarfile.jar"
        - "mv somefile /tmp"
        - "cp myTagSyncEntrypointscript.sh /entrypoint/"
    
    8. After adding the above properties, update your Privacera Manager platform instance by following the Restart Services section.

Comments