<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Thu Kha Kyawe</title>
    <description>The latest articles on Forem by Thu Kha Kyawe (@thukhakyawe_cloud).</description>
    <link>https://forem.com/thukhakyawe_cloud</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3601335%2Fd44a63a0-36bb-4c80-a1f0-1d55fd8ccc1c.png</url>
      <title>Forem: Thu Kha Kyawe</title>
      <link>https://forem.com/thukhakyawe_cloud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/thukhakyawe_cloud"/>
    <language>en</language>
    <item>
      <title>7.Deploy Grafana on Kubernetes Cluster</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Tue, 14 Apr 2026 14:03:22 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/7deploy-grafana-on-kubernetes-cluster-20ch</link>
      <guid>https://forem.com/thukhakyawe_cloud/7deploy-grafana-on-kubernetes-cluster-20ch</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The Nautilus DevOps teams is planning to set up a Grafana tool to collect and analyze analytics from some applications. They are planning to deploy it on Kubernetes cluster. Below you can find more details.&lt;/p&gt;

&lt;p&gt;1.) Create a deployment named grafana-deployment-devops using any grafana image for Grafana app. Set other parameters as per your choice.&lt;/p&gt;

&lt;p&gt;2.) Create NodePort type service with nodePort 32000 to expose the app.&lt;/p&gt;

&lt;p&gt;You need not to make any configuration changes inside the Grafana app once deployed, just make sure you are able to access the Grafana login page.&lt;/p&gt;

&lt;p&gt;Note: The kubectl on jump_host has been configured to work with kubernetes cluster.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Grafana Deployment YAML file
&lt;/h1&gt;

&lt;p&gt;First, create a deployment configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;cat &amp;gt; grafana-deployment.yaml &amp;lt;&amp;lt; EOF&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana-deployment-devops&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana/grafana:latest&lt;/span&gt;
        &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3000&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GF_SECURITY_ADMIN_PASSWORD&lt;/span&gt;
          &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;admin123"&lt;/span&gt;
        &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;256Mi"&lt;/span&gt;
            &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100m"&lt;/span&gt;
          &lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;512Mi"&lt;/span&gt;
            &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;500m"&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the NodePort Service YAML file
&lt;/h1&gt;

&lt;p&gt;Now create the service configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;cat &amp;gt; grafana-service.yaml &amp;lt;&amp;lt; EOF&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Service&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana-service&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NodePort&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3000&lt;/span&gt;
    &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3000&lt;/span&gt;
    &lt;span class="na"&gt;nodePort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32000&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;grafana&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 3: Deploy the Grafana Deployment
&lt;/h1&gt;

&lt;p&gt;Apply the deployment to your Kubernetes cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; grafana-deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 4: Deploy the NodePort Service
&lt;/h1&gt;

&lt;p&gt;Apply the service configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; grafana-service.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2m99fa8i6bkc3mdyiake.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2m99fa8i6bkc3mdyiake.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Verify the Deployment
&lt;/h1&gt;

&lt;p&gt;Check if the deployment was created successfully:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get deployments
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sbwkl7pqcxens2ny1i1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sbwkl7pqcxens2ny1i1.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 6: Verify the Service
&lt;/h1&gt;

&lt;p&gt;Check if the service is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faliiozk6mynb8w4chkj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faliiozk6mynb8w4chkj3.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Check the Pod Status
&lt;/h1&gt;

&lt;p&gt;Verify that the Grafana pod is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;grafana
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31yjbtcwrmuc6y9b98j7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31yjbtcwrmuc6y9b98j7.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 8: Access Grafana
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7qgs1jycsqh1d79po3z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7qgs1jycsqh1d79po3z.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kodekloud</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>6.Deploy Jenkins on Kubernetes</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Mon, 13 Apr 2026 05:35:54 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/6deploy-jenkins-on-kubernetes-5450</link>
      <guid>https://forem.com/thukhakyawe_cloud/6deploy-jenkins-on-kubernetes-5450</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The Nautilus DevOps team is planning to set up a Jenkins CI server to create/manage some deployment pipelines for some of the projects. They want to set up the Jenkins server on Kubernetes cluster. Below you can find more details about the task:&lt;/p&gt;

&lt;p&gt;1) Create a namespace jenkins&lt;/p&gt;

&lt;p&gt;2) Create a Service for jenkins deployment. Service name should be jenkins-service under jenkins namespace, type should be NodePort, nodePort should be 30008&lt;/p&gt;

&lt;p&gt;3) Create a Jenkins Deployment under jenkins namespace, It should be name as jenkins-deployment , labels app should be jenkins , container name should be jenkins-container , use jenkins/jenkins image , containerPort should be 8080 and replicas count should be 1.&lt;/p&gt;

&lt;p&gt;Make sure to wait for the pods to be in running state and make sure you are able to access the Jenkins login screen in the browser before hitting the Check button.&lt;/p&gt;

&lt;p&gt;Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Jenkins Namespace
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create namespace jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the Jenkins Service
&lt;/h1&gt;

&lt;p&gt;Create a YAML file for the NodePort service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; jenkins-service.yaml &amp;lt;&amp;lt; EOF
apiVersion: v1
kind: Service
metadata:
  name: jenkins-service
  namespace: jenkins
spec:
  type: NodePort
  selector:
    app: jenkins
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
      nodePort: 30008
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f jenkins-service.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwdvfdw59nrliesvamd48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwdvfdw59nrliesvamd48.png" alt=" " width="480" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Create the Jenkins Deployment
&lt;/h1&gt;

&lt;p&gt;Create a YAML file for the deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; jenkins-deployment.yaml &amp;lt;&amp;lt; EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins-deployment
  namespace: jenkins
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jenkins
  template:
    metadata:
      labels:
        app: jenkins
    spec:
      containers:
      - name: jenkins-container
        image: jenkins/jenkins
        ports:
        - containerPort: 8080
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f jenkins-deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokwfhhm1kkd2x2e96i52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokwfhhm1kkd2x2e96i52.png" alt=" " width="528" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: Monitor the Deployment Progress
&lt;/h1&gt;

&lt;p&gt;Check the status of the pod:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n jenkins 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait until the pod status shows Running. This might take a few minutes as the Jenkins image needs to be pulled and the container needs to start up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm5b3ueno4s5l7ahemos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm5b3ueno4s5l7ahemos.png" alt=" " width="596" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also check the deployment status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get deployment -n jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz60curkzn3jmmqt0222v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz60curkzn3jmmqt0222v.png" alt=" " width="492" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Verify Service Configuration
&lt;/h1&gt;

&lt;p&gt;Check that the service is properly configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc -n jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqn6h5gg5ws1ud26uaal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqn6h5gg5ws1ud26uaal.png" alt=" " width="656" height="62"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Access Jenkins
&lt;/h1&gt;

