Installing the Security Profiles Operator using the CLI
You can install the Red Hat OpenShift Container Platform Security Profiles Operator by using the command line interface.
-
You must have
cluster-adminprivileges.
-
Define a
Namespaceobject:Examplenamespace-object.yamlapiVersion: v1 kind: Namespace metadata: name: openshift-security-profiles labels: openshift.io/cluster-monitoring: "true" -
Create the
Namespaceobject:$ oc create -f namespace-object.yaml -
Define an
OperatorGroupobject:Exampleoperator-group-object.yamlapiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: security-profiles-operator namespace: openshift-security-profiles -
Create the
OperatorGroupobject:$ oc create -f operator-group-object.yaml -
Define a
Subscriptionobject:Examplesubscription-object.yamlapiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: security-profiles-operator-sub namespace: openshift-security-profiles spec: channel: release-alpha-rhel-8 installPlanApproval: Automatic name: security-profiles-operator source: redhat-operators sourceNamespace: openshift-marketplace -
Create the
Subscriptionobject:$ oc create -f subscription-object.yamlIf you are setting the global scheduler feature and enable
defaultNodeSelector, you must create the namespace manually and update the annotations of theopenshift-security-profilesnamespace, or the namespace where the Security Profiles Operator was installed, withopenshift.io/node-selector: “”. This removes the default node selector and prevents deployment failures.
-
Verify the installation succeeded by inspecting the following CSV file:
$ oc get csv -n openshift-security-profiles -
Verify that the Security Profiles Operator is operational by running the following command:
$ oc get deploy -n openshift-security-profiles