<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Labs on Nerdsid.com</title><link>https://nerdsid.com/formats/lab/</link><description>Recent content in Labs on Nerdsid.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 19 Aug 2026 12:00:00 +0000</lastBuildDate><atom:link href="https://nerdsid.com/formats/lab/index.xml" rel="self" type="application/rss+xml"/><item><title>The Kubernetes Pod That Refused to Die</title><link>https://nerdsid.com/posts/the-kubernetes-pod-that-refused-to-die/</link><pubDate>Wed, 19 Aug 2026 12:00:00 +0000</pubDate><guid>https://nerdsid.com/posts/the-kubernetes-pod-that-refused-to-die/</guid><description>&lt;p>The last task asks you to delete a pod. kubectl delete pod says success. Then the pod comes back. A kubelet is reading a manifest from disk. Find that file, and you find the answer.&lt;/p>

&lt;details
>
&lt;summary onclick="this.innerHTML = this.parentNode.open ? 'Environment - Kubernetes v1.35.0 on Ubuntu 22.04.5' : 'Environment - Kubernetes v1.35.0 on Ubuntu 22.04.5';">
 
 Environment - Kubernetes v1.35.0 on Ubuntu 22.04.5
 
&lt;/summary>
 &lt;p>Tested 2026-08-18 on KodeKloud&amp;rsquo;s two-node CKA playground: Kubernetes v1.35.0 installed by kubeadm, containerd 1.7.22, flannel CNI. Throughout this post &lt;code>k&lt;/code> is an alias for &lt;code>kubectl&lt;/code>.&lt;/p></description></item><item><title>Kubernetes DaemonSets</title><link>https://nerdsid.com/posts/kubernetes-daemonsets/</link><pubDate>Mon, 17 Aug 2026 10:00:00 +0000</pubDate><guid>https://nerdsid.com/posts/kubernetes-daemonsets/</guid><description>&lt;p>DaemonSet runs exactly one Pod per matching node, and it schedules onto new nodes automatically as they join the cluster. That&amp;rsquo;s why CNI plugins, log shippers and node exporters are almost always DaemonSets rather than Deployments.&lt;/p>
