Creating an Agent DaemonSet workload
After you create a ConfigMap, deploy the database audit agent and configure database information in the agent DaemonSet. Your database can then be connected to the database audit instance.
Creating an Agent DaemonSet
- In the navigation pane, choose and click Create DaemonSet.
- Configure basic information about the workload, as shown in Figure 2. Table 1 describes the parameters.
- Click Next: Add Container. Click Add Container. In the dialog box that is displayed, click the Open Source Images tab and select centos. Figure 3 Selecting a CentOS image
- Set CentOS image parameters.
- Click the Basic Information tab. Select the image centos7.5.1804 and retain the default values for other parameters.
If the centos7.5.1804 image is not supported in your region, perform the operations in Changing an Image.
- Click the Lifecycle tab and set the commands used when the container is started or running. Set the following parameters and retain the default values for other parameters:
- Start Command: command executed when a container is started
- Command: top
- Args: -b
- Post-Start: command executed while a container is up and running
- Args: CLI
- Command:
/bin/bash
-c
tar xvf /tmp/dbss/agent/dbss_agent.tar.gz -C /opt;/opt/dbss_agent/install.sh;rm -rf /opt/dbss_agentFigure 4 Command parameters for container startup and running
- Start Command: command executed when a container is started
- Click the Data Storage tab and mount extra volumes to the container.
- Click the Local Volume tab and click Add Local Volume. In the dialog box that is displayed, set the following parameters and retain the default values for other parameters:
- Set Type to ConfigMap
- Set ConfigMap to the one created in Creating a ConfigMap.
- Set Container Path for the ConfigMap (for example, /tmp/dbss/db). Figure 5 Add Local Volume dialog box
- Click OK.
- Click the Cloud Volume tab and click Add Cloud Volume. In the dialog box that is displayed, set the following parameters and retain the default values for other parameters:
- Set Type to OBS.
- Set Allocation Mode to Manual.
- Set Name to the PVC of the OBS bucket created in Importing Configurations to OBS.
- Set Container Path for the storage (for example, /tmp/dbss/agent). Figure 6 Add Cloud Volume dialog box
- Click OK.
If your database configurations changed, you need to add a new cloud volume and remove the old one.
To add a cloud volume, click a workload and click the Upgrade tab. Click Advanced Settings, click the Data Storage tab, and click Cloud Volume. Click Add Cloud Volume.
- Click the Local Volume tab and click Add Local Volume. In the dialog box that is displayed, set the following parameters and retain the default values for other parameters:
- Click the Basic Information tab. Select the image centos7.5.1804 and retain the default values for other parameters.
- Keep the access settings and advanced settings as they are. Click Next: Set Application Access, Next: Configure Advanced Settings, and Create.
- Return to the DaemonSets page. In the Operation column of the new DaemonSet, choose More > Edit YAML.
- In the Edit YAML dialog box, add hostNetwork: true under the spec.template.spec field. Figure 7 Editing a YAML file
- Click Edit.
- Check the DaemonSet workload status. If the workload is in the Running state, it has been successfully created.Figure 8 DaemonSet workload created
- Go to the DBSS console. Check the agent status. Expand the agent list of a database and locate the required agent. If its value of General is Yes and Status is Running, as shown in Figure 9, the database to be audited is successfully connected to the database audit instance.
Changing an Image
If the centos7.5.1804 image is not supported in your region, perform the following steps to change to this image:
- Configure the image name.
- Open a new browser window. Log in to the SoftWare Repository for Container (SWR) console.
- In the navigation pane, choose Image Resources > Image Center.
- Click Image Accelerator. In the displayed Image Accelerator dialog box, copy the accelerator address. Add /library/centos:centos7.5.1804 to the end of the address.
Example: 7b01ab6xxxxfb06b2.mirror.swr.myhuaweicloud.com/library/centos:centos7.5.1804
Figure 10 Accelerator address
- Change the image.
- Go back to the page for Setting CentOS image parameters.
- Click Change Image. In the Select Container Image dialog box, click the Third-Party Images tab. Figure 11 Replacing an image
- Enter the image address, as shown in Figure 12.
- Click OK.
Last Article: Creating a ConfigMap
Next Article: Checking Audit Results




Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.