&lt;p&gt;Once the pod is in Running state, you can access Jenkins:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmeix28x6hofs1f4vcr9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmeix28x6hofs1f4vcr9h.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 8: Final Verification Commands
&lt;/h1&gt;

&lt;p&gt;Run these commands to verify everything is set up correctly:&lt;/p&gt;

&lt;h1&gt;
  
  
  Check all resources in jenkins namespace
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get all -n jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Verify pod details
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod -l app=jenkins -n jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Verify service details
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe svc jenkins-service -n jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpvq9l89et90vhskekvt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpvq9l89et90vhskekvt.png" alt=" " width="800" height="614"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kodekloud</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>5.Rolling Updates And Rolling Back Deployments in Kubernetes</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Mon, 13 Apr 2026 05:20:58 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/5rolling-updates-and-rolling-back-deployments-in-kubernetes-3bkc</link>
      <guid>https://forem.com/thukhakyawe_cloud/5rolling-updates-and-rolling-back-deployments-in-kubernetes-3bkc</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;There is a production deployment planned for next week. The Nautilus DevOps team wants to test the deployment update and rollback on Dev environment first so that they can identify the risks in advance. Below you can find more details about the plan they want to execute.&lt;/p&gt;

&lt;p&gt;Create a namespace devops. Create a deployment called httpd-deploy under this new namespace, It should have one container called httpd, use httpd:2.4.25 image and 3 replicas. The deployment should use RollingUpdate strategy with maxSurge=1, and maxUnavailable=2. Also create a NodePort type service named httpd-service and expose the deployment on nodePort: 30008.&lt;/p&gt;

&lt;p&gt;Now upgrade the deployment to version httpd:2.4.43 using a rolling update.&lt;/p&gt;

&lt;p&gt;Finally, once all pods are updated undo the recent update and roll back to the previous/original version.&lt;/p&gt;

&lt;p&gt;Note:&lt;/p&gt;

&lt;p&gt;a. The kubectl utility on jump_host has been configured to work with the kubernetes cluster.&lt;/p&gt;

&lt;p&gt;b. Please make sure you only use the specified image(s) for this deployment and as per the sequence mentioned in the task description. If you mistakenly use a wrong image and fix it later, that will also distort the revision history which can eventually fail this task.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Namespace
&lt;/h1&gt;

&lt;p&gt;First, create the devops namespace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create namespace devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the Deployment
&lt;/h1&gt;

&lt;p&gt;Create a YAML file for the deployment with the specified configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; httpd-deploy.yaml &amp;lt;&amp;lt; EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd-deploy
  namespace: devops
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 2
  selector:
    matchLabels:
      app: httpd
  template:
    metadata:
      labels:
        app: httpd
    spec:
      containers:
      - name: httpd
        image: httpd:2.4.25
        ports:
        - containerPort: 80
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f httpd-deploy.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk874uhwrn252ux1jfs5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk874uhwrn252ux1jfs5z.png" alt=" " width="448" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Create the Service
&lt;/h1&gt;

&lt;p&gt;Create a YAML file for the NodePort service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; httpd-service.yaml &amp;lt;&amp;lt; EOF
apiVersion: v1
kind: Service
metadata:
  name: httpd-service
  namespace: devops
spec:
  type: NodePort
  selector:
    app: httpd
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 30008
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f httpd-service.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdxa56j3z5ag1t47lrzq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdxa56j3z5ag1t47lrzq.png" alt=" " width="449" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: Verify Initial Deployment
&lt;/h1&gt;

&lt;p&gt;Check that everything is running correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get all -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ohrjwf00gbr0er1sj07.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ohrjwf00gbr0er1sj07.png" alt=" " width="692" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Upgrade the Deployment
&lt;/h1&gt;

&lt;p&gt;Upgrade to the new image version using rolling update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl set image deployment/httpd-deploy httpd=httpd:2.4.43 -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Monitor the rolling update progress:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl rollout status deployment/httpd-deploy -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the upgrade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n devops -o wide
kubectl describe deployment httpd-deploy -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszehd6z0wytdxij7rrno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszehd6z0wytdxij7rrno.png" alt=" " width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 6: Rollback to Previous Version
&lt;/h1&gt;

&lt;p&gt;Undo the recent update and roll back to the original version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl rollout undo deployment/httpd-deploy -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Monitor the rollback progress:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl rollout status deployment/httpd-deploy -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 7: Final Verification
&lt;/h1&gt;

&lt;p&gt;Verify that the rollback was successful:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n devops -o wide
kubectl describe deployment httpd-deploy -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtmoktosc79awn8n6bk4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtmoktosc79awn8n6bk4.png" alt=" " width="800" height="617"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the rollout history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl rollout history deployment/httpd-deploy -n devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcikrvklzcp316qe0g1jh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcikrvklzcp316qe0g1jh.png" alt=" " width="632" height="102"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kodekloud</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>4.Print Environment Variables</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Mon, 13 Apr 2026 05:14:55 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/4print-environment-variables-4fop</link>
      <guid>https://forem.com/thukhakyawe_cloud/4print-environment-variables-4fop</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The Nautilus DevOps team is working on to setup some pre-requisites for an application that will send the greetings to different users. There is a sample deployment, that needs to be tested. Below is a scenario which needs to be configured on Kubernetes cluster. Please find below more details about it.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a pod named print-envars-greeting.

Configure spec as, the container name should be print-env-container and use bash image.

Create three environment variables:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;a. GREETING and its value should be Welcome to&lt;/p&gt;

&lt;p&gt;b. COMPANY and its value should be DevOps&lt;/p&gt;

&lt;p&gt;c. GROUP and its value should be Datacenter&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use command ["/bin/sh", "-c", 'echo "$(GREETING) $(COMPANY) $(GROUP)"'] (please use this exact command), also set its restartPolicy policy to Never to avoid crash loop back.

You can check the output using kubectl logs -f print-envars-greeting command.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Pod YAML configuration
&lt;/h1&gt;

&lt;p&gt;Create a file named print-envars-greeting.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;cat &amp;gt; print-envars-greeting.yaml &amp;lt;&amp;lt; 'EOF'&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;print-envars-greeting&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;print-env-container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/bin/sh"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-c"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;echo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;"$GREETING&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;$COMPANY&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;$GROUP"'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GREETING&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Welcome&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;to"&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;COMPANY&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DevOps"&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GROUP&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Datacenter"&lt;/span&gt;
  &lt;span class="na"&gt;restartPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Never&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the Pod
&lt;/h1&gt;

&lt;p&gt;Apply the configuration to create the pod:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; print-envars-greeting.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0wtpw71e623gjz3rj9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0wtpw71e623gjz3rj9a.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Check the Pod Status
&lt;/h1&gt;

&lt;p&gt;Monitor the pod status to see when it completes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pod print-envars-greeting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see the status change from Pending → Running → Completed (or Succeeded).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0d11obyffttxgbjfwe16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0d11obyffttxgbjfwe16.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: View the Output
&lt;/h1&gt;

&lt;p&gt;Check the logs to see the output of the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs print-envars-greeting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwz3bs0zozaugr3edilm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwz3bs0zozaugr3edilm.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kodekloud</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>3.Deploy Nginx Web Server on Kubernetes Cluster</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 12 Apr 2026 15:10:17 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/3deploy-nginx-web-server-on-kubernetes-cluster-2178</link>
      <guid>https://forem.com/thukhakyawe_cloud/3deploy-nginx-web-server-on-kubernetes-cluster-2178</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;Some of the Nautilus team developers are developing a static website and they want to deploy it on Kubernetes cluster. They want it to be highly available and scalable. Therefore, based on the requirements, the DevOps team has decided to create a deployment for it with multiple replicas. Below you can find more details about it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a deployment using nginx image with latest tag only and remember to mention the tag i.e nginx:latest. Name it as nginx-deployment. The container should be named as nginx-container, also make sure replica counts are 3.

Create a NodePort type service named nginx-service. The nodePort should be 30011.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Deployment YAML configuration
&lt;/h1&gt;

&lt;p&gt;Create a file named nginx-deployment.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; nginx-deployment.yaml &amp;lt;&amp;lt; EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx-container
        image: nginx:latest
        ports:
        - containerPort: 80
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the Deployment
&lt;/h1&gt;

&lt;p&gt;Apply the deployment configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f nginx-deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkbvje57fz65s014dbu20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkbvje57fz65s014dbu20.png" alt=" " width="537" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Verify the Deployment
&lt;/h1&gt;

&lt;p&gt;Check if the deployment is created and all replicas are running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get deployment nginx-deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 4: Verify the Pods
&lt;/h1&gt;

&lt;p&gt;Check the pods created by the deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -l app=nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2knkb5gghn35pl2jy6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2knkb5gghn35pl2jy6s.png" alt=" " width="590" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Create the Service YAML configuration
&lt;/h1&gt;

&lt;p&gt;Create a file named nginx-service.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; nginx-service.yaml &amp;lt;&amp;lt; EOF
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: NodePort
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 30011
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 6: Create the Service
&lt;/h1&gt;

&lt;p&gt;Apply the service configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f nginx-service.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femgvrz2wgdzsu769psiu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femgvrz2wgdzsu769psiu.png" alt=" " width="505" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Verify the Service
&lt;/h1&gt;

&lt;p&gt;Check if the service is created correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get service nginx-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 8: Detailed Service Verification
&lt;/h1&gt;

&lt;p&gt;Get more details about the service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe service nginx-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75fo25d50juejadoaubx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75fo25d50juejadoaubx.png" alt=" " width="625" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 9: Test the Setup
&lt;/h1&gt;

&lt;p&gt;Test if the service is working by accessing it. Since this is a Kubernetes cluster, you can test using:&lt;/p&gt;

&lt;p&gt;Using curl from inside the cluster&lt;/p&gt;

&lt;h1&gt;
  
  
  Get the Cluster IP of the service
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLUSTER_IP=$(kubectl get service nginx-service -o jsonpath='{.spec.clusterIP}')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Test access using Cluster IP
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl run test-pod --image=nginx:latest --rm -it --restart=Never -- bash -c "curl http://$CLUSTER_IP"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiqdzwz06nyy1i40e9d5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiqdzwz06nyy1i40e9d5.png" alt=" " width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 10: Verify Endpoints
&lt;/h1&gt;

&lt;p&gt;Check that the service is correctly targeting all 3 pods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get endpoints nginx-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhipdqnesjd0tbm3cvk21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhipdqnesjd0tbm3cvk21.png" alt=" " width="548" height="64"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kodekloud</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>2.Kubernetes Sidecar Containers</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 12 Apr 2026 15:03:43 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/2kubernetes-sidecar-containers-346b</link>
      <guid>https://forem.com/thukhakyawe_cloud/2kubernetes-sidecar-containers-346b</guid>
      <description>&lt;h1&gt;
  
  
  Task Information
&lt;/h1&gt;

&lt;p&gt;We have a web server container running the nginx image. The access and error logs generated by the web server are not critical enough to be placed on a persistent volume. However, Nautilus developers need access to the last 24 hours of logs so that they can trace issues and bugs. Therefore, we need to ship the access and error logs for the web server to a log-aggregation service. Following the separation of concerns principle, we implement the Sidecar pattern by deploying a second container that ships the error and access logs from nginx. Nginx does one thing, and it does it well—serving web pages. The second container also specializes in its task—shipping logs. Since containers are running on the same Pod, we can use a shared emptyDir volume to read and write logs.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a pod named webserver.

Create an emptyDir volume shared-logs.

Create two containers from nginx and ubuntu images with latest tag only and remember to mention tag i.e nginx:latest, nginx container name should be nginx-container and ubuntu container name should be sidecar-container on webserver pod.

Add command on sidecar-container "sh","-c","while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done"

Mount the volume shared-logs on both containers at location /var/log/nginx, all containers should be up and running.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.&lt;/p&gt;

&lt;h1&gt;
  
  
  Task Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Pod YAML configuration
&lt;/h1&gt;

&lt;p&gt;Create a file named webserver-pod.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;cat &amp;gt; webserver-pod.yaml &amp;lt;&amp;lt; EOF&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webserver&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx-container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:latest&lt;/span&gt;
    &lt;span class="na"&gt;volumeMounts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shared-logs&lt;/span&gt;
      &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/log/nginx&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sidecar-container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu:latest&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sh"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;-c"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;while&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;true;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;do&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;cat&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;/var/log/nginx/access.log&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;/var/log/nginx/error.log;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;sleep&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;30;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;done"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;volumeMounts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shared-logs&lt;/span&gt;
      &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/log/nginx&lt;/span&gt;

  &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shared-logs&lt;/span&gt;
    &lt;span class="na"&gt;emptyDir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the pod
&lt;/h1&gt;

&lt;p&gt;Apply the configuration to create the pod:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; webserver-pod.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvd7tptm7b3uyxro2gyj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbvd7tptm7b3uyxro2gyj.png" alt=" " width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Verify the pod is running
&lt;/h1&gt;

&lt;p&gt;Check if the pod is created and both containers are running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pod webserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 4: Check the detailed status of the pod
&lt;/h1&gt;

&lt;p&gt;Verify both containers are properly configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe pod webserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg26eu8ftsxorq31c3rp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg26eu8ftsxorq31c3rp5.png" alt=" " width="800" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Test the sidecar container logs
&lt;/h1&gt;

&lt;p&gt;Check the logs of the sidecar container to see if it's reading the nginx logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs webserver &lt;span class="nt"&gt;-c&lt;/span&gt; sidecar-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozgntvbmxhyaprevhv3h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozgntvbmxhyaprevhv3h.png" alt=" " width="699" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 6: Generate some web traffic to create logs
&lt;/h1&gt;

&lt;p&gt;Let's generate some access to the nginx server to create log entries:&lt;/p&gt;

&lt;h1&gt;
  
  
  First, find the nginx container's IP
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pod webserver &lt;span class="nt"&gt;-o&lt;/span&gt; wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then access the nginx server (you can use the pod IP or port-forward):&lt;/p&gt;

&lt;p&gt;Using port-forward&lt;/p&gt;

&lt;h1&gt;
  
  
  In one terminal, set up port forwarding
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward webserver 8080:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrbu0y8iipnte8ap7pc1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrbu0y8iipnte8ap7pc1.png" alt=" " width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Verify the sidecar is shipping logs
&lt;/h1&gt;

&lt;p&gt;After generating some traffic, check the sidecar container logs again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs webserver &lt;span class="nt"&gt;-c&lt;/span&gt; sidecar-container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45pqf5makwf30ccar5v3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45pqf5makwf30ccar5v3.png" alt=" " width="671" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 8: Verify volume mounting
&lt;/h1&gt;

&lt;p&gt;Check that both containers have the volume mounted correctly:&lt;/p&gt;

&lt;h1&gt;
  
  
  Check nginx container
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; webserver &lt;span class="nt"&gt;-c&lt;/span&gt; nginx-container &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; /var/log/nginx/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Check sidecar container
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; webserver &lt;span class="nt"&gt;-c&lt;/span&gt; sidecar-container &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; /var/log/nginx/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fsu4gn3ejo148uwzbuf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fsu4gn3ejo148uwzbuf.png" alt=" " width="748" height="230"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kubernetes</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>1.Kubernetes Shared Volumes</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Mon, 06 Apr 2026 14:32:03 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/1kubernetes-shared-volumes-4ph7</link>
      <guid>https://forem.com/thukhakyawe_cloud/1kubernetes-shared-volumes-4ph7</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;We are working on an application that will be deployed on multiple containers within a pod on Kubernetes cluster. There is a requirement to share a volume among the containers to save some temporary data. The Nautilus DevOps team is developing a similar template to replicate the scenario. Below you can find more details about it.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create a pod named volume-share-devops.

For the first container, use image fedora with latest tag only and remember to mention the tag i.e fedora:latest, container should be named as volume-container-devops-1, and run a sleep command for it so that it remains in running state. Volume volume-share should be mounted at path /tmp/beta.

For the second container, use image fedora with the latest tag only and remember to mention the tag i.e fedora:latest, container should be named as volume-container-devops-2, and again run a sleep command for it so that it remains in running state. Volume volume-share should be mounted at path /tmp/cluster.

Volume name should be volume-share of type emptyDir.

After creating the pod, exec into the first container i.e volume-container-devops-1, and just for testing create a file beta.txt with any content under the mounted path of first container i.e /tmp/beta.

The file beta.txt should be present under the mounted path /tmp/cluster on the second container volume-container-devops-2 as well, since they are using a shared volume.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 1: Create the Pod YAML configuration
&lt;/h1&gt;

&lt;p&gt;Create a file named volume-share-pod.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;gt; volume-share-pod.yaml &amp;lt;&amp;lt; EOF
apiVersion: v1
kind: Pod
metadata:
  name: volume-share-devops
spec:
  containers:
  - name: volume-container-devops-1
    image: fedora:latest
    command: ["/bin/sleep"]
    args: ["3650d"]
    volumeMounts:
    - name: volume-share
      mountPath: /tmp/beta

  - name: volume-container-devops-2
    image: fedora:latest
    command: ["/bin/sleep"]
    args: ["3650d"]
    volumeMounts:
    - name: volume-share
      mountPath: /tmp/cluster

  volumes:
  - name: volume-share
    emptyDir: {}
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: Create the pod
&lt;/h1&gt;

&lt;p&gt;Apply the configuration to create the pod:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f volume-share-pod.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v26r9bwh48amlakpiao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v26r9bwh48amlakpiao.png" alt=" " width="505" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Verify the pod is running
&lt;/h1&gt;

&lt;p&gt;Check if the pod is created and running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods volume-share-devops
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frcgrkcw5n2ksoy28dlty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frcgrkcw5n2ksoy28dlty.png" alt=" " width="459" height="62"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: Create test file in first container
&lt;/h1&gt;

&lt;p&gt;Execute into the first container and create the test file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl exec -it volume-share-devops -c volume-container-devops-1 -- /bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once inside the container, create the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "This is a test file for shared volume" &amp;gt; /tmp/beta/beta.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit the container:&lt;br&gt;
&lt;code&gt;exit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsvcjctq7u8d2ix1vgb0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsvcjctq7u8d2ix1vgb0.png" alt=" " width="793" height="78"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 5: Verify file exists in second container
&lt;/h1&gt;

&lt;p&gt;Check if the file is accessible from the second container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl exec -it volume-share-devops -c volume-container-devops-2 -- cat /tmp/cluster/beta.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg4rwzwhum13u91envoc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg4rwzwhum13u91envoc.png" alt=" " width="800" height="39"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kubernetes</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>A Useful Resource If You’re Preparing for AWS, CompTIA, Microsoft Certifications</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sat, 04 Apr 2026 13:28:40 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/a-useful-resource-if-youre-preparing-for-aws-comptia-microsoft-certifications-3i9</link>
      <guid>https://forem.com/thukhakyawe_cloud/a-useful-resource-if-youre-preparing-for-aws-comptia-microsoft-certifications-3i9</guid>
      <description>&lt;p&gt;Udemy is now offering &lt;strong&gt;AWS, CompTIA and Microsoft exam vouchers&lt;/strong&gt; with optional &lt;strong&gt;retake packages&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://www.udemy.com/all-certification-vouchers/" rel="noopener noreferrer"&gt;https://www.udemy.com/all-certification-vouchers/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I checked a couple of exams, and the pricing structure is actually more interesting than it first looks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 1 — AWS Certified Solutions Architect (Associate)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5f689gp1wa2l3qwy88z0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5f689gp1wa2l3qwy88z0.png" alt=" " width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exam Voucher&lt;/strong&gt; → &lt;strong&gt;$148.99&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exam Voucher + Retake&lt;/strong&gt; → &lt;strong&gt;$181.99&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 That’s roughly &lt;strong&gt;$33 more&lt;/strong&gt; for a second attempt&lt;/p&gt;




&lt;h3&gt;
  
  
  Example 2 — AWS Certified DevOps Engineer (Professional)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb877rqv49orutbqshycj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb877rqv49orutbqshycj.png" alt=" " width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exam Voucher&lt;/strong&gt; → &lt;strong&gt;$296.99&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exam Voucher + Retake&lt;/strong&gt; → &lt;strong&gt;$329.99&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Again, about &lt;strong&gt;$33 more&lt;/strong&gt; for a retake&lt;/p&gt;




