<p>I want to convert below line to run as a bash script so that i can call it using jenkins job.</p>

<pre><code>kubectl create -f tiller-sa-crb.yaml
</code></pre>

<p>The tiller-sa-crb.yaml is below. How can i convert my above command in bash script. such that my jenkins job calls ./tiller-sa-crb.sh and it does all below. Basically, my end goal is to have a pure shell script and invoke that on jenkins job.</p>

<pre><code>apiVersion: v1
  kind: ServiceAccount
  metadata:
    name: tiller
    namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
   name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: tiller
  namespace: kube-system
</code></pre>

<p>You can also make use of stdin to kubectl create command, like this:</p>

<pre><code>#!/usr/bin/env bash

cat &lt;&lt;EOF | kubectl create -f -
apiVersion: v1
  kind: ServiceAccount
  metadata:
    name: tiller
    namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
   name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: tiller
  namespace: kube-system
EOF
</code></pre>
