<p>Is there a way to combine a namespace creation with a resource quota in one go? <br>
I'm looking for something like:</p>
<pre><code>apiVersion: v1
kind: Namespace
metadata:
    name: custom-namespace
quota: {&quot;cpu&quot;: &quot;400m&quot;, &quot;memory&quot;: &quot;1Gi&quot;}
</code></pre>

ocp1000
<p>You can combine different documents in the same YAML file using dashes as separator.</p>
<p>For your example it would like</p>
<pre><code>apiVersion: v1
kind: Namespace
metadata:
    name: custom-namespace
---
apiVersion: v1
kind: ResourceQuota
metadata:
  name: cpu
  namespace: custom-namespace
spec:
  hard:
    limits.cpu: &quot;400m&quot;
    limits.memory: 1Gi
</code></pre>
<p>You can then apply the file or pipe it from stdin.</p>
<pre><code>$ kubectl apply -f temp.yaml 
namespace/custom-namespace created
resourcequota/cpu created
</code></pre>
