<p>I have the following manifest:</p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: my-psp-rb
roleRef:
  kind: Role
  name: psp-role
  apiGroup: rbac.authorization.k8s.io
subjects:
- kind: Group
  name: system:serviceaccounts:${NAMESPACE}
</code></pre>
<p>I would like to deploy this manifest as follows:
<code>kubectl apply -f psp-rb.yaml -n some_namespace</code>
in a way that the name in the subject is dynamically set. I know that <code>${NAMESPACE}</code> is not allowed, so I am looking for a way on how to do this. I looked into <a href="https://stackoverflow.com/questions/56003777/how-to-pass-environment-variable-in-kubectl-deployment">this</a> but I am not a huge fan of installing dependencies only for passing variables to a manifest (plus I agree variables shouldn't be used in this context). Maybe there is a kubernetesy way to do this?</p>

Simon Ernesto Cardenas Zarate
<p>Copying down from comments and confirming, this is not a thing kubectl supports. It's very simple :)</p>
