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 Create DaemonSet. . Click
- Configure basic information about the workload For more information, see Table 1.
- Click Next: Add Container. Click Add Container. In the dialog box that is displayed, click the Open source Images tab. Search for centos, and click OK.
- Set CentOS image parameters.
- Click the Basic Information tab. Select the image centos7.6.1810 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. Configure the following parameters and retain the default values for other parameters:
- Start Command: command executed when a container is started
/bin/bash
-c
while true; do sleep 10; done;
- Post-Start: command executed while a container is up and running
- Method: Select the installation package based on the CPU architecture and run the corresponding commands.
- If the x86 CPU is used, run the following commands:
-c
tar xvf /tmp/dbss/agent/audit_agent-x86_64-linux-cce.tar.gz -C /opt;/opt/dbss_agent/install.sh;rm -rf /opt/dbss_agent
- If the Arm CPU is used, run the following commands:
-c
tar xvf /tmp/dbss/agent/audit_agent-aarch64-linux-cce.tar.gz -C /opt;/opt/dbss_agent/install.sh;rm -rf /opt/dbss_agent
- 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).
- 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).
- 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, Data Storage, and 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.6.1810 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.
- Choose Workloads > DaemonSets. 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 1 Editing a YAML file
- Click Edit.
- Check the DaemonSet workload status.
If the workload is in the Running state, it has been successfully created.
- Wait for 2 to 3 minutes. After the deployment succeeded, return to the DBSS console. Check the agent status.
In the agent list of a database, if the value of General is Yes and Status is Running, the agent has been 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.
- You are advised to do this in a new browser window: On the management console, choose .
- In the navigation pane, choose Image Resources > Image Center.
- Click Image Accelerator. In the displayed Image Accelerator dialog box, copy the accelerator address. Remove https:// from the address, and add /library/centos:centos7.5.1804 to the end of the address.
Example: 7b01ab6xxxxfb06b2.mirror.swr.myhuaweicloud.com/library/centos:centos7.5.1804
- 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.
- Enter an image name.
- Click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot