OpenShift Deployment
- OpenShift deployment is supported starting from SmartAgent 9.10.0 (consistent with Technology support matrix — Supported container orchestration tools).
- This document and the installation verification are based on OpenShift
4.20.0-okd-scos.0(recorded as OpenShift 4.20 in the matrix, with CRI-O 1.33.3). Other OpenShift versions have not been fully tested. Verify them in the target environment before production use.
When you deploy SmartAgent as a DaemonSet on OpenShift, the Pod needs to mount host directories and use specific capabilities. You usually must configure Security Context Constraints (SCC) before installing the agent. The recommended order is: create and bind the SCC → deploy SmartAgent (set --user / --group to core in the startup arguments before deployment).
When you use a custom SCC, see Custom SCC deployment steps for the deployment procedure.
Before you deploy
Permissions
- You need cluster-admin or equivalent permission (create SCC, ClusterRole/RoleBinding, DaemonSet, namespace, and similar resources).
- You can log in to the target cluster with
ocand create resources in the target namespace (defaultbonree-agent).
Environment
- See Version and verification scope above for the OpenShift version and the minimum SmartAgent version. For the DaemonSet install method, see Kubernetes deployment (DaemonSet).
- Each node can reach the SmartAgent download and upload addresses (for example,
oneupload.bonree.com). - For deployment capability and version range, see Technology support matrix and Host resource requirements.
If a custom SCC still cannot be scheduled, check the event logs, or switch to the privileged SCC (see section 3 of step 1).
How SCC choices map to ONE install modes
| SCC method | ONE deployment mode (Kubernetes install page → Advanced settings) |
|---|---|
| Bind the built-in cluster privileged SCC | Standard mode or Custom mode |
Use the custom SCC in this document (bonree-smartagent-scc) | You must select Custom mode |
Step 1: Create and bind the SCC
The ServiceAccount used by the SmartAgent DaemonSet is usually bonree-smartagent-enhance in the bonree-agent namespace (the same as the YAML generated by the platform). Grant that account an SCC it can use.
1. Create a custom SCC (try this first)
Save the following as bonree-smartagent-scc.yaml and apply it:
allowHostDirVolumePlugin: true
allowHostIPC: false
allowHostNetwork: true
allowHostPID: true
allowHostPorts: false
allowPrivilegeEscalation: true
allowPrivilegedContainer: false
allowedCapabilities:
- CHOWN
- DAC_OVERRIDE
- DAC_READ_SEARCH
- FOWNER
- FSETID
- SETFCAP
- SETGID
- SETUID
- SYS_PTRACE
- SYS_RESOURCE
- SYS_CHROOT
- SYS_ADMIN
- SYSLOG
- NET_ADMIN
- NET_RAW
- NET_BROADCAST
apiVersion: security.openshift.io/v1
defaultAddCapabilities: null
fsGroup:
type: MustRunAs
groups: []
kind: SecurityContextConstraints
metadata:
name: bonree-smartagent-scc
priority: null
readOnlyRootFilesystem: true
requiredDropCapabilities: null
runAsUser:
type: RunAsAny
seLinuxContext:
type: MustRunAsAny
supplementalGroups:
type: MustRunAsAny
users:
- system:serviceaccount:bonree-agent:bonree-smartagent-enhance
volumes:
- '*'
oc apply -f bonree-smartagent-scc.yaml
When you use this custom SCC, select Custom mode on the ONE Kubernetes install page in step 2 (see the mapping table in "Before you deploy").
On some clusters, a custom SCC alone may still not fully meet the SmartAgent runtime requirements (this depends on the customer environment and SELinux policy). If the Pod is rejected because of the SCC, run oc describe pod / oc get events to see why. If needed, use the privileged SCC below, or ask the cluster administrator to adjust the policy.
2. Confirm the ServiceAccount is bound to the SCC
The YAML above grants the SCC to bonree-smartagent-enhance through the users field. If you use another namespace or ServiceAccount name, update the users list, or bind it after deployment:
# Example: grant the custom SCC to a ServiceAccount (replace the namespace and SA name as needed)
oc adm policy add-scc-to-user bonree-smartagent-scc -z bonree-smartagent-enhance -n bonree-agent
3. Bind the built-in privileged SCC
If the security policy allows it, or the custom SCC does not take effect, use the built-in OpenShift privileged SCC (it grants more permission; review compliance requirements). After you bind privileged, you can use Standard mode or Custom mode when installing on the ONE platform (see the mapping table above).
Option A: Declare privileged in the SmartAgent ClusterRole
Add the following rule to the ClusterRole in the deployment YAML (the name is usually bonree-smartagent-enhance):
- apiGroups:
- security.openshift.io
verbs:
- use
resources:
- securitycontextconstraints
resourceNames:
- privileged
Option B: Bind from the command line
oc adm policy add-scc-to-user privileged -z bonree-smartagent-enhance -n bonree-agent
Step 2: Deploy SmartAgent
After the SCC is configured, install SmartAgent on OpenShift with a DaemonSet (the same entry as Kubernetes; use oc instead of kubectl). Bonree Operator full-stack mode is not supported on OpenShift yet. Do not deploy with that method.
On RHCOS / OpenShift, append --non-root-mode, --user core, and --group core to the container args manually before the DaemonSet is created for the first time (the YAML generated by ONE does not include these items by default). This avoids starting the Pod with the default arguments and then changing the configuration.
The overall flow matches Kubernetes deployment (DaemonSet). On OpenShift, choose the deployment mode together with the SCC, and add the core user and group arguments before apply:
- Log in to the Bonree ONE platform.
- Go to Configuration > Agent Installation > Kubernetes.
- Select the SmartAgent / SmartGate version and technology type, and fill in basic items such as
Cluster Name. - Expand Advanced settings:
- If step 1 used the custom SCC, Deployment mode must be Custom mode (Standard mode does not match the custom SCC).
- If the privileged SCC is bound, you can choose Standard mode or Custom mode according to the security policy.
- The deployment mode for the custom SCC is shown below (
--non-root-mode/--user/--groupare not in the platform default YAML; write them intoargsmanually in step 6):

