Custom SCC Deployment Steps
This page describes the recommended order for deploying SmartAgent on OpenShift with a custom SCC: download smartagent.yml from ONE → deploy the SCC → deploy SmartAgent. For background and the privileged SCC alternative, see OpenShift deployment.
Plain-text notes without screenshots, used for test records and review, are in OpenShift test verification notes.
- Cluster-admin or equivalent permission, with
occonfigured and access to the target OpenShift cluster. - Nodes can reach the SmartAgent download and upload addresses.
- Bonree Operator full-stack mode is not supported on OpenShift yet. Deploy with the DaemonSet YAML.
Step 1: Download smartagent.yml from ONE
- Log in to Bonree ONE and go to Configuration > Agent Installation > Kubernetes.
- Select the SmartAgent / SmartGate version and technology type, and fill in required items such as
Cluster Name. - Expand Advanced settings and set Deployment mode to Custom mode (required when you use a custom SCC; do not use Standard mode).

-
Configure the namespace, install directory, install parameters, and other items as needed (consistent with OpenShift deployment).
-
In the YAML preview or install guide on the right side of the page, download the YAML file and save it locally as
smartagent.yml(you can use another file name; this page uses this name). -
Edit
smartagent.ymlbefore deployment: the YAML generated by ONE does not include the following startup arguments by default. Manually append them to the SmartAgent DaemonSet containerargs(place them after the other install arguments, and keep platform-generated items such as the connection and cluster name unchanged):
- "--non-root-mode"
- "true"
- "--user"
- "core"
- "--group"
- "core"

-
Install path (recommended on OpenShift): use
/var/optas the host directory. Runrealpath /opton a node to confirm the real path (the common result is/var/opt). Do not use a path that contains a symlink. If you change the directory, updatehostPath.pathofhost-install-path,SMARTAGENT_INSTALL_PATH, andvolumeMounts.mountPathin the YAML. See OpenShift deployment — Installation path recommendation. -
SELinux
level(as needed): if step 2 setslevelonseLinuxContextinscc.yml, set the same value on the PodsecurityContext.seLinuxOptions.levelinsmartagent.yml(see "SELinuxlevel" in step 2). You can omit it when the SCC does not setlevel.
Finish this step and keep the edited smartagent.yml before you run cluster operations in steps 2 and 3. users in scc.yml must match the ServiceAccount in smartagent.yml (default system:serviceaccount:bonree-agent:bonree-smartagent-enhance).
Step 2: Edit and deploy scc.yml
-
Get the SCC template: scc.yml (or copy it from
static/en/smartagent/openshift/scc.ymlin the repository). -
Confirm that both of the following are
MustRunAs(if the template saysMustRunAsAny, change it toMustRunAs):
seLinuxContext:
type: MustRunAs
supplementalGroups:
type: MustRunAs

SELinux level
- The default SCC template only constrains
seLinuxContext.type(for example,MustRunAs). It does not require a fixed MCS/MLSlevel. You can setlevelto any value for the customer environment. Bonree does not require a specific value. - If the customer explicitly sets
levelinseLinuxContextinscc.yml(and possiblyuser,role, and similar fields),securityContext.seLinuxOptionson the Pod insmartagent.ymlmust match the SCC (at least thelevelmust be the same). Otherwise the Pod may fail SCC validation or not match the SCC policy.
SCC example (when the customer sets a custom level):
seLinuxContext:
type: MustRunAs
level: s0:c34,c14 # Example value. Use the actual policy.
Set the same level in spec.template.spec.securityContext of the DaemonSet in smartagent.yml (or the container-level securityContext, matching the YAML structure), for example:
securityContext:
seLinuxOptions:
level: 's0:c34,c14'

Use oc describe scc bonree-smartagent-scc or oc get pod <pod> -o yaml to check that the SELinux fields on the Pod and the SCC match.
- If the namespace or ServiceAccount name in
smartagent.ymldiffers from the default, update theuserslist inscc.yml, for example:
users:
- system:serviceaccount:<namespace>:<ServiceAccount name>
- The ServiceAccount must already exist before you apply the SCC. If it does not exist yet, apply only the Namespace, ServiceAccount, RBAC, and similar resources from
smartagent.ymlfirst (do not create the DaemonSet yet), or run:
# Example: create the namespace only (if it is not already applied from the YAML)
oc create namespace bonree-agent --dry-run=client -o yaml | oc apply -f -
# Then apply the SA/RBAC resources from smartagent.yml. Or apply the whole file; if the DaemonSet fails because of the SCC, finish the SCC before step 3.
- Deploy the SCC:
oc apply -f scc.yml
- Verify the SCC and the binding (as needed):
oc get scc bonree-smartagent-scc
oc describe scc bonree-smartagent-scc
If the binding is not declared in users, add it:
oc adm policy add-scc-to-user bonree-smartagent-scc -z bonree-smartagent-enhance -n bonree-agent
Step 3: Deploy SmartAgent
After the SCC is in effect, apply the smartagent.yml prepared in step 1. You can deploy when node SELinux is Enforcing, Permissive, or Disabled. No mode is required. When troubleshooting, you can temporarily switch Enforcing or Permissive to Permissive. If SELinux is enabled and seLinuxOptions (such as level) is set on both the SCC and the Pod, keep them the same.
oc apply -f smartagent.yml
Check the running status
oc get pods -n bonree-agent
oc get ds -n bonree-agent
oc describe pod -n bonree-agent -l app=bonree-smartagent # Use the label from the actual YAML
If the Pod is rejected because of the SCC or SELinux, check the events:
oc get events -n bonree-agent --sort-by='.lastTimestamp'
Uninstall (brief)
oc delete -f smartagent.yml
# Or follow the uninstall steps in [Kubernetes deployment (DaemonSet)](/ingest/agent/smartagent/kubernetes/index), using oc
oc delete scc bonree-smartagent-scc # When the custom SCC is no longer needed