&lt;p>Five short tasks below: three about reading an existing cluster, two about building a DaemonSet from scratch. Everything assumes the usual alias:&lt;/p>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;span class="codeblock__filename codeblock__filename--lang">Bash&lt;/span>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">alias&lt;/span> &lt;span class="nv">k&lt;/span>&lt;span class="o">=&lt;/span>kubectl&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;h2 id="task-1-how-many-daemonsets-exist-cluster-wide">Task 1: How many DaemonSets exist cluster-wide?&lt;/h2>
&lt;p>The trap is the default namespace scoping — you have to ask for all namespaces explicitly:&lt;/p></description></item><item><title>Kubernetes Resource Limits</title><link>https://nerdsid.com/posts/kubernetes-resource-limits/</link><pubDate>Mon, 17 Aug 2026 09:15:00 +0000</pubDate><guid>https://nerdsid.com/posts/kubernetes-resource-limits/</guid><description>&lt;p>Resource limits look trivial on a slide and then bite you at 3 AM when a container keeps restarting with exit code 137. This lab walks through five short tasks on Pod requests and limits — reading them, diagnosing a crash caused by them, and changing them on a live cluster.&lt;/p>
&lt;p>Everything below assumes the usual alias:&lt;/p>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;span class="codeblock__filename codeblock__filename--lang">Bash&lt;/span>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">alias&lt;/span> &lt;span class="nv">k&lt;/span>&lt;span class="o">=&lt;/span>kubectl&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;h2 id="task-1-identify-the-cpu-requirements-on-the-rabbit-pod">Task 1: Identify the CPU requirements on the &lt;code>rabbit&lt;/code> Pod&lt;/h2>
&lt;p>A Pod called &lt;code>rabbit&lt;/code> is running in the &lt;code>default&lt;/code> namespace. The question asks for its &lt;strong>CPU requirement&lt;/strong> — which means the &lt;em>request&lt;/em>, not the limit.&lt;/p></description></item><item><title>Using Shell Variables to Avoid Errors</title><link>https://nerdsid.com/posts/avoiding-repetition-errors-with-shell-variables/</link><pubDate>Wed, 12 Aug 2026 00:00:00 +0000</pubDate><guid>https://nerdsid.com/posts/avoiding-repetition-errors-with-shell-variables/</guid><description>&lt;h2 id="task">Task&lt;/h2>
&lt;p>Create two files (&lt;code>release.txt&lt;/code>, &lt;code>owner.txt&lt;/code>) under a directory &lt;code>release-packages/northwind-api&lt;/code>. The goal is to avoid typos by storing the path once in a variable.&lt;/p>
&lt;h2 id="approach">Approach&lt;/h2>
&lt;p>Store the repeated path in a shell variable (&lt;code>TARGET_DIR&lt;/code>), then reference it for both directory creation and file writes.&lt;/p>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;code class="codeblock__filename" title="file.sh">file.sh&lt;/code>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#!/bin/bash
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>&lt;span class="nb">set&lt;/span> -euo pipefail
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">TARGET_DIR&lt;/span>&lt;span class="o">=&lt;/span>release-packages/northwind-api
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">mkdir -p &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$TARGET_DIR&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">echo&lt;/span> &lt;span class="s1">&amp;#39;release=2026.06.09&amp;#39;&lt;/span> &amp;gt; &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$TARGET_DIR&lt;/span>&lt;span class="s2">/release.txt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">echo&lt;/span> &lt;span class="s1">&amp;#39;owner=platform&amp;#39;&lt;/span> &amp;gt; &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$TARGET_DIR&lt;/span>&lt;span class="s2">/owner.txt&amp;#34;&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;p>Now run the script using &lt;code>chmod +x file.sh&lt;/code>, then &lt;code>./file.sh&lt;/code>.&lt;/p>
&lt;h2 id="verification">Verification&lt;/h2>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">Cat file contents&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ cat release-packages/northwind-api/release.txt 
release=2026.06.09
$ cat release-packages/northwind-api/owner.txt
owner=platform&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>Verification isn&amp;rsquo;t just a formality. For example, a typo in the path or quoting can fail silently (e.g. create a wrongly named file) instead of throwing an error. So always confirm output rather than trusting the script ran correctly.&lt;/p></description></item><item><title>Container Cpu Limit Configuration</title><link>https://nerdsid.com/posts/docker-container-cpu-limits/</link><pubDate>Wed, 01 Jul 2026 13:30:50 +0000</pubDate><guid>https://nerdsid.com/posts/docker-container-cpu-limits/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>In this lab, you&amp;rsquo;ll limit the CPU usage of a Docker container that consumes excessive CPU resources.&lt;/p>
&lt;h2 id="scenario">Scenario&lt;/h2>
&lt;p>A container named &lt;code>cpu_test&lt;/code> is running from the &lt;code>myapp:cpu&lt;/code> image and performs CPU-intensive computations. When monitored with &lt;code>docker stats&lt;/code>, the container regularly consumes 150–200% CPU, utilizing multiple CPU cores and impacting other services on the host.&lt;/p>
&lt;h2 id="task">Task&lt;/h2>
&lt;p>Recreate the container with a CPU limit of 500m CPU so that &lt;code>docker stats&lt;/code> reports CPU usage consistently below 60% during validation.&lt;/p></description></item><item><title>Docker Compose Basic</title><link>https://nerdsid.com/posts/docker-compose-basic/</link><pubDate>Wed, 01 Jul 2026 11:38:29 +0000</pubDate><guid>https://nerdsid.com/posts/docker-compose-basic/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>In this lab, you&amp;rsquo;ll first deploy an application by setting up network, multiple containers individually. Then you will clean up resources, and deploy the same application using Docker Compose.&lt;/p>
&lt;h2 id="task-1-create-a-bridge-network">Task 1: Create a Bridge Network&lt;/h2>
&lt;p>Create a bridge network named &lt;code>clicknet&lt;/code>.&lt;/p>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;span class="codeblock__filename codeblock__filename--lang">Bash&lt;/span>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">docker network create --driver bridge clicknet&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;h3 id="verify">Verify&lt;/h3>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">list docker networks&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker network ls
NETWORK ID NAME DRIVER SCOPE
5aa54ade2dcc bridge bridge local
fc40bfcbce91 clicknet bridge local
238b23f4e2a9 host host local
59b9cbf97489 none null local&lt;/code>&lt;/pre>
&lt;/figure>

