4040 runAsNonRoot: true
4141 seccompProfile:
4242 type: Localhost
43- localhostProfile: operator/my-namespace/ profile1.json
43+ localhostProfile: operator/profile1.json
4444 containers:
4545 - name: test-container
4646 image: quay.io/security-profiles-operator/test-nginx-unprivileged:1.21
@@ -54,14 +54,14 @@ spec:
5454+
5555[source,terminal]
5656----
57- $ oc -n my-namespace get seccompprofile profile1 -- output wide
57+ $ oc get seccompprofile profile1 -- output wide
5858----
5959+
6060.Example output
6161[source,terminal]
6262----
6363NAME STATUS AGE SECCOMPPROFILE.LOCALHOSTPROFILE
64- profile1 Installed 14s operator/my-namespace/ profile1.json
64+ profile1 Installed 14s operator/profile1.json
6565----
6666
6767. View the path to the localhost profile by running the following command:
@@ -74,7 +74,7 @@ $ oc get sp profile1 --output=jsonpath='{.status.localhostProfile}'
7474.Example output
7575[source,terminal]
7676----
77- operator/my-namespace/ profile1.json
77+ operator/profile1.json
7878----
7979
8080. Apply the `localhostProfile` output to the patch file:
8787 securityContext:
8888 seccompProfile:
8989 type: Localhost
90- localhostProfile: operator/my-namespace/ profile1.json
90+ localhostProfile: operator/profile1.json
9191----
9292
9393. Apply the profile to any other workload, such as a `Deployment` object, by running the following command:
@@ -117,7 +117,7 @@ $ oc -n my-namespace get deployment myapp --output=jsonpath='{.spec.template.spe
117117----
118118{
119119 "seccompProfile": {
120- "localhostProfile": "operator/my-namespace/ profile1.json",
120+ "localhostProfile": "operator/profile1.json",
121121 "type": "localhost"
122122 }
123123}
@@ -143,13 +143,13 @@ $ oc label ns nginx-deploy --overwrite=true pod-security.kubernetes.io/enforce=p
143143+
144144[source,terminal]
145145----
146- $ oc get selinuxprofile.security-profiles-operator.x-k8s.io/nginx-secure -n nginx-deploy - ojsonpath='{.status.usage}'
146+ $ oc get selinuxprofile.security-profiles-operator.x-k8s.io/nginx-secure -ojsonpath='{.status.usage}'
147147----
148148+
149149.Example output
150150[source,terminal]
151151----
152- nginx-secure_nginx-deploy .process
152+ nginx-secure_ .process
153153----
154154
155155. Apply the output string in the workload manifest in the `.spec.containers[].securityContext.seLinuxOptions` attribute:
@@ -175,7 +175,7 @@ spec:
175175 drop: [ALL]
176176 seLinuxOptions:
177177 # NOTE: This uses an appropriate SELinux type
178- type: nginx-secure_nginx-deploy .process
178+ type: nginx-secure_ .process
179179----
180180+
181181[IMPORTANT]
0 commit comments