<p>I have 'deployment.yaml' &amp; 'service.yaml' files to deploy application in kubernetes (minikube).</p>
<p>To do a manual deployment I can use <code>kubectl apply -f &lt;file.yaml&gt; </code> to create resources but I am looking for a way to automate  deployment using scripts. So I can trigger a script and all the  needed yaml can be triggered and pods created accordingly.</p>
<p>Any suggestion or guidance will be helpful.</p>

mebb
<p>It sounds to me like you need some simple bash script where you put all commands you need</p>
<pre><code>#!/bin/bash

NAMESPACE='mebbns'
DEPL_DIR='~/mebb_depl'
SVC_DIR='~/svc_depl'

kubectl create namespace $NAMESPACE 
kubectl apply -n $NAMESPACE -f &quot;$DEPL_DIR/deployment.yaml&quot;
kubectl apply -n $NAMESPACE -f &quot;$SVC_DIR/service.yaml&quot;
kubectl get all -n $NAMESPACE
</code></pre>
<p>For more complex tasks you can check examples like  <a href="https://github.com/RoyKimYYZ/linux-scripts/blob/master/setup-aks-vnet-acr.sh" rel="nofollow noreferrer">setup-aks-vnet-acr.sh</a></p>
<p><a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">kubectl Cheat Sheet</a> should help you with basic commands you may require.</p>