&lt;h2 id="task-2-run-a-redis-container">Task 2: Run a Redis Container&lt;/h2>
&lt;p>Create a background container named &lt;code>redis&lt;/code> using the &lt;code>redis:alpine&lt;/code> image and attach it to the &lt;code>clicknet&lt;/code> network.&lt;/p></description></item><item><title>Practical Grep: Filtering Errors and Patterns in Log Files</title><link>https://nerdsid.com/posts/practical-grep-filtering-errors-and-patterns-in-log-files/</link><pubDate>Tue, 30 Jun 2026 11:41:54 +0000</pubDate><guid>https://nerdsid.com/posts/practical-grep-filtering-errors-and-patterns-in-log-files/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>This walkthrough covers using grep to search and filter log files for errors, specific requests, and multi-pattern matches.&lt;/p>
&lt;h2 id="tasks">Tasks&lt;/h2>
&lt;ol>
&lt;li>Find all &lt;code>ERROR&lt;/code> messages in &lt;code>system.log&lt;/code> and count how many there are.&lt;/li>
&lt;li>Find all lines containing &lt;code>POST&lt;/code> requests in &lt;code>access.log&lt;/code>.&lt;/li>
&lt;li>Find all lines in &lt;code>application.log&lt;/code> that contain both &lt;code>WARNING&lt;/code> and &lt;code>query&lt;/code> (case-insensitive).&lt;/li>
&lt;li>Search for all user authentications (containing &lt;code>User authenticated&lt;/code>) across all log files.&lt;/li>
&lt;/ol>
&lt;h3 id="requirements">Requirements&lt;/h3>
&lt;ul>
&lt;li>Use &lt;code>grep&lt;/code> for all searches (combining with other commands like &lt;code>wc&lt;/code> where needed).&lt;/li>
&lt;li>Save each task&amp;rsquo;s output to its own file: &lt;code>task1_output.txt&lt;/code>, &lt;code>task2_output.txt&lt;/code>, &lt;code>task3_output.txt&lt;/code>, &lt;code>task4_output.txt&lt;/code>.&lt;/li>
&lt;li>Original log files must not be modified.&lt;/li>
&lt;/ul>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;h3 id="task-1">Task 1&lt;/h3>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;span class="codeblock__filename codeblock__filename--lang">Bash&lt;/span>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">grep -c &lt;span class="s2">&amp;#34;ERROR&amp;#34;&lt;/span> system.log &amp;gt; task1_output.txt&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;p>&lt;code>grep -c&lt;/code> counts the number of matching lines instead of printing them. Redirecting the output saves the count to task1_output.txt.&lt;/p></description></item><item><title>Docker Environment Variables and Networking</title><link>https://nerdsid.com/posts/docker-environment-variables-and-networking/</link><pubDate>Tue, 16 Jun 2026 06:50:38 +0000</pubDate><guid>https://nerdsid.com/posts/docker-environment-variables-and-networking/</guid><description>&lt;p>In this lab, we&amp;rsquo;ll explore:&lt;/p>
&lt;ul>
&lt;li>Inspecting environment variables in running containers&lt;/li>
&lt;li>Passing environment variables at runtime&lt;/li>
&lt;li>Deploying MySQL containers&lt;/li>
&lt;li>Creating custom Docker networks&lt;/li>
&lt;li>Connecting applications and databases across containers&lt;/li>
&lt;/ul>
&lt;h2 id="task-1-inspect-environment-variables">Task 1: Inspect Environment Variables&lt;/h2>
&lt;p>First, identify the value configured for the &lt;code>APP_COLOR&lt;/code> environment variable in a running container.&lt;/p>
&lt;p>List the running containers:&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cdf886f902d4 kodekloud/simple-webapp "python app.py" 10 minutes ago Up 10 minutes 8080/tcp mystifying_knuth&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>Inspect the container and look for the &lt;code>Env&lt;/code> section:&lt;/p></description></item><item><title>Custom Resource Definition</title><link>https://nerdsid.com/posts/kubernetes-custom-resource-definition/</link><pubDate>Tue, 02 Jun 2026 05:54:03 +0000</pubDate><guid>https://nerdsid.com/posts/kubernetes-custom-resource-definition/</guid><description>&lt;h2 id="task-1">Task 1&lt;/h2>
&lt;p>CRD objects can be either namespaced or cluster-scoped.&lt;/p>
&lt;p>Is this statement true or false?&lt;/p>
&lt;p>Answer: True&lt;/p>
&lt;h2 id="task-2">Task 2&lt;/h2>
&lt;p>What is a custom resource?&lt;/p>
&lt;p>Answer: A custom resource is an extension of the Kubernetes API that is not necessarily available in a default Kubernetes installation.&lt;/p>
&lt;h2 id="task-3">Task 3&lt;/h2>
&lt;p>We have provided an incomplete Custom Resource Definition (CRD) manifest located at &lt;code>/root/crd.yaml&lt;/code>. Complete the file to define a namespaced CRD named &lt;code>internals.datasets.kodekloud.com&lt;/code>.&lt;/p></description></item><item><title>Docker Basic Commands</title><link>https://nerdsid.com/posts/docker-basic-commands/</link><pubDate>Mon, 01 Jun 2026 12:33:56 +0000</pubDate><guid>https://nerdsid.com/posts/docker-basic-commands/</guid><description>&lt;h2 id="task-1">Task 1&lt;/h2>
&lt;p>What is the version of the Docker Server Engine running on the host?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">Check Docker version&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker version

Client:
Version: 25.0.5
API version: 1.44