&lt;h3&gt;
  
  
  My takeaway
&lt;/h3&gt;

&lt;p&gt;This is where it gets interesting.&lt;/p&gt;

&lt;p&gt;At first glance, Udemy shows a &lt;strong&gt;very large discount&lt;/strong&gt; on the “voucher + retake” option (because it compares against a much higher original price).&lt;/p&gt;

&lt;p&gt;But in reality, the decision is much simpler:&lt;/p&gt;

&lt;p&gt;👉 You’re paying about &lt;strong&gt;$30–$35 extra&lt;/strong&gt; for a second attempt&lt;/p&gt;

&lt;p&gt;That’s actually &lt;strong&gt;not a bad deal&lt;/strong&gt; if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you’re not 100% confident yet&lt;/li&gt;
&lt;li&gt;you want to reduce the risk of paying full price again&lt;/li&gt;
&lt;li&gt;or you just want less pressure on exam day&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Important details
&lt;/h3&gt;

&lt;p&gt;From the voucher page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Exam Voucher (one attempt)&lt;/strong&gt;&lt;br&gt;
→ valid for &lt;strong&gt;at least 9 months after purchase&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Voucher + Retake (two attempts)&lt;/strong&gt;&lt;br&gt;
→ first attempt must be completed by &lt;strong&gt;Dec 31, 2026&lt;/strong&gt;&lt;br&gt;
→ retake must be completed by &lt;strong&gt;Jan 31, 2027&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Works for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Associate exams&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Professional &amp;amp; Specialty exams&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Online or in-person testing&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  What to watch out for
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This does &lt;strong&gt;not combine with other AWS benefits&lt;/strong&gt; (e.g. 50% off vouchers)&lt;/li&gt;
&lt;li&gt;It’s &lt;strong&gt;not the same as “free retake” promotions&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Pricing may vary depending on your &lt;strong&gt;region / tax / currency&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Final thought
&lt;/h3&gt;

&lt;p&gt;This is one of those cases where the &lt;strong&gt;real value is hidden behind the marketing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Ignore the big discount labels and just ask:&lt;/p&gt;

&lt;p&gt;👉 &lt;em&gt;“Is a second attempt worth ~$30 for me?”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If yes, the retake option actually makes a lot of sense.&lt;/p&gt;




&lt;h1&gt;
  
  
  AWS #AWSCertification #CloudComputing #DevOps #SolutionsArchitect #Certification #CareerGrowth #Upskilling #TechCareers
&lt;/h1&gt;

</description>
      <category>aws</category>
      <category>comptia</category>
      <category>microsoft</category>
      <category>udemy</category>
    </item>
    <item>
      <title>24.Application Security</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 22 Mar 2026 19:30:00 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/24application-security-3cp7</link>
      <guid>https://forem.com/thukhakyawe_cloud/24application-security-3cp7</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;We have a backup management application UI hosted on Nautilus's backup server in Stratos DC. That backup management application code is deployed under Apache on the backup server itself, and Nginx is running as a reverse proxy on the same server. Apache and Nginx ports are 8082 and 8092, respectively. We have to install the iptables firewall on the server. Make the appropriate changes to fulfill the requirements mentioned below:&lt;/p&gt;

&lt;p&gt;We want to open all incoming connections to Nginx's port and block all incoming connections to Apache's port. Also make sure rules are permanent.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;🧭 Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;1️⃣ Login to Backup Server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;ssh&lt;/span&gt; clint@stbkp01
&lt;span class="c1"&gt;# Password: H@wk3y3&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; -i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Install iptables&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yum &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; iptables
yum &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; iptables-services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3️⃣ Check and Fix iptables&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight systemd"&gt;&lt;code&gt;&lt;span class="err"&gt;systemctl&lt;/span&gt; &lt;span class="err"&gt;start&lt;/span&gt; &lt;span class="err"&gt;iptables&lt;/span&gt;
&lt;span class="err"&gt;systemctl&lt;/span&gt; &lt;span class="err"&gt;enable&lt;/span&gt; &lt;span class="err"&gt;iptables&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4️⃣ Flush existing rules (clean start)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-F&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5️⃣ Allow Nginx port (8092)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--dport&lt;/span&gt; 8092 &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6️⃣ Block Apache port (8082)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;--dport&lt;/span&gt; 8082 &lt;span class="nt"&gt;-j&lt;/span&gt; DROP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7️⃣ Allow essential traffic (IMPORTANT)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-m&lt;/span&gt; state &lt;span class="nt"&gt;--state&lt;/span&gt; ESTABLISHED,RELATED &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT
iptables &lt;span class="nt"&gt;-A&lt;/span&gt; INPUT &lt;span class="nt"&gt;-i&lt;/span&gt; lo &lt;span class="nt"&gt;-j&lt;/span&gt; ACCEPT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8️⃣ Save rules (make permanent)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables-save &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/sysconfig/iptables
systemctl restart iptables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;9️⃣ Verify rules&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[root@stbkp01 ~]#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;iptables &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt;
&lt;span class="go"&gt;Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:8092
DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:8082
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;br&gt;
What this lab is about&lt;/p&gt;

&lt;p&gt;You are controlling:&lt;/p&gt;

&lt;p&gt;Who can access which service&lt;br&gt;
Current setup&lt;br&gt;
Service Port    Purpose&lt;br&gt;
Apache  8082    backend&lt;br&gt;
Nginx   8092    public access&lt;br&gt;
What you need to do&lt;br&gt;
Allow users → Nginx (8092)&lt;br&gt;
Block users → Apache (8082)&lt;br&gt;
Why block Apache?&lt;br&gt;
Nginx acts as reverse proxy&lt;br&gt;
Users should NOT access Apache directly&lt;br&gt;
What iptables does&lt;br&gt;
iptables = firewall tool&lt;br&gt;
Controls network traffic&lt;br&gt;
Rule explanation&lt;br&gt;
1️⃣ Allow Nginx&lt;br&gt;
iptables -A INPUT -p tcp --dport 8092 -j ACCEPT&lt;/p&gt;

&lt;p&gt;👉 Means:&lt;/p&gt;

&lt;p&gt;Allow incoming traffic on port 8092&lt;br&gt;
2️⃣ Block Apache&lt;br&gt;
iptables -A INPUT -p tcp --dport 8082 -j DROP&lt;/p&gt;

&lt;p&gt;👉 Means:&lt;/p&gt;

&lt;p&gt;Reject connections to Apache&lt;br&gt;
3️⃣ Allow existing connections&lt;br&gt;
ESTABLISHED,RELATED&lt;/p&gt;

&lt;p&gt;👉 Prevents breaking active sessions&lt;/p&gt;

&lt;p&gt;4️⃣ Allow loopback&lt;br&gt;
lo (localhost)&lt;/p&gt;

&lt;p&gt;👉 Required for internal communication&lt;/p&gt;

&lt;p&gt;Final flow&lt;br&gt;
User → Nginx (allowed) → Apache (internal only)&lt;br&gt;
User → Apache (blocked ❌)&lt;br&gt;
⚡ Key Concept&lt;br&gt;
Firewall = control entry points to your system&lt;br&gt;
🎯 Key Takeaway&lt;br&gt;
Expose only what is needed, block everything else&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>aws</category>
      <category>linuxlevel2</category>
    </item>
    <item>
      <title>23.Linux LogRotate</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 22 Mar 2026 18:30:00 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/23linux-logrotate-3o8b</link>
      <guid>https://forem.com/thukhakyawe_cloud/23linux-logrotate-3o8b</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The Nautilus DevOps team is ready to launch a new application, which they will deploy on app servers in Stratos Datacenter. They are expecting significant traffic/usage of tomcat on app servers after that. This will generate massive logs, creating huge log files. To utilise the storage efficiently, they need to compress the log files and need to rotate old logs. Check the requirements shared below:&lt;/p&gt;

&lt;p&gt;a. In all app servers install tomcat package.&lt;/p&gt;

&lt;p&gt;b. Using logrotate configure tomcat logs rotation to monthly and keep only 3 rotated logs.&lt;/p&gt;

&lt;p&gt;(If by default log rotation is set, then please update configuration as needed)&lt;/p&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;🧭 Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;1️⃣ Login to each app server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh tony@stapp01
&lt;span class="c"&gt;# Password: Ir0nM@n&lt;/span&gt;

ssh steve@stapp02
&lt;span class="c"&gt;# Password: Am3ric@&lt;/span&gt;

ssh banner@stapp03
&lt;span class="c"&gt;# Password: BigGr33n&lt;/span&gt;

Then:

&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Install Tomcat and logrotate on ALL app servers&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yum &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; tomcat
yum &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; logrotate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3️⃣ Verify Tomcat logs location&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /var/log/tomcat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Typical logs:&lt;/p&gt;

&lt;p&gt;catalina.out&lt;br&gt;
localhost.log&lt;/p&gt;

&lt;p&gt;4️⃣ Configure logrotate for Tomcat&lt;/p&gt;

&lt;p&gt;Create config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi /etc/logrotate.d/tomcat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5️⃣ Add this configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;/&lt;span class="n"&gt;var&lt;/span&gt;/&lt;span class="n"&gt;log&lt;/span&gt;/&lt;span class="n"&gt;tomcat&lt;/span&gt;/*.&lt;span class="n"&gt;log&lt;/span&gt; {
    &lt;span class="n"&gt;monthly&lt;/span&gt;
    &lt;span class="n"&gt;rotate&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
    &lt;span class="n"&gt;compress&lt;/span&gt;
    &lt;span class="n"&gt;missingok&lt;/span&gt;
    &lt;span class="n"&gt;notifempty&lt;/span&gt;
    &lt;span class="n"&gt;copytruncate&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6️⃣ Save file&lt;/p&gt;

&lt;p&gt;ESC&lt;br&gt;
:wq&lt;/p&gt;

&lt;p&gt;7️⃣ Test logrotate config (important)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;logrotate &lt;span class="nt"&gt;-d&lt;/span&gt; /etc/logrotate.d/tomcat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WARNING: logrotate in debug mode does nothing except printing debug messages!  Consider using verbose mode (-v) instead if this is not what you want.

reading config file /etc/logrotate.d/tomcat
Reading state from file: /var/lib/logrotate/logrotate.status
error: error opening state file /var/lib/logrotate/logrotate.status: No such file or directory
Allocating hash table for state file, size 64 entries

Handling 1 logs

rotating pattern: /var/log/tomcat/*.log  monthly (3 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/tomcat/*.log
  log /var/log/tomcat/*.log does not exist -- skipping
Creating new state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8️⃣ Repeat on all app servers&lt;/p&gt;

&lt;p&gt;Do same steps on:&lt;/p&gt;

&lt;p&gt;stapp01&lt;br&gt;
stapp02&lt;br&gt;
stapp03&lt;/p&gt;




&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;p&gt;What this lab is about&lt;/p&gt;

&lt;p&gt;You are managing:&lt;/p&gt;

&lt;p&gt;Large log files → need to control size and storage&lt;/p&gt;

&lt;p&gt;Problem&lt;/p&gt;

&lt;p&gt;Tomcat generates logs continuously:&lt;/p&gt;

&lt;p&gt;More traffic → bigger log files → storage issues&lt;br&gt;
Solution: logrotate&lt;br&gt;
logrotate = tool to manage log files automatically&lt;/p&gt;

&lt;p&gt;What your config does&lt;/p&gt;

&lt;p&gt;1️⃣ monthly&lt;/p&gt;

&lt;p&gt;Rotate logs once every month&lt;/p&gt;

&lt;p&gt;2️⃣ rotate 3&lt;/p&gt;

&lt;p&gt;Keep only 3 old log files&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;catalina.log&lt;br&gt;
catalina.log.1&lt;br&gt;
catalina.log.2&lt;br&gt;
catalina.log.3&lt;br&gt;
(old ones deleted)&lt;/p&gt;

&lt;p&gt;3️⃣ compress&lt;/p&gt;

&lt;p&gt;Old logs are compressed → save space&lt;/p&gt;

&lt;p&gt;4️⃣ copytruncate&lt;/p&gt;

&lt;p&gt;Copy log → clear original → service keeps writing&lt;/p&gt;

&lt;p&gt;👉 Important because:&lt;/p&gt;

&lt;p&gt;Tomcat is still running&lt;/p&gt;

&lt;p&gt;5️⃣ missingok&lt;/p&gt;

&lt;p&gt;Ignore if log file is missing&lt;/p&gt;

&lt;p&gt;6️⃣ notifempty&lt;/p&gt;

&lt;p&gt;Skip rotation if log is empty&lt;/p&gt;

&lt;p&gt;Final flow&lt;/p&gt;

&lt;p&gt;Logs grow → monthly rotation → old logs compressed → only 3 kept&lt;/p&gt;

&lt;p&gt;⚡ Key Concept&lt;/p&gt;

&lt;p&gt;Log rotation = prevent disk full issues&lt;/p&gt;

&lt;p&gt;🎯 Key Takeaway&lt;/p&gt;

&lt;p&gt;Production systems ALWAYS rotate logs to save storage&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>aws</category>
      <category>linuxlevel2</category>
    </item>
    <item>
      <title>22.Linux GPG Encryption</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 22 Mar 2026 16:00:00 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/22linux-gpg-encryption-1e49</link>
      <guid>https://forem.com/thukhakyawe_cloud/22linux-gpg-encryption-1e49</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;We have confidential data that needs to be transferred to a remote location, so we need to encrypt that data.We also need to decrypt data we received from a remote location in order to understand its content.&lt;/p&gt;

&lt;p&gt;On storage server in Stratos Datacenter we have private and public keys stored at /home/*_key.asc. Use these keys to perform the following actions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Encrypt /home/encrypt_me.txt to /home/encrypted_me.asc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decrypt /home/decrypt_me.asc to /home/decrypted_me.txt. (Passphrase for decryption and encryption is kodekloud).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The user ID you can use is &lt;a href="mailto:kodekloud@kodekloud.com"&gt;kodekloud@kodekloud.com&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;🧭 Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;1️⃣ Login to Storage Server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh natasha@ststor01
&lt;span class="c"&gt;# Password: Bl@kW&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Import GPG keys&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--import&lt;/span&gt; /home/&lt;span class="k"&gt;*&lt;/span&gt;_key.asc
&lt;span class="c"&gt;# Password: kodekloud&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3️⃣ Verify keys (optional but good practice)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--list-keys&lt;/span&gt;
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;777 /home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 You should see:&lt;/p&gt;

&lt;p&gt;&lt;a href="mailto:kodekloud@kodekloud.com"&gt;kodekloud@kodekloud.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4️⃣ Encrypt the file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--output&lt;/span&gt; /home/encrypted_me.asc &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--encrypt&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--recipient&lt;/span&gt; kodekloud@kodekloud.com &lt;span class="se"&gt;\&lt;/span&gt;
    /home/encrypt_me.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Enter passphrase when asked:&lt;/p&gt;

&lt;p&gt;kodekloud&lt;/p&gt;

&lt;p&gt;5️⃣ Decrypt the file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--output&lt;/span&gt; /home/decrypted_me.txt &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--decrypt&lt;/span&gt; /home/decrypt_me.asc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Enter passphrase:&lt;/p&gt;

&lt;p&gt;kodekloud&lt;/p&gt;

&lt;p&gt;6️⃣ Verify output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /home/decrypted_me.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;p&gt;What this lab is about&lt;/p&gt;

&lt;p&gt;You are working with:&lt;/p&gt;

&lt;p&gt;Encryption → hide data&lt;br&gt;
Decryption → read data&lt;/p&gt;

&lt;p&gt;Step 1: Import keys&lt;/p&gt;

&lt;p&gt;gpg --import&lt;/p&gt;

&lt;p&gt;👉 This loads:&lt;/p&gt;

&lt;p&gt;Public key → used to encrypt&lt;br&gt;
Private key → used to decrypt&lt;/p&gt;

&lt;p&gt;Step 2: Encryption&lt;/p&gt;

&lt;p&gt;gpg --encrypt&lt;/p&gt;

&lt;p&gt;👉 What happens:&lt;/p&gt;

&lt;p&gt;Plain file → converted into unreadable encrypted file&lt;/p&gt;

&lt;p&gt;Only the person with the private key can open it.&lt;/p&gt;

&lt;p&gt;Step 3: Decryption&lt;/p&gt;

&lt;p&gt;gpg --decrypt&lt;/p&gt;

&lt;p&gt;👉 What happens:&lt;/p&gt;

&lt;p&gt;Encrypted file → converted back to readable content&lt;br&gt;
Why passphrase is needed&lt;br&gt;
Passphrase = protects the private key&lt;/p&gt;

&lt;p&gt;Even if someone has the key file, they still need:&lt;/p&gt;

&lt;p&gt;kodekloud&lt;br&gt;
How keys work (simple idea)&lt;br&gt;
Public key → lock 🔒&lt;br&gt;
Private key → unlock 🔑&lt;/p&gt;

&lt;p&gt;Final flow&lt;br&gt;
encrypt_me.txt → encrypted_me.asc → (secure transfer)&lt;br&gt;
decrypt_me.asc → decrypted_me.txt → readable&lt;/p&gt;

&lt;p&gt;⚡ Key Takeaway&lt;br&gt;
Encryption protects data during transfer&lt;br&gt;
Decryption allows authorized access&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>aws</category>
      <category>linuxlevel2</category>
    </item>
    <item>
      <title>21.Apache Troubleshooting</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 22 Mar 2026 15:30:00 +0000</pubDate>
      <link>https://forem.com/thukhakyawe_cloud/21apache-troubleshooting-265g</link>
      <guid>https://forem.com/thukhakyawe_cloud/21apache-troubleshooting-265g</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;xFusionCorp Industries uses some monitoring tools to check the status of every service, application, etc running on the systems. Recently, the monitoring system identified that Apache service is not running on some of the Nautilus Application Servers in Stratos Datacenter.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Identify the faulty Nautilus Application Server and fix the issue. Also, make sure Apache service is up and running on all Nautilus Application Servers. Do not try to stop any kind of firewall that is already running.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Apache is running on 5004 port on all Nautilus Application Servers and its document root must be /var/www/html on all app servers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally you can test from jump host using curl command to access Apache on all app servers and it should be reachable and you should get some static page. E.g. curl &lt;a href="http://stapp01:5004/" rel="noopener noreferrer"&gt;http://stapp01:5004/&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;🧭 Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;1️⃣ Login to jump host&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;ssh&lt;/span&gt; thor@jump_host
&lt;span class="c1"&gt;# Password: mjolnir123&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Identify faulty app server&lt;/p&gt;

&lt;p&gt;Test all servers:&lt;/p&gt;

&lt;p&gt;curl &lt;a href="http://stapp01:5004/" rel="noopener noreferrer"&gt;http://stapp01:5004/&lt;/a&gt;&lt;br&gt;
curl &lt;a href="http://stapp02:5004/" rel="noopener noreferrer"&gt;http://stapp02:5004/&lt;/a&gt;&lt;br&gt;
curl &lt;a href="http://stapp03:5004/" rel="noopener noreferrer"&gt;http://stapp03:5004/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3️⃣ Login to faulty server&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;ssh&lt;/span&gt; tony@stapp01
&lt;span class="c1"&gt;# Password : Ir0nM@n&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; -i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Use correct user for each server)&lt;/p&gt;

&lt;p&gt;4️⃣ Check Apache status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status httpd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5️⃣ Fix Apache issues&lt;/p&gt;

&lt;p&gt;✅ Set correct port (5004)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi /etc/httpd/conf/httpd.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&lt;/p&gt;

&lt;p&gt;Listen 5004&lt;/p&gt;

&lt;p&gt;✅ Start and enable Apache&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl restart httpd
systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;httpd
systemctl status httpd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6️⃣ Verify locally on that server&lt;/p&gt;

&lt;p&gt;curl &lt;a href="http://stapp01:5004/" rel="noopener noreferrer"&gt;http://stapp01:5004/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7️⃣ Repeat check on all app servers&lt;/p&gt;

&lt;p&gt;Login to each:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh steve@stapp02
&lt;span class="c"&gt;# Password : Am3ric@&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status httpd
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart httpd
journalctl &lt;span class="nt"&gt;-xeu&lt;/span&gt; httpd.service
&lt;span class="c"&gt;# Change ServerRoot "/etc/httpd"&lt;/span&gt;
vi /etc/httpd/conf/httpd.conf
systemctl restart httpd
systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;httpd
systemctl status httpd
curl http://stapp02:5004/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh banner@stapp03
&lt;span class="c"&gt;# Password: BigGr33n&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status httpd
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart httpd
journalctl &lt;span class="nt"&gt;-xeu&lt;/span&gt; httpd.service
&lt;span class="c"&gt;# Uncomment Listen 5004 and  Add " " at DocumentRoot "/var/www/html"&lt;/span&gt;
vi /etc/httpd/conf/httpd.conf
systemctl restart httpd
systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;httpd
systemctl status httpd
curl http://stapp03:5004/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 All must be running&lt;/p&gt;

&lt;p&gt;👉 All should return a webpage&lt;/p&gt;

&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;p&gt;What this lab is about&lt;/p&gt;

&lt;p&gt;You are fixing a real production issue:&lt;/p&gt;

&lt;p&gt;Some servers are working, some are broken → find and fix them&lt;/p&gt;

&lt;p&gt;Step 1: Find which server is broken&lt;br&gt;
curl &lt;a href="http://stapp01:5004/" rel="noopener noreferrer"&gt;http://stapp01:5004/&lt;/a&gt;&lt;br&gt;
curl &lt;a href="http://stapp02:5004/" rel="noopener noreferrer"&gt;http://stapp02:5004/&lt;/a&gt;&lt;br&gt;
curl &lt;a href="http://stapp03:5004/" rel="noopener noreferrer"&gt;http://stapp03:5004/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 This is like checking:&lt;/p&gt;

&lt;p&gt;“Which machine is not responding?”&lt;br&gt;
If it shows a page → ✅ working&lt;br&gt;
If it fails → ❌ faulty server&lt;/p&gt;

&lt;p&gt;Step 2: Check Apache service&lt;/p&gt;

&lt;p&gt;systemctl status httpd&lt;/p&gt;

&lt;p&gt;👉 This tells you:&lt;/p&gt;

&lt;p&gt;Is Apache running or stopped?&lt;/p&gt;

&lt;p&gt;Step 3: Fix configuration issues&lt;/p&gt;

&lt;p&gt;You checked logs:&lt;/p&gt;

&lt;p&gt;journalctl -xeu httpd.service&lt;/p&gt;

&lt;p&gt;👉 Logs tell you:&lt;/p&gt;

&lt;p&gt;Why Apache failed&lt;br&gt;
Common problems you fixed&lt;/p&gt;

&lt;p&gt;🔴 Problem 1: Wrong ServerRoot&lt;/p&gt;

&lt;p&gt;ServerRoot /var/www/html   ❌&lt;/p&gt;

&lt;p&gt;👉 This is wrong because:&lt;/p&gt;

&lt;p&gt;ServerRoot = where Apache system files are stored&lt;/p&gt;

&lt;p&gt;Correct:&lt;/p&gt;

&lt;p&gt;ServerRoot "/etc/httpd"   ✅&lt;/p&gt;

&lt;p&gt;🔴 Problem 2: Port not configured&lt;/p&gt;

&lt;p&gt;Listen 5004&lt;/p&gt;

&lt;p&gt;👉 Apache must listen on the correct port, otherwise:&lt;/p&gt;

&lt;p&gt;curl &lt;a href="http://server:5004" rel="noopener noreferrer"&gt;http://server:5004&lt;/a&gt; → will fail&lt;/p&gt;

&lt;p&gt;🔴 Problem 3: DocumentRoot formatting&lt;/p&gt;

&lt;p&gt;DocumentRoot /var/www/html   ❌&lt;/p&gt;

&lt;p&gt;Correct:&lt;/p&gt;

&lt;p&gt;DocumentRoot "/var/www/html"   ✅&lt;/p&gt;

&lt;p&gt;👉 Quotes are important in Apache config.&lt;/p&gt;

&lt;p&gt;Step 4: Restart Apache&lt;/p&gt;

&lt;p&gt;systemctl restart httpd&lt;/p&gt;

&lt;p&gt;👉 Applies your fixes.&lt;/p&gt;

&lt;p&gt;Step 5: Verify again&lt;/p&gt;

&lt;p&gt;curl &lt;a href="http://stapp02:5004/" rel="noopener noreferrer"&gt;http://stapp02:5004/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 Now it should work.&lt;/p&gt;

&lt;p&gt;Step 6: Repeat for all servers&lt;/p&gt;

&lt;p&gt;Each server can have different issues:&lt;/p&gt;

&lt;p&gt;Server  Issue&lt;br&gt;
stapp01 may be OK&lt;br&gt;
stapp02 ServerRoot broken&lt;br&gt;
stapp03 Listen/DocumentRoot issue&lt;/p&gt;

&lt;p&gt;👉 So you fix each one individually&lt;/p&gt;

&lt;p&gt;🔁 Final Flow (Very Important)&lt;/p&gt;

&lt;p&gt;Test → Find broken server → Check service → Check logs → Fix config → Restart → Test again&lt;/p&gt;

&lt;p&gt;⚡ Key Concepts You Learned&lt;/p&gt;

&lt;p&gt;1️⃣ Services depend on config&lt;/p&gt;

&lt;p&gt;Wrong config → service won’t start&lt;/p&gt;

&lt;p&gt;2️⃣ Logs are your best friend&lt;/p&gt;

&lt;p&gt;journalctl -xeu httpd.service&lt;/p&gt;

&lt;p&gt;👉 Always tells the real problem&lt;/p&gt;

&lt;p&gt;3️⃣ Apache has strict syntax&lt;/p&gt;

&lt;p&gt;Small mistake → full service failure&lt;/p&gt;

&lt;p&gt;4️⃣ Ports must match requirement&lt;/p&gt;

&lt;p&gt;Apache must listen on 5004&lt;/p&gt;

&lt;p&gt;✅ Final Result&lt;br&gt;
All app servers:&lt;br&gt;
✔ Apache running&lt;br&gt;
✔ Port 5004 working&lt;br&gt;
✔ curl returns webpage&lt;/p&gt;

&lt;p&gt;🎯 Key Takeaway&lt;/p&gt;

&lt;p&gt;Don’t guess → Test → Read logs → Fix exactly what’s broken&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📖 More Deep Dives: &lt;a href="https://thukhakyawe.hashnode.dev/" rel="noopener noreferrer"&gt;Whispering Cloud Insights&lt;/a&gt; - Read other technical articles
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>aws</category>
      <category>linuxlevel2</category>
    </item>
  </channel>
</rss>
