<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged ckad</title>
<link>https://coderlegion.com/tag/ckad</link>
<description>Powered by Question2Answer</description>
<item>
<title>Kubernetes Autoscaling: HPA vs VPA Explained With Hands-On Practice</title>
<link>https://coderlegion.com/21685/kubernetes-autoscaling-hpa-vs-vpa-explained-with-hands-on-practice</link>
<description>&lt;p&gt;If you've ever wondered how Kubernetes knows when to spin up more pods or give a pod more memory, that's autoscaling — and it's one of those concepts that sounds intimidating until you actually do it yourself. Day 17 of the &lt;strong&gt;#40DaysOfKubernetes&lt;/strong&gt; challenge is where it clicked for me.&lt;/p&gt;
&lt;h3 id=&quot;what-is-autoscaling-in-kubernetes-&quot;&gt;What is Autoscaling in Kubernetes?&lt;/h3&gt;
&lt;p&gt;At its core, autoscaling means Kubernetes adjusts resources automatically based on demand. You don't manually intervene every time traffic spikes. There are two main types:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HPA (Horizontal Pod Autoscaler)&lt;/strong&gt; — adds or removes &lt;em&gt;pods&lt;/em&gt; based on CPU/memory usage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;VPA (Vertical Pod Autoscaler)&lt;/strong&gt; — adjusts the &lt;em&gt;resources&lt;/em&gt; (CPU/memory) of existing pods&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Think of HPA as hiring more staff when the shop gets busy. VPA is more like giving one staff member more tools to handle the workload alone.&lt;/p&gt;
&lt;h3 id=&quot;what-i-did-setting-up-hpa&quot;&gt;What I Did — Setting Up HPA&lt;/h3&gt;
&lt;p&gt;First I deployed the sample &lt;code&gt;php-apache&lt;/code&gt; app with defined CPU requests and limits:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: php-apache
spec:
  selector:
    matchLabels:
      run: php-apache
  template:
    metadata:
      labels:
        run: php-apache
    spec:
      containers:
      - name: php-apache
        image: registry.k8s.io/hpa-example
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: 500m
          requests:
            cpu: 200m

apiVersion: v1
kind: Service
metadata:
  name: php-apache
  labels:
    run: php-apache
