Update Agent Configuration via Kubernetes ConfigMap
Starting from version 9.7.0, SmartAgent supports updating agent configuration files dynamically through external sources via Kubernetes ConfigMap. Users can create a specific ConfigMap in the namespace where the agent is deployed. SmartAgent will automatically sync its content to the local path: /{installPath}/conf/.
Notes
- Keys in the ConfigMap must use double underscores
__to replace the/directory separators in file paths. - Keys must not contain
..path traversal characters. - Only configuration files with the extensions
.ini,.conf,.yaml,.yml, or.jsonare supported. - Only configuration files under the
conforagentsubdirectories of the installation directory are supported. - Files with
.yaml,.yml, or.jsonextensions will undergo format validation. Files that do not conform to the corresponding format will not be modified. - When changes in the ConfigMap are detected, SmartAgent will overwrite the local file with the same name directly.
ConfigMap Example
apiVersion: v1
kind: ConfigMap
metadata:
# Fixed name, do not change
name: bonree-smartagent-config-override
namespace: bonree-agent
data:
# Override {installDir}/conf/whitelist.yml file
whitelist.yml: |
whitelist:
# Executable program names
executable:
go:
- testserver_23
- testserver_arm64
java:
- org.eclipse.core.launcher.Main
# Override {installDir}/conf/nginx/bonree_module.conf file
nginx__bonree_module.conf: |
logLevel=Info
enableTraceInfoAppendToLog=0