<p>I am trying to create multiple roles in Kubernetes in a single YAML file.<br>
I am not sure if it possible.  </p>

<p>This is what I tried:  </p>

<pre><code>cat &gt; ~/tmp/Role.yaml &lt;&lt;EOF 
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata: 
  namespace: default
  name: testRole1
rules: 
- apiGroups: ["", "extensions", "apps"]
  resources: ["pods"]
  verbs: ["get", "list"] 

kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata: 
  namespace: default
  name: testRole2
rules: 
- apiGroups: ["", "extensions", "apps"]
  resources: ["pods"]
  verbs: ["get"] 
EOF

kubectl create -f ~/tmp/Role.yaml
</code></pre>

<p>It creates me only the latter - <code>testRole2</code>.  </p>

<p>Is it possible to do it in one YAML file or I need to create YAML file for each Role ?  </p>

E235
<p>I just received an answer from @liggitt.  </p>

<p>Need to add a record separator between them (<code>---</code>).  </p>