spec:
  ports:
  - port: 80
  selector:
    run: php-apache
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/6lq2po2w7eyqa0rbnudv.png&quot; alt=&quot;Applying the yaml file&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/3c2jkflui4osryhdzexl.png&quot; alt=&quot;The pod is up and running&quot;&gt;&lt;/p&gt;
&lt;p&gt;The key part is setting &lt;code&gt;resources.requests.cpu&lt;/code&gt; — HPA needs this to calculate utilization. Without it, the autoscaler has nothing to measure against.&lt;/p&gt;
&lt;p&gt;Then I created the HPA object targeting &lt;strong&gt;50% average CPU utilization&lt;/strong&gt;, with a minimum of 1 pod and maximum of 10. This is the declarative method:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: php-apache
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: php-apache
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While this is the imperative method:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/ssc3zqmdmziq9do8m8e6.png&quot; alt=&quot;autoscale applied&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/yvs8u3wxankaprcqgdtr.png&quot; alt=&quot;Autoscale complete&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;generating-load-to-watch-it-scale&quot;&gt;Generating Load to Watch It Scale&lt;/h3&gt;
&lt;p&gt;This is the fun part. I ran a load generator in a separate pod — basically a loop hammering the apache service with requests:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl run -i --tty load-generator --rm --image=busybox:1.28 --restart=Never -- \
  /bin/sh -c &quot;while sleep 0.01; do wget -q -O- http://php-apache; done&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then watched the HPA respond in real time:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl get hpa php-apache --watch
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/k8v89l3t8fryl174now5.png&quot; alt=&quot;Image description&quot;&gt;&lt;/p&gt;
&lt;p&gt;Watching the replica count climb from 1 to several pods as CPU utilization crossed 50% made the whole concept land in a way that reading documentation never does.&lt;/p&gt;
&lt;h3 id=&quot;hpa-vs-vpa-when-do-you-use-which-&quot;&gt;HPA vs VPA — When Do You Use Which?&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;HPA &lt;/th&gt;&lt;th&gt;VPA&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Scales&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;Number of pods &lt;/td&gt;&lt;td&gt;Pod resource limits&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Best for&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;Stateless apps with variable traffic &lt;/td&gt;&lt;td&gt;Apps where sizing is hard to predict upfront&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Works with&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;CPU, memory, custom metrics &lt;/td&gt;&lt;td&gt;CPU and memory&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In practice, most production workloads use HPA. VPA is useful during early deployment when you're still figuring out the right resource requests for an app.&lt;/p&gt;
&lt;h3 id=&quot;key-takeaway&quot;&gt;Key Takeaway&lt;/h3&gt;
&lt;blockquote&gt;&lt;p&gt;Don't skip setting &lt;code&gt;resources.requests&lt;/code&gt; in your deployment spec. HPA is blind without it. That one line is what connects your workload to the autoscaler.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/21685/kubernetes-autoscaling-hpa-vs-vpa-explained-with-hands-on-practice</guid>
<pubDate>Wed, 01 Jul 2026 12:25:29 +0000</pubDate>
</item>
<item>
<title>Tips for passing CKAD exam at 1st attempt (2026 Edition)</title>
<link>https://coderlegion.com/16844/tips-for-passing-ckad-exam-at-1st-attempt-2026-edition</link>
<description>&lt;h3 id=&quot;how-it-all-started&quot;&gt;How it all started&lt;/h3&gt;
&lt;p&gt;Last year we got news: our new client would be using Kubernetes extensively. I was both excited and scared, as I had only limited exposure to Docker in a professional setting, and K8s is the next level.&lt;/p&gt;
&lt;p&gt;After doing some research, I had a chat with my boss which resulted in funding for both the &lt;strong&gt;KodeKloud&lt;/strong&gt; platform and two attempts at the &lt;strong&gt;CKAD exam&lt;/strong&gt; (we lucked out by buying the exam at half price during Cyber Week). That started the long process of learning Kubernetes from scratch under the guidance of Mumshad Mannambeth and his excellent CKAD course.&lt;/p&gt;
&lt;h3 id=&quot;ckad-exam-structure&quot;&gt;CKAD Exam Structure&lt;/h3&gt;
&lt;p&gt;The exam consists of &lt;strong&gt;~20 practical tasks&lt;/strong&gt; that you need to solve in &lt;strong&gt;120 minutes&lt;/strong&gt;. You are supervised by a proctor throughout the process.&lt;/p&gt;
&lt;p&gt;As of 2026, you are required to use the &lt;strong&gt;PSI Secure Browser&lt;/strong&gt;. This app monitors your system, kills unauthorized processes, and requires full access to your camera and microphone. &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;Important changes compared to previous years:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Copy-Paste:&lt;/strong&gt; Past exams used a browser extension that made copy-pasting clunky. Now, it's seamless using either &lt;code&gt;Ctrl+C&lt;/code&gt; / &lt;code&gt;Ctrl+V&lt;/code&gt; or &lt;code&gt;Ctrl+Shift+C&lt;/code&gt; / &lt;code&gt;Ctrl+Shift+V&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context Switching:&lt;/strong&gt; While KodeKloud tests still use a simple context switch, both &lt;strong&gt;Killer.sh&lt;/strong&gt; and the actual exam often require you to &lt;code&gt;ssh&lt;/code&gt; into different nodes. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Aliases:&lt;/strong&gt; In the past, people recommended setting up complex aliases like &lt;code&gt;export do=&quot;--dry-run=client -o yaml&quot;&lt;/code&gt;. Now, because you frequently switch sessions via SSH, these aliases don't persist unless you re-apply them. The only pre-configured alias is &lt;code&gt;k&lt;/code&gt; for &lt;code&gt;kubectl&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;the-ingress-vs-gateway-api-situation&quot;&gt;The Ingress vs. Gateway API Situation&lt;/h4&gt;
&lt;p&gt;Around the turn of 2025/2026, the Gateway API became the new standard, and the traditional Nginx Ingress Controller was deprecated in many environments.&lt;/p&gt;
&lt;p&gt;However, don't let that fool you! In my actual exam (April 2026), I had two tasks regarding Ingress and zero tasks regarding Gateway API. This shows that the curriculum still leans heavily on Ingress.&lt;/p&gt;
&lt;p&gt;My advice: Be prepared for both. Mastering Gateway API is important for the future, but for the sake of the exam, make sure you can still write a classic Ingress YAML in your sleep.&lt;/p&gt;
&lt;h4 id=&quot;credly&quot;&gt;Credly&lt;/h4&gt;
&lt;p&gt;Passing the exam results in a PDF certificate that verifies your skills. You can also showcase your achievement with a digital badge on Credly:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6m9sphnhk6zkcrn72b51.png&quot; alt=&quot;Credly site with CKAD certification badge&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;navigating-the-documentation&quot;&gt;Navigating the Documentation&lt;/h3&gt;
&lt;p&gt;During the exam, you are allowed to use the official Kubernetes documentation, API docs, and discussion threads. This is crucial for copying YAML snippets that cannot be easily generated via imperative commands.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th align=&quot;left&quot;&gt;Resource &lt;/th&gt;&lt;th align=&quot;left&quot;&gt;Strategy&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Network Policy&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Copy YAML (hard to memorize)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Persistent Volumes&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Copy YAML (use &lt;code&gt;Ctrl+F&lt;/code&gt; for &quot;kind: PersistentVolume&quot;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Probes&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Memorize syntax or quick copy&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Env Vars (Secrets/CM)&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Memorize &lt;code&gt;env&lt;/code&gt;, &lt;code&gt;envFrom&lt;/code&gt;, &lt;code&gt;valueFrom&lt;/code&gt; to save time&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Ingress&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Copy YAML&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Resources/Limits&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Memorize (simple syntax)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Init &amp;amp; Sidecars&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Memorize (note: Native Sidecars use &lt;code&gt;restartPolicy: Always&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;SecurityContext&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Better to memorize (can be tricky to find quickly)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;CronJob&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Use docs if you forget the cron schedule format&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;TIP:&lt;/strong&gt; Before the exam, click through each resource in the docs to familiarize yourself with their location. Scrolling in the PSI browser can be painfully slow, so get used to using &lt;code&gt;Ctrl+F&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;the-learning-curve&quot;&gt;The Learning Curve&lt;/h3&gt;
&lt;p&gt;The start of the course was the hardest part—grasping the depth of the Kubernetes ecosystem. Understanding the theory behind cluster components and dependencies was time-consuming but essential for context.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Middle Section (Core Concepts to Kustomize)&lt;/strong&gt; was the most useful. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Go Imperative:&lt;/strong&gt; From day one, study imperative commands. You need to create pods, deployments, and services as fast as possible. &lt;code&gt;k run&lt;/code&gt;, &lt;code&gt;k create&lt;/code&gt;, and &lt;code&gt;k expose&lt;/code&gt; are your best friends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;YAML Mastery:&lt;/strong&gt; Learn to tweak resources quickly using &lt;code&gt;k apply -f &amp;lt;filename&amp;gt;&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Details:&lt;/strong&gt; Remember the subtle differences, like &lt;code&gt;port&lt;/code&gt; vs. &lt;code&gt;targetPort&lt;/code&gt; vs. &lt;code&gt;nodePort&lt;/code&gt;, or how Native Sidecars are now handled within the &lt;code&gt;initContainers&lt;/code&gt; field.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The Final Stretch:&lt;/strong&gt;&lt;br&gt;
Don't skip the mock exams. I highly recommend the &lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.kodekloud.com/user/courses/ultimate-certified-kubernetes-application-developer-ckad-mock-exam-series&quot;&gt;KodeKloud Mock Exam Series&lt;/a&gt;. They can be frustrating because a minor typo results in a zero score, but they keep you humble and precise. After these, I tackled &lt;strong&gt;Killer.sh&lt;/strong&gt;, scoring 66/113 on my first try without rushing. It gave me the confidence I needed.&lt;/p&gt;
&lt;h3 id=&quot;how-long-does-it-take-&quot;&gt;How long does it take?&lt;/h3&gt;
&lt;p&gt;I started with zero K8s knowledge in November 2025 and passed on April 24th, 2026. This included a 2-month break, followed by a final month of &quot;crunching&quot; the material.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prepare yourself for around 4 months of learning at a steady pace, or faster if you are already familiar with some Kubernetes concepts.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My take?&lt;/strong&gt; Don't over-test yourself. I was ready sooner than I thought. At some point, doing too many mock tests with rigid grading can actually degrade your confidence. If you find yourself stuck on minor caveats, step back, review the fundamentals, and then hit a &lt;strong&gt;Killer.sh&lt;/strong&gt; session. If you can handle that environment, you are ready for the real thing.&lt;/p&gt;
&lt;h3 id=&quot;useful-links&quot;&gt;Useful Links&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/cncf/curriculum&quot;&gt;Official CKAD Curriculum (GitHub)&lt;/a&gt; - Check what is actually on the exam.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://kubernetes.io/docs/&quot;&gt;Kubernetes Documentation&lt;/a&gt; - Your only allowed friend during the test.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://killer.sh&quot;&gt;Killer.sh&lt;/a&gt; - The best exam simulator (usually harder than the real thing!).&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://kodekloud.com/courses/certified-kubernetes-application-developer-ckad/&quot;&gt;KodeKloud CKAD Course&lt;/a&gt; - My primary learning resource.&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.kodekloud.com/user/courses/ultimate-certified-kubernetes-application-developer-ckad-mock-exam-series&quot;&gt;KodeKloud CKAD Mock exams&lt;/a&gt; - Mock tests to learn how to work under pressure of time.&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/16844/tips-for-passing-ckad-exam-at-1st-attempt-2026-edition</guid>
<pubDate>Wed, 06 May 2026 09:49:54 +0000</pubDate>
</item>
</channel>
</rss>