You are currently viewing custom features documentation. To see the documentation for standard functionality in the current release, click here.

Container images are self contained packages that includes everything you need to run an application without installing an operating system, system tools or libraries, etc. The DataSync Agent is available as a container image, and so, there is no need to install the agent through the agent installer. As you create the agent on a container, the agent will automatically start without needing to run any commands.


Prerequisites


(warning) You will need to have an Azure account.

(warning) Have an admin privilege in Azure. 

(warning) Lastly, you will need a Perspectium Nexus account to import images. Contact Perspectium Support to obtain credentials.


Procedure

To start running your datasync agent on a container in Azure, follow these steps:


When you deploy your image, you will need to make the agent.xml file available for deploying the image. To do so, you will need to mount the agent.xml as a volume inside the deployment.

An option to do this is to create an Azure File Share and a Kubernetes secret and mount the file share as a volume when deploying the image. For more information, visit https://docs.microsoft.com/en-us/azure/aks/azure-files-volume to see how create Azure File Share. 

Import image from Nexus to ACR.

For example: 

az acr import \
  --name XXXX_ACR_NAME \
  --source nexus.perspectium.net:18445/perspectium/datasync-replicator-agent:6.0.0 \
  --image datasync-replicator-agent:6.0.0 \
  --username XXXX_nexus_user \
  --password XXXX_nexus_password

Then, you will need to create an authentication key on the ACR to allow your AKS cluster to access the image. See Create Service Principal with ACRpull role on ACR. 

Create AKS cluster with authentication by Service Principal in order for the AKS cluster to use the ACR

Create deployment yaml which mounts File Share with agent.xml, mount path must be the following: 

/usr/src/app/Perspectium_DataSync_Agent/conf/agent.xml

For example: 

apiVersion: apps/v1
kind: Deployment
metadata:
  name: datasync-deployment
  labels:
    app: datasync-deployment
spec:
  selector:
    matchLabels:
      app: datasync
  template:
    metadata:
      labels:
        app: datasync
    spec:
      containers:
      - name: datasync
        image: XXXXX.azurecr.io/datasync-replicator-agent:6.0.0
        ports:
        - containerPort: 80
        volumeMounts:
          - name: filesharevolume
            mountPath: /usr/src/app/Perspectium_DataSync_Agent/conf/agent.xml
            subPath: agent.xml
      volumes:
      - name: filesharevolume
        azureFile:
          secretName: xxxx-secret
          shareName: xxxxxx
          readOnly: false

Save the yaml file as datasync.yaml in Azure Cloudshell.

(info) NOTE: If you are using a Postgres DB, Datasync cannot create a new DB so you must run CREATE DATABASE db_name. 

On Azure Cloudshell, use the following command:

kubectl apply -f datasync.yaml

To deploy yaml and Datasync Agent will automatically start and process messages in the queue.