<p>We currently are on EKS <code>1.22</code>, however with the updates to <code>1.25</code>, old security rules will be depreciated and the transition to Pod Security Admission will be enforced.</p>
<p>I am however, confused reading the updates whether the below code will still be fine. Currently we have a <code>kubernetes_job</code> defined in Terraform that has the below <code>security_context</code>:</p>
<pre><code>security_context {
  run_as_non_root = true
  run_as_user = &quot;1000&quot;
  run_as_group = &quot;2000&quot;
  capabilities {
    drop = [&quot;all&quot;]
  }
  allow_privilege_escalation = false
}
</code></pre>
<p>Will this still work in <code>1.25</code>? Or will this have to be changed?</p>

jipot
<p><a href="https://v1-24.docs.kubernetes.io/docs/reference/kubernetes-api/policy-resources/pod-security-policy-v1beta1/" rel="nofollow noreferrer">PodSecurityPolicy</a> was a separate API object.  The deprecation doesn't refer to the <a href="https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context" rel="nofollow noreferrer">security context in a PodSpec</a>, which you seem to be describing here in Terraform syntax; the PodSpec syntax is unchanged, including in Deployments and other higher-level objects.</p>
<p>Unless you're a cluster administrator or writing an operator that will be used principally by cluster administrators, the PodSecurityPolicy deprecation won't affect you.</p>