- Download the SmartAgent deployment YAML to your local machine, and manually append the following arguments to the DaemonSet container
args(they are not defaults):
- "--non-root-mode"
- "true"
- "--user"
- "core"
- "--group"
- "core"
Example (use the platform YAML as the source of truth):

Installation path recommendation
On OpenShift / RHCOS nodes, /opt is often a symlink to /var/opt. Use /var/opt as the SmartAgent host install directory (or the real path returned by the command below). Do not use a symlink path that still points to another directory.
Confirm this on a node before deployment:
realpath /opt
# Example output:
# /var/opt
In ONE Advanced settings → Install directory, enter /var/opt. If you need another directory, confirm first that the path is not a symlink (check with realpath), and use the same real path in all three YAML settings.
When you change the install directory, update all three places in the same install YAML (mountPath is usually /mnt/root joined with the host absolute path; for example, host /var/opt corresponds to /mnt/root/var/opt):
| Location | Field |
|---|---|
① volumes | name: host-install-path → hostPath.path |
② container env | value of SMARTAGENT_INSTALL_PATH |
③ container volumeMounts | name: host-install-path → mountPath |
① Host volume path (hostPath.path)

② Environment variable SMARTAGENT_INSTALL_PATH

③ Container mount path (volumeMounts.mountPath)

- Deploy with the edited manifest, for example:
# Replace <install URL> with the full address from the platform
curl -fsSL '<install URL>' -o bonree-smartagent-openshift.yaml
# Edit bonree-smartagent-openshift.yaml, add the args above, then run:
oc apply -f bonree-smartagent-openshift.yaml
If you already ran oc apply without the extra arguments, run oc edit ds bonree-smartagent -n bonree-agent to add the same args and wait for the Pod to roll out.
For advanced YAML items (ConfigMap and others), see Advanced configuration under the Kubernetes section.
Bonree Operator full-stack monitoring mode is not supported on OpenShift yet. See Bonree Operator. Deploy with the Operator flow after a later version adds support.
If the ServiceAccount or namespace name in the install YAML generated by the platform differs from this document, the namespace and ServiceAccount name in the SCC users field and in the oc adm policy command must match the YAML.
Uninstall
Uninstall the same way as Kubernetes deployment (DaemonSet). Replace kubectl with oc.
If the custom SCC is no longer needed, delete it after you confirm that no SmartAgent Pod is running:
oc delete scc bonree-smartagent-scc
Related documents
- Custom SCC deployment steps
- Kubernetes deployment (DaemonSet)
- Bonree Operator
- Update agent configuration with a Kubernetes ConfigMap
📄️ Custom SCC Deployment
Deploy SmartAgent on OpenShift with ONE custom mode and a custom SCC.