Server:
Engine:
Version: 25.0.5
API version: 1.44&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>&lt;strong>Answer:&lt;/strong> &lt;code>25.0.5&lt;/code>&lt;/p>
&lt;h2 id="task-2">Task 2&lt;/h2>
&lt;p>How many containers are currently running on this host?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">List running containers&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>&lt;strong>Answer:&lt;/strong> &lt;code>0&lt;/code>&lt;/p>
&lt;h2 id="task-3">Task 3&lt;/h2>
&lt;p>How many images are available on this host?&lt;/p></description></item><item><title>Deployments in Kubernetes</title><link>https://nerdsid.com/posts/deployments-in-kubernetes/</link><pubDate>Wed, 06 May 2026 15:06:12 +0000</pubDate><guid>https://nerdsid.com/posts/deployments-in-kubernetes/</guid><description>&lt;h2 id="tasks">Tasks&lt;/h2>
&lt;h3 id="task-1">Task 1&lt;/h3>
&lt;p>How many PODs exist on the system?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;/header>
 &lt;pre>&lt;code>$ k get po
No resources found in default namespace.&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>Ans: 0&lt;/p>
&lt;h3 id="task-2">Task 2&lt;/h3>
&lt;p>How many ReplicaSets exist on the system?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;/header>
 &lt;pre>&lt;code>$ k get rs
No resources found in default namespace.&lt;/code>&lt;/pre>
&lt;/figure>

&lt;h3 id="task-3">Task 3&lt;/h3>
&lt;p>How many Deployments exist on the system?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;/header>
 &lt;pre>&lt;code>$ k get deploy
No resources found in default namespace.&lt;/code>&lt;/pre>
&lt;/figure>

&lt;h3 id="task-4">Task 4&lt;/h3>
&lt;p>How many Deployments exist on the system &lt;em>now&lt;/em>?&lt;/p></description></item><item><title>Pods in Kubernetes</title><link>https://nerdsid.com/posts/pods-in-kubernetes/</link><pubDate>Tue, 05 May 2026 16:46:53 +0000</pubDate><guid>https://nerdsid.com/posts/pods-in-kubernetes/</guid><description>&lt;h2 id="task">Task&lt;/h2>
&lt;p>The lab consists of a k8s master node &amp;amp; worker node. You have access to a terminal on the controlplane.&lt;/p>
&lt;h3 id="task-1">Task 1&lt;/h3>
&lt;p>How many pods exist on the system?&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">list pods&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>$ k get po
No resources found in default namespace.&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>Ans: 0&lt;/p>
&lt;h3 id="task-2">Task 2&lt;/h3>
&lt;p>Create a new pod using the nginx image.&lt;/p>
&lt;p>Ans:&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;/header>
 &lt;pre>&lt;code>$ kubectl run nginx --image=nginx
pod/nginx created&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>The basic syntax is:&lt;/p></description></item><item><title>Publishing Ports in Docker</title><link>https://nerdsid.com/posts/publishing-ports-in-docker/</link><pubDate>Fri, 01 May 2026 14:37:01 +0000</pubDate><guid>https://nerdsid.com/posts/publishing-ports-in-docker/</guid><description>&lt;h2 id="task">Task&lt;/h2>
&lt;h2 id="solution">Solution&lt;/h2>

&lt;details
>
&lt;summary onclick="this.innerHTML = this.parentNode.open ? 'Show solution' : 'Show solution';">
 
 Show solution
 
&lt;/summary>
 &lt;p>This is the first paragraph of detailed content.
This is the second paragraph of even more detailed content.&lt;/p>
&lt;ul>
&lt;li>You can also include lists&lt;/li>
&lt;li>Or other markdown elements&lt;/li>
&lt;/ul>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;code class="codeblock__filename" title="service/networking/network-policy-default-deny-egress.yaml">&lt;span class="codeblock__filename-dir">service/networking/&lt;/span>network-policy-default-deny-egress.yaml&lt;/code>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nn">---&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">networking.k8s.io/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">NetworkPolicy&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">default-deny-ingress&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">podSelector&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>{}&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">policyTypes&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">Ingress&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;span class="codeblock__filename codeblock__filename--lang">Bash&lt;/span>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">ls -R /etc/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">grep &lt;span class="s2">&amp;#34;name&amp;#34;&lt;/span> file.txt&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;figure class="codeblock">
 &lt;figcaption class="codeblock__header">&lt;span class="codeblock__filename codeblock__filename--lang">Python&lt;/span>

 &lt;span class="codeblock__actions">&lt;/span>
&lt;/figcaption>

 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;God&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">greeting&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;Hello &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">greeting&lt;/span>&lt;span class="p">)&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/figure>
&lt;h3 id="terminal-output">Terminal output&lt;/h3>
&lt;p>Before&lt;/p></description></item></channel></rss>