<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Minikube on Journey through Cloud &amp; Code</title><link>https://gurupasupathy.com/tags/minikube/</link><description>Recent content in Minikube on Journey through Cloud &amp; Code</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 31 Jan 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://gurupasupathy.com/tags/minikube/index.xml" rel="self" type="application/rss+xml"/><item><title>Demo workflow for Minikube</title><link>https://gurupasupathy.com/post/2026-01-31_demo-workflow-for-minikube/</link><pubDate>Sat, 31 Jan 2026 00:00:00 +0000</pubDate><guid>https://gurupasupathy.com/post/2026-01-31_demo-workflow-for-minikube/</guid><description>&lt;p&gt;Photo by Shubham Dhage on Unsplash&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="img/1__L75eWRx0XZp7bUauqQgzog.jpeg"&gt;&lt;/p&gt;
&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@theshubhamdhage?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Shubham Dhage&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-black-and-white-photo-of-a-bunch-of-cubes-gC_aoAjQl2Q?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here’s a ready-to-run “one-shot” demo workflow for Minikube that sets up a webserver deployment, exposes it, configures HPA, and generates load so you can see autoscaling in action immediately.&lt;/p&gt;
&lt;p&gt;You can copy-paste these commands &lt;strong&gt;one after the other&lt;/strong&gt; in your terminal.&lt;/p&gt;
&lt;h3 id="step-0-optional-clean-up-old-resources"&gt;Step 0: (Optional) Clean up old resources&lt;/h3&gt;
&lt;p&gt;kubectl delete deployment webserver --ignore-not-found&lt;br&gt;
kubectl delete svc webserver --ignore-not-found&lt;br&gt;
kubectl delete hpa webserver --ignore-not-found&lt;br&gt;
kubectl delete pod load-generator --ignore-not-found&lt;/p&gt;</description><content:encoded><![CDATA[<p>Photo by Shubham Dhage on Unsplash</p>
<p><img loading="lazy" src="img/1__L75eWRx0XZp7bUauqQgzog.jpeg"></p>
<p>Photo by <a href="https://unsplash.com/@theshubhamdhage?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Shubham Dhage</a> on <a href="https://unsplash.com/photos/a-black-and-white-photo-of-a-bunch-of-cubes-gC_aoAjQl2Q?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
<p>Here’s a ready-to-run “one-shot” demo workflow for Minikube that sets up a webserver deployment, exposes it, configures HPA, and generates load so you can see autoscaling in action immediately.</p>
<p>You can copy-paste these commands <strong>one after the other</strong> in your terminal.</p>
<h3 id="step-0-optional-clean-up-old-resources">Step 0: (Optional) Clean up old resources</h3>
<p>kubectl delete deployment webserver --ignore-not-found<br>
kubectl delete svc webserver --ignore-not-found<br>
kubectl delete hpa webserver --ignore-not-found<br>
kubectl delete pod load-generator --ignore-not-found</p>
<h3 id="step-1-create-the-webserver-deployment">Step 1: Create the webserver deployment</h3>
<p>kubectl create deployment webserver --image=gcr.io/google_containers/echoserver:1.10</p>
<h3 id="step-2-expose-the-deployment-as-a-nodeportservice">Step 2: Expose the deployment as a NodePort service</h3>
<p>kubectl expose deployment webserver &ndash;type=NodePort &ndash;port=8080</p>
<p>Check service:</p>
<p>kubectl get svc webserver</p>
<h3 id="step-3-enable-metrics-server-if-notalready">Step 3: Enable metrics-server if not already</h3>
<p>minikube addons enable metrics-server</p>
<h3 id="step-4-create-horizontal-pod-autoscaler">Step 4: Create Horizontal Pod Autoscaler</h3>
<p>kubectl autoscale deployment webserver &ndash;cpu=20% &ndash;min=1 &ndash;max=5</p>
<p>Check HPA:</p>
<p>kubectl get hpa</p>
<h3 id="step-5-launch-load-generator-pod">Step 5: Launch load-generator pod</h3>
<p>kubectl run -i &ndash;tty load-generator &ndash;image=busybox &ndash; /bin/sh</p>
<p>Inside the pod, generate <strong>heavy load</strong>:</p>
<p>while true; do wget -q -O- http://webserver:8080 &amp; done</p>
<ul>
<li>The <code>&amp;</code> ensures requests run in parallel for higher CPU usage.</li>
<li>This will <strong>trigger the HPA</strong> to scale the webserver pods.</li>
</ul>
<h3 id="step-6-watch-autoscaling-in-anotherterminal">Step 6: Watch autoscaling in another terminal</h3>
<p>kubectl get hpa -w<br>
kubectl get pods -w</p>
<ul>
<li>You will see <strong>replicas increase</strong> as CPU usage rises.</li>
<li>When you stop the load (<code>Ctrl+C</code> in the BusyBox pod), HPA will scale pods back down.</li>
</ul>
<h3 id="step-7-optionaltest-webserver-fromhost">Step 7: Optional — test webserver from host</h3>
<p>minikube service webserver</p>
<ul>
<li>Opens your webserver in the browser.</li>
</ul>
]]></content:encoded></item></channel></rss>