<p>I would want to use a custom Secure Content Context on my <strong>deployment.yaml</strong> .
so one of my colleague create a custom SCC and applied it .</p>
<pre><code>$oc get scc 
restricted-plus  false &lt;no value&gt;  MustRunAs  MustRunAsRange  MustRunAs  RunAsAny  &lt;no value&gt;  false      [&quot;configMap&quot;,&quot;downwardAPI&quot;,&quot;emptyDir&quot;,&quot;persistentVolumeClaim&quot;,&quot;projected&quot;,&quot;secret&quot;]
</code></pre>
<p>On <a href="https://kubernetes.io/docs/tutorials/clusters/seccomp/#create-a-pod-with-a-seccomp-profile-for-syscall-auditing" rel="nofollow noreferrer">kubernetes documentation</a> they show how to use scc with <strong>.json</strong> file but not how to call scc who is already load on the cluster .</p>
<p>Doesn't matter so i tried  this on my <strong>deployment.yaml</strong></p>
<pre><code>template:
  metadata: 
    creationTimestamp: null 
    labels:
      app: test-app
  spec:
    securityContext:
      seccomProfiles:
        localhostProfile: restricted-plus:
    containers:
    - args: 
</code></pre>
<p>Unfortunately it doesn't work :(</p>
<p>How can i use my custom scc <strong>restricted-plus</strong> on my <strong>deployment.yaml</strong> ?</p>

brunoli
<p>First of all, SCC is specific to OpenShift.  They don't exist in Kubernetes (SCC is different to seccomp profiles).</p>
<p>You don't &quot;use your custom SCC&quot;.  Instead, you create the SCC, then create roles/rolebindings to permit a given user access to &quot;use&quot; it.</p>
<p>Now, when that user tries to create a pod, the most restrictive SCC that will admit the pod is used to do so.  Since the user now has more SCCs available, more permissive pods will be able to be admitted to the cluster.</p>
<p><a href="https://docs.openshift.com/container-platform/4.9/authentication/managing-security-context-constraints.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/4.9/authentication/managing-security-context-constraints.html</a> has more details.</p>
