<?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>DEV Community: Aisalkyn Aidarova</title>
    <description>The latest articles on DEV Community by Aisalkyn Aidarova (@jumptotech).</description>
    <link>https://dev.to/jumptotech</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3549986%2F7a403ca9-0459-412a-b618-71699480d58d.png</url>
      <title>DEV Community: Aisalkyn Aidarova</title>
      <link>https://dev.to/jumptotech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jumptotech"/>
    <language>en</language>
    <item>
      <title>Networking from Zero: How Two Computers Communicate — A Complete Guide for DevOps and SRE Engineers</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Mon, 30 Nov 2026 14:49:01 +0000</pubDate>
      <link>https://dev.to/jumptotech/networking-from-zero-how-two-computers-communicate-a-complete-guide-for-devops-and-sre-engineers-po5</link>
      <guid>https://dev.to/jumptotech/networking-from-zero-how-two-computers-communicate-a-complete-guide-for-devops-and-sre-engineers-po5</guid>
      <description>&lt;p&gt;Understanding networking is one of the most important skills for a DevOps Engineer, Site Reliability Engineer (SRE), Cloud Engineer, or System Administrator.&lt;/p&gt;

&lt;p&gt;We often work with Kubernetes, Docker, AWS, Load Balancers, Ingress Controllers, and CI/CD pipelines. But behind all these technologies is a fundamental process: communication between computers.&lt;/p&gt;

&lt;p&gt;Before learning how to troubleshoot a production environment, we need to understand what actually happens when one computer sends information to another computer.&lt;/p&gt;

&lt;p&gt;In this article, we will start from the very beginning. Even if you have no technical background, you should be able to understand how network communication works.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. How Does a Computer Know How to Communicate?
&lt;/h2&gt;

&lt;p&gt;Imagine that you buy a new computer and install an operating system such as Linux, Windows, or macOS.&lt;/p&gt;

&lt;p&gt;How does this computer already know how to communicate with other computers?&lt;/p&gt;

&lt;p&gt;The answer is that modern operating systems already implement networking protocols.&lt;/p&gt;

&lt;p&gt;Inside the operating system, there is a component called the &lt;strong&gt;Kernel&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Kernel is the core of the operating system. It manages communication between software and hardware.&lt;/p&gt;

&lt;p&gt;The Kernel is responsible for managing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;File systems&lt;/li&gt;
&lt;li&gt;Hardware devices&lt;/li&gt;
&lt;li&gt;Network communication&lt;/li&gt;
&lt;li&gt;System resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inside the Kernel, there is a networking subsystem commonly called the &lt;strong&gt;TCP/IP Network Stack&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This subsystem provides the computer with the ability to communicate using networking protocols.&lt;/p&gt;

&lt;p&gt;However, having the ability to establish a connection does not mean a connection is already established.&lt;/p&gt;

&lt;p&gt;TCP connections are created when applications need them.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. What Is Inside a Computer?
&lt;/h2&gt;

&lt;p&gt;Let's divide a computer into three major areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User Space&lt;/li&gt;
&lt;li&gt;Kernel Space&lt;/li&gt;
&lt;li&gt;Hardware
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+----------------------------------------+
|               COMPUTER                 |
|                                        |
|  +----------------------------------+  |
|  |           USER SPACE             |  |
|  |                                  |  |
|  | Browser, NGINX, Python, Java     |  |
|  | Node.js, Applications           |  |
|  | HTTP, TLS, DNS Client           |  |
|  +----------------------------------+  |
|                 |                      |
|            System Calls                |
|                 |                      |
|  +----------------------------------+  |
|  |          KERNEL SPACE            |  |
|  |                                  |  |
|  | Socket Interface                 |  |
|  | TCP / UDP                        |  |
|  | IP / Routing Table               |  |
|  | ARP / Neighbor Table             |  |
|  | Network Device Drivers           |  |
|  +----------------------------------+  |
|                 |                      |
|  +----------------------------------+  |
|  |            HARDWARE              |  |
|  |                                  |  |
|  | CPU, RAM, Disk, NIC              |  |
|  +----------------------------------+  |
+----------------------------------------+
                  |
               Network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  User Space
&lt;/h3&gt;

&lt;p&gt;User Space is where regular applications run.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Chrome&lt;/li&gt;
&lt;li&gt;NGINX&lt;/li&gt;
&lt;li&gt;Apache&lt;/li&gt;
&lt;li&gt;Python applications&lt;/li&gt;
&lt;li&gt;Java applications&lt;/li&gt;
&lt;li&gt;Node.js applications&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An application understands what information it wants to send or receive.&lt;/p&gt;

&lt;p&gt;For example, a browser wants to request a web page from a web server.&lt;/p&gt;

&lt;p&gt;However, most applications do not directly control the physical network card. They communicate with the operating system using a socket interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kernel Space
&lt;/h3&gt;

&lt;p&gt;Kernel Space is where the core operating system operates.&lt;/p&gt;

&lt;p&gt;In a traditional Linux networking architecture, the Kernel manages TCP, UDP, IP routing, network interfaces, packet processing, and network drivers.&lt;/p&gt;

&lt;p&gt;When an application needs to establish a TCP connection, it can use system calls such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;socket()
connect()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Kernel performs the underlying networking operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardware
&lt;/h3&gt;

&lt;p&gt;Hardware includes the physical components of the computer.&lt;/p&gt;

&lt;p&gt;For networking, one of the most important components is the Network Interface Card, also known as NIC.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. What Are the Seven Layers of the OSI Model?
&lt;/h2&gt;

&lt;p&gt;The OSI Model is a conceptual framework that helps us understand how network communication works.&lt;/p&gt;

&lt;p&gt;The seven layers are not seven separate programs installed inside the Kernel.&lt;/p&gt;

&lt;p&gt;Instead, they describe different responsibilities in network communication.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Examples and responsibilities&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Layer 7&lt;/td&gt;
&lt;td&gt;Application&lt;/td&gt;
&lt;td&gt;HTTP, DNS, SSH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer 6&lt;/td&gt;
&lt;td&gt;Presentation&lt;/td&gt;
&lt;td&gt;Encoding, encryption, data representation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer 5&lt;/td&gt;
&lt;td&gt;Session&lt;/td&gt;
&lt;td&gt;Managing communication sessions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer 4&lt;/td&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;TCP, UDP, ports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer 3&lt;/td&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;IP addresses, routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer 2&lt;/td&gt;
&lt;td&gt;Data Link&lt;/td&gt;
&lt;td&gt;Ethernet, MAC addresses, frames&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer 1&lt;/td&gt;
&lt;td&gt;Physical&lt;/td&gt;
&lt;td&gt;Electrical signals, light, radio waves&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Where Are These Layers Located Inside a Computer?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USER SPACE
--------------------------------
Layer 7 - Application
Layer 6 - Presentation
Layer 5 - Session
--------------------------------
          System Calls
--------------------------------
KERNEL SPACE
--------------------------------
Layer 4 - TCP / UDP
Layer 3 - IP / Routing
Layer 2 - Ethernet processing
          Network Drivers
--------------------------------
HARDWARE
--------------------------------
Layer 2 - NIC frame processing
Layer 1 - Physical signals
--------------------------------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a simplified representation of a traditional Linux networking architecture.&lt;/p&gt;

&lt;p&gt;Real implementations do not always follow these boundaries exactly. Some networking operations can be performed in hardware or User Space.&lt;/p&gt;

&lt;p&gt;For example, HTTP/3 uses QUIC over UDP, with QUIC commonly implemented in User Space.&lt;/p&gt;

&lt;p&gt;The OSI model helps us understand responsibilities rather than exact software implementation boundaries.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. What Is a Network Interface Card (NIC)?
&lt;/h2&gt;

&lt;p&gt;NIC stands for Network Interface Card.&lt;/p&gt;

&lt;p&gt;A NIC allows a computer to send and receive information through a network.&lt;/p&gt;

&lt;p&gt;A computer can have multiple network interfaces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ethernet interface&lt;/li&gt;
&lt;li&gt;Wi-Fi interface&lt;/li&gt;
&lt;li&gt;Virtual network interface&lt;/li&gt;
&lt;li&gt;Loopback interface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A physical network interface communicates through a physical medium, while virtual interfaces operate through software.&lt;/p&gt;

&lt;p&gt;Examples of physical transmission include:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Connection type&lt;/th&gt;
&lt;th&gt;How information travels&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ethernet copper cable&lt;/td&gt;
&lt;td&gt;Electrical signals&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fiber optic cable&lt;/td&gt;
&lt;td&gt;Light signals&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wi-Fi&lt;/td&gt;
&lt;td&gt;Radio waves&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The information is represented as digital data and transmitted using signals.&lt;/p&gt;

&lt;p&gt;The receiving device converts those signals back into digital information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the NIC Establish TCP Connections?
&lt;/h3&gt;

&lt;p&gt;Normally, no.&lt;/p&gt;

&lt;p&gt;The NIC sends and receives network traffic, while the operating system's networking subsystem manages TCP connections.&lt;/p&gt;

&lt;p&gt;A single NIC can carry traffic belonging to thousands of TCP connections.&lt;/p&gt;

&lt;p&gt;Some modern network cards support hardware offloading, but the traditional model is that the Kernel maintains TCP connection state.&lt;/p&gt;

&lt;p&gt;Think about it this way:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The NIC is the door through which information enters and leaves the computer. The Kernel manages the communication passing through that door.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5. What Is a MAC Address?
&lt;/h2&gt;

&lt;p&gt;MAC stands for Media Access Control.&lt;/p&gt;

&lt;p&gt;A MAC address is an identifier associated with a network interface at the data link layer.&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 plaintext"&gt;&lt;code&gt;00:1A:2B:3C:4D:5E
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Physical network interfaces commonly have a manufacturer-assigned MAC address. Operating systems can also configure or randomize MAC addresses.&lt;/p&gt;

&lt;p&gt;A MAC address is used for communication within a local data link network.&lt;/p&gt;

&lt;p&gt;When information travels through an Ethernet network, an Ethernet frame contains a source MAC address and a destination MAC address.&lt;/p&gt;

&lt;p&gt;A common misunderstanding is that a switch gives computers their MAC addresses.&lt;/p&gt;

&lt;p&gt;A switch does not normally assign MAC addresses.&lt;/p&gt;

&lt;p&gt;Instead, it learns MAC addresses from network traffic.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. What Is an IP Address?
&lt;/h2&gt;

&lt;p&gt;IP stands for Internet Protocol.&lt;/p&gt;

&lt;p&gt;An IP address identifies a network interface for communication at the IP layer.&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 plaintext"&gt;&lt;code&gt;192.168.1.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While MAC addresses are used for communication within a local link, IP addresses allow traffic to be routed between different networks.&lt;/p&gt;

&lt;p&gt;Consider the following analogy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IP address: the destination address for delivery.&lt;/li&gt;
&lt;li&gt;MAC address: the local delivery recipient on the current part of the journey.&lt;/li&gt;
&lt;li&gt;Router: the distribution center that forwards the delivery toward its destination.&lt;/li&gt;
&lt;li&gt;NIC: the entrance and exit through which the delivery passes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  MAC Address vs. IP Address
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MAC Address&lt;/th&gt;
&lt;th&gt;IP Address&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Layer 2&lt;/td&gt;
&lt;td&gt;Layer 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used within a local link&lt;/td&gt;
&lt;td&gt;Used for communication across networks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used when forwarding Ethernet frames&lt;/td&gt;
&lt;td&gt;Used when routing IP packets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Associated with a network interface&lt;/td&gt;
&lt;td&gt;Configured on a network interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can change or be randomized&lt;/td&gt;
&lt;td&gt;Can change through DHCP or manual configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;MAC addresses are generally replaced as traffic passes through routers onto new Ethernet links.&lt;/p&gt;

&lt;p&gt;IP addresses generally identify the original network endpoints, although NAT can translate them.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. What Is DHCP?
&lt;/h2&gt;

&lt;p&gt;When you connect your laptop to your home Wi-Fi, you normally do not manually configure an IP address.&lt;/p&gt;

&lt;p&gt;How does your computer receive its network configuration?&lt;/p&gt;

&lt;p&gt;Through DHCP.&lt;/p&gt;

&lt;p&gt;DHCP stands for Dynamic Host Configuration Protocol.&lt;/p&gt;

&lt;p&gt;A DHCP server can provide the computer with information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IP address&lt;/li&gt;
&lt;li&gt;Subnet mask&lt;/li&gt;
&lt;li&gt;Default gateway&lt;/li&gt;
&lt;li&gt;DNS servers&lt;/li&gt;
&lt;li&gt;Lease duration&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP Address:      192.168.1.10
Subnet Mask:     255.255.255.0
Default Gateway: 192.168.1.1
DNS Server:      192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a typical home network, the router also operates as a DHCP server.&lt;/p&gt;

&lt;p&gt;In enterprise environments, DHCP may run on dedicated infrastructure.&lt;/p&gt;

&lt;p&gt;MAC addresses and IP addresses are different. DHCP normally provides IP configuration, not the physical NIC's manufacturer-assigned MAC address.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Understanding Switches, Routers, Gateways, and Modems
&lt;/h2&gt;

&lt;p&gt;These devices are essential to understanding how traffic travels between computers.&lt;/p&gt;

&lt;p&gt;A typical home network looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop / Computer
        |
    Wi-Fi / Cable
        |
Switch / Wi-Fi Access Point
        |
      Router
  (Default Gateway)
        |
    Modem / ONT
        |
       ISP
        |
     Internet
        |
   Remote Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8.1. What Is a Switch?
&lt;/h3&gt;

&lt;p&gt;A switch connects devices inside a local network.&lt;/p&gt;

&lt;p&gt;For example, imagine three computers connected to the same switch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Computer A       Computer B       Computer C
     |                |                |
     +----------------+----------------+
                      |
                    Switch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The switch learns source MAC addresses from incoming Ethernet frames and associates them with its ports.&lt;/p&gt;

&lt;p&gt;It maintains a MAC address table.&lt;/p&gt;

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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MAC Address&lt;/th&gt;
&lt;th&gt;Switch Port&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AA:AA:AA:AA:AA:01&lt;/td&gt;
&lt;td&gt;Port 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA:AA:AA:AA:AA:02&lt;/td&gt;
&lt;td&gt;Port 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA:AA:AA:AA:AA:03&lt;/td&gt;
&lt;td&gt;Port 3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When Computer A sends an Ethernet frame to Computer B, the switch uses its MAC address table to determine the appropriate outgoing port.&lt;/p&gt;

&lt;p&gt;If the destination MAC address is unknown, the switch may flood the frame within the relevant local network.&lt;/p&gt;

&lt;p&gt;A traditional Layer 2 switch forwards Ethernet frames.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.2. What Is a Router?
&lt;/h3&gt;

&lt;p&gt;A router connects different IP networks.&lt;/p&gt;

&lt;p&gt;Imagine these two networks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Network A              Network B

192.168.1.0/24         192.168.2.0/24

Computer A             Computer B
192.168.1.10           192.168.2.20
       |                     |
       +------- Router ------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The computers belong to different IP networks.&lt;/p&gt;

&lt;p&gt;A router allows traffic to move between them by examining destination IP addresses and consulting its routing table.&lt;/p&gt;

&lt;p&gt;A router may connect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A home network to the internet&lt;/li&gt;
&lt;li&gt;Different office networks&lt;/li&gt;
&lt;li&gt;Data center networks&lt;/li&gt;
&lt;li&gt;Cloud networks&lt;/li&gt;
&lt;li&gt;Different subnets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A router does not necessarily provide internet access. It can also route traffic between private networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.3. What Is a Default Gateway?
&lt;/h3&gt;

&lt;p&gt;A default gateway is the next-hop router that a computer uses when there is no more specific route to a destination.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Computer IP:     192.168.1.10
Default Gateway: 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the computer needs to communicate with a destination outside its local network, the operating system may send the packet through its default gateway.&lt;/p&gt;

&lt;p&gt;The default gateway is a role performed by a router, not necessarily a separate physical device.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.4. What Is a Wi-Fi Access Point?
&lt;/h3&gt;

&lt;p&gt;A Wi-Fi Access Point connects wireless devices to a network.&lt;/p&gt;

&lt;p&gt;It allows laptops, smartphones, and other wireless devices to communicate using radio signals.&lt;/p&gt;

&lt;p&gt;An access point can bridge wireless traffic into a wired local network.&lt;/p&gt;

&lt;p&gt;A standalone access point does not necessarily perform routing.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.5. What Is a Modem?
&lt;/h3&gt;

&lt;p&gt;A modem provides connectivity using an access technology supported by an internet service provider.&lt;/p&gt;

&lt;p&gt;For fiber connections, a device called an Optical Network Terminal (ONT) is commonly used instead.&lt;/p&gt;

&lt;p&gt;A modem and a router perform different responsibilities.&lt;/p&gt;

&lt;p&gt;In many homes, the following components are combined into one physical device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Router&lt;/li&gt;
&lt;li&gt;Ethernet switch&lt;/li&gt;
&lt;li&gt;Wi-Fi access point&lt;/li&gt;
&lt;li&gt;Modem&lt;/li&gt;
&lt;li&gt;DHCP server&lt;/li&gt;
&lt;li&gt;NAT&lt;/li&gt;
&lt;li&gt;Firewall&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why people often use the terms router and modem interchangeably, even though they are not the same thing.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.6. What Is an ISP?
&lt;/h3&gt;

&lt;p&gt;ISP stands for Internet Service Provider.&lt;/p&gt;

&lt;p&gt;The ISP connects your home or business network to wider networks and the internet.&lt;/p&gt;

&lt;p&gt;The internet itself is a massive collection of interconnected networks.&lt;/p&gt;

&lt;p&gt;There is no single router controlling the entire internet.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. What Is a Routing Table?
&lt;/h2&gt;

&lt;p&gt;A routing table tells the operating system where to send IP packets.&lt;/p&gt;

&lt;p&gt;Every standard Linux computer with IP networking has routing information.&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 plaintext"&gt;&lt;code&gt;Destination         Next Hop       Interface

192.168.1.0/24      Direct         eth0
0.0.0.0/0           192.168.1.1    eth0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first route tells the computer that devices in the local network can be reached directly.&lt;/p&gt;

&lt;p&gt;The second route is the default route.&lt;/p&gt;

&lt;p&gt;If no more specific route matches the destination, traffic is forwarded to the default gateway.&lt;/p&gt;

&lt;p&gt;On Linux, we can inspect the routing table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip route
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also ask which route the Kernel would use for a particular destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip route get 8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is extremely useful for troubleshooting connectivity problems.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. What Is ARP?
&lt;/h2&gt;

&lt;p&gt;ARP stands for Address Resolution Protocol.&lt;/p&gt;

&lt;p&gt;In an IPv4 Ethernet network, ARP helps a computer discover the MAC address associated with a neighboring IP address.&lt;/p&gt;

&lt;p&gt;Imagine that your computer knows the following information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Computer IP: 192.168.1.10
Router IP:   192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The computer knows the router's IP address but does not yet know its MAC address.&lt;/p&gt;

&lt;p&gt;To send an Ethernet frame, it needs the destination MAC address.&lt;/p&gt;

&lt;p&gt;The computer sends an ARP request to the local network.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Computer:

Who has IP address 192.168.1.1?
Please tell 192.168.1.10.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router responds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Router:

192.168.1.1 is my IP address.
My MAC address is AA:BB:CC:DD:EE:FF.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The computer can store this information in its neighbor cache.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP Address       MAC Address

192.168.1.1      AA:BB:CC:DD:EE:FF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip neigh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;arp -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The computer does not need to perform a new ARP exchange before every packet. Previously learned information can be reused.&lt;/p&gt;

&lt;p&gt;For IPv6 networks, Neighbor Discovery Protocol performs related functions instead of ARP.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. Where Does TCP Live Inside the Computer?
&lt;/h2&gt;

&lt;p&gt;TCP stands for Transmission Control Protocol.&lt;/p&gt;

&lt;p&gt;In a traditional Linux network stack, TCP is implemented inside the Kernel.&lt;/p&gt;

&lt;p&gt;The Kernel maintains information about TCP connections in memory.&lt;/p&gt;

&lt;p&gt;For each connection, information may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source IP address&lt;/li&gt;
&lt;li&gt;Source port&lt;/li&gt;
&lt;li&gt;Destination IP address&lt;/li&gt;
&lt;li&gt;Destination port&lt;/li&gt;
&lt;li&gt;Connection state&lt;/li&gt;
&lt;li&gt;Sequence numbers&lt;/li&gt;
&lt;li&gt;Acknowledgment numbers&lt;/li&gt;
&lt;li&gt;Send and receive buffers&lt;/li&gt;
&lt;li&gt;Retransmission timers&lt;/li&gt;
&lt;li&gt;Flow and congestion control information&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source IP:        192.168.1.10
Source Port:      52341

Destination IP:   203.0.113.20
Destination Port: 443

Connection State: ESTABLISHED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A TCP connection is a logical communication relationship between two endpoints.&lt;/p&gt;

&lt;p&gt;It is not a physical cable, a NIC, a switch, or a router.&lt;/p&gt;

&lt;p&gt;The operating systems on both sides normally maintain their own state for that connection.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Is TCP Implemented in Linux Source Code?
&lt;/h3&gt;

&lt;p&gt;Linux is an open-source operating system Kernel.&lt;/p&gt;

&lt;p&gt;We can examine its actual networking implementation.&lt;/p&gt;

&lt;p&gt;Some important source code locations include:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Linux source file&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/socket.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Socket interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/ipv4/tcp.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Main TCP implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/ipv4/tcp_input.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Incoming TCP processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/ipv4/tcp_output.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Outgoing TCP processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/ipv4/udp.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;UDP implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/ipv4/route.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;IPv4 routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/ipv4/arp.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ARP implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net/core/dev.c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Network device processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;drivers/net/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Network device drivers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Official Linux source repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/torvalds/linux/tree/master/net" rel="noopener noreferrer"&gt;https://github.com/torvalds/linux/tree/master/net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows that TCP/IP networking is not just a theoretical concept. It is implemented as real software inside the operating system.&lt;/p&gt;




&lt;h2&gt;
  
  
  12. Why Do We Establish a TCP Connection Before Sending an HTTP Request?
&lt;/h2&gt;

&lt;p&gt;Imagine two people communicating over a phone.&lt;/p&gt;

&lt;p&gt;Before starting a conversation, one person calls the other person.&lt;/p&gt;

&lt;p&gt;The other person answers, and communication begins.&lt;/p&gt;

&lt;p&gt;TCP works in a conceptually similar way.&lt;/p&gt;

&lt;p&gt;For a normal new TCP connection, the client and server perform a process called the TCP Three-Way Handshake.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLIENT                              SERVER

    |                                  |
    |------------- SYN ---------------&amp;gt;|
    |                                  |
    |&amp;lt;---------- SYN-ACK --------------|
    |                                  |
    |------------- ACK ---------------&amp;gt;|
    |                                  |
    |     TCP CONNECTION ESTABLISHED   |
    |                                  |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1: SYN
&lt;/h3&gt;

&lt;p&gt;The client initiates the connection and communicates its initial sequence number.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: SYN-ACK
&lt;/h3&gt;

&lt;p&gt;The server acknowledges the client's sequence information and provides its own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: ACK
&lt;/h3&gt;

&lt;p&gt;The client acknowledges the server's sequence information.&lt;/p&gt;

&lt;p&gt;The connection is now established after successful completion of this exchange.&lt;/p&gt;

&lt;p&gt;The handshake helps synchronize the endpoints and establish connection state.&lt;/p&gt;

&lt;p&gt;TCP subsequently provides reliable, ordered byte-stream delivery, retransmitting missing data when necessary.&lt;/p&gt;

&lt;p&gt;An established TCP connection does not guarantee that the application is healthy. It confirms that the transport connection was successfully established.&lt;/p&gt;




&lt;h2&gt;
  
  
  13. TCP vs. UDP
&lt;/h2&gt;

&lt;p&gt;TCP and UDP are transport-layer protocols.&lt;/p&gt;

&lt;p&gt;Both provide communication using ports, but they behave differently.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;TCP&lt;/th&gt;
&lt;th&gt;UDP&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Connection-oriented&lt;/td&gt;
&lt;td&gt;Connectionless transport&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standard connection handshake&lt;/td&gt;
&lt;td&gt;No transport handshake&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reliable, ordered byte stream&lt;/td&gt;
&lt;td&gt;Datagram-based delivery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retransmission built into TCP&lt;/td&gt;
&lt;td&gt;No built-in delivery retransmission&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flow and congestion control&lt;/td&gt;
&lt;td&gt;No equivalent built-in mechanisms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used by SSH, HTTP/1.1, HTTP/2&lt;/td&gt;
&lt;td&gt;Used by traditional DNS queries, QUIC, streaming applications&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;UDP does not guarantee that a datagram will arrive, nor does it guarantee delivery order.&lt;/p&gt;

&lt;p&gt;However, applications and protocols built on UDP can implement their own reliability mechanisms.&lt;/p&gt;

&lt;p&gt;For example, QUIC provides reliable streams and security over UDP.&lt;/p&gt;




&lt;h2&gt;
  
  
  14. Complete Traffic Flow: From One Computer to Another
&lt;/h2&gt;

&lt;p&gt;Now let's connect everything we have learned.&lt;/p&gt;

&lt;p&gt;Imagine opening your browser and typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this example, assume:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IPv4 networking&lt;/li&gt;
&lt;li&gt;A new connection&lt;/li&gt;
&lt;li&gt;HTTPS using HTTP/1.1 or HTTP/2 over TCP&lt;/li&gt;
&lt;li&gt;A typical home network&lt;/li&gt;
&lt;li&gt;No VPN or proxy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The addresses below are illustrative.&lt;/p&gt;

&lt;h3&gt;
  
  
  Client Computer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP Address:      192.168.1.10
MAC Address:     AA:AA:AA:AA:AA:01
Default Gateway: 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Home Router
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Private IP: 192.168.1.1
Public IP:  198.51.100.10
MAC:        AA:AA:AA:AA:AA:02
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Remote Web Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP Address: 203.0.113.20
Port:       443
Application: NGINX
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1: The Browser Needs to Find the Server
&lt;/h3&gt;

&lt;p&gt;Humans remember domain names.&lt;/p&gt;

&lt;p&gt;Computers use IP addresses to route network traffic.&lt;/p&gt;

&lt;p&gt;The browser or operating system uses DNS to resolve the domain name, unless the address is already cached.&lt;/p&gt;

&lt;p&gt;DNS stands for Domain Name System.&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 plaintext"&gt;&lt;code&gt;example.com → 203.0.113.20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DNS itself also requires network communication when a cached answer is unavailable.&lt;/p&gt;

&lt;p&gt;Now the browser knows the destination IP address.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The Application Requests a TCP Connection
&lt;/h3&gt;

&lt;p&gt;The browser requests a connection to the destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;203.0.113.20:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The operating system creates a socket and prepares the TCP connection.&lt;/p&gt;

&lt;p&gt;The Kernel selects or uses an appropriate local IP address and source port.&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 plaintext"&gt;&lt;code&gt;192.168.1.10:52341 → 203.0.113.20:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: The Kernel Checks the Routing Table
&lt;/h3&gt;

&lt;p&gt;The destination IP address is outside the local network.&lt;/p&gt;

&lt;p&gt;The Kernel determines that traffic should be sent through the default gateway.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Default Gateway: 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser does not need to understand every router between the client and server.&lt;/p&gt;

&lt;p&gt;The operating system and network infrastructure handle the forwarding process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: The Kernel Resolves the Router's MAC Address
&lt;/h3&gt;

&lt;p&gt;The computer needs the MAC address of its next-hop router.&lt;/p&gt;

&lt;p&gt;If the neighbor cache does not already contain it, the computer performs ARP resolution.&lt;/p&gt;

&lt;p&gt;Notice something important:&lt;/p&gt;

&lt;p&gt;The destination IP address is the remote server's IP address, but the initial destination Ethernet MAC address belongs to the local router.&lt;/p&gt;

&lt;p&gt;The computer does not need to know the remote server's MAC address.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Encapsulation
&lt;/h3&gt;

&lt;p&gt;The operating system prepares the TCP SYN segment.&lt;/p&gt;

&lt;p&gt;Different networking layers add their own information before transmission.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+------------------------------------------+
| Ethernet Frame                           |
|                                          |
| Source MAC: Computer                     |
| Destination MAC: Local Router            |
|                                          |
|  +------------------------------------+  |
|  | IP Packet                          |  |
|  |                                    |  |
|  | Source IP: 192.168.1.10            |  |
|  | Destination IP: 203.0.113.20       |  |
|  |                                    |  |
|  |  +------------------------------+  |  |
|  |  | TCP Segment                  |  |  |
|  |  | Source Port: 52341           |  |  |
|  |  | Destination Port: 443        |  |  |
|  |  | Flag: SYN                    |  |  |
|  |  +------------------------------+  |  |
|  +------------------------------------+  |
+------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This process is called encapsulation.&lt;/p&gt;

&lt;p&gt;Each networking layer has a different responsibility.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TCP contains transport information.&lt;/li&gt;
&lt;li&gt;IP contains network addressing information.&lt;/li&gt;
&lt;li&gt;Ethernet contains local-link addressing information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The initial SYN does not normally contain the HTTP request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: The NIC Sends the Information
&lt;/h3&gt;

&lt;p&gt;The network driver and NIC prepare the information for transmission.&lt;/p&gt;

&lt;p&gt;Depending on the network medium, it travels using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Electrical signals&lt;/li&gt;
&lt;li&gt;Optical signals&lt;/li&gt;
&lt;li&gt;Radio waves&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the computer is using Wi-Fi, the wireless link uses Wi-Fi framing rather than ordinary Ethernet framing on that radio link.&lt;/p&gt;

&lt;p&gt;The access point can bridge the traffic into the wired network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: The Switch Forwards the Frame
&lt;/h3&gt;

&lt;p&gt;If an Ethernet switch exists between the computer and router, it examines the destination MAC address.&lt;/p&gt;

&lt;p&gt;The switch forwards the frame toward the appropriate port.&lt;/p&gt;

&lt;p&gt;A traditional Layer 2 switch does not need to establish a TCP connection with the client.&lt;/p&gt;

&lt;p&gt;Its responsibility is local frame forwarding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 8: The Router Processes the IP Packet
&lt;/h3&gt;

&lt;p&gt;The router receives the frame and examines the IP packet.&lt;/p&gt;

&lt;p&gt;It checks the destination IP address and selects the next route.&lt;/p&gt;

&lt;p&gt;A typical home router also performs NAT.&lt;/p&gt;

&lt;p&gt;NAT stands for Network Address Translation.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before NAT:

192.168.1.10:52341
        |
        v
203.0.113.20:443


After NAT:

198.51.100.10:61000
        |
        v
203.0.113.20:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router translates the private source address and may also translate the source port.&lt;/p&gt;

&lt;p&gt;It maintains translation information so that returning traffic can be forwarded to the correct internal computer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 9: Traffic Travels Through the Internet
&lt;/h3&gt;

&lt;p&gt;The packet may travel through multiple networks and routers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client
   |
Home Router
   |
ISP Router
   |
Internet Router
   |
Data Center Router
   |
Remote Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each router makes a forwarding decision based on its routing information.&lt;/p&gt;

&lt;p&gt;The link-layer headers are replaced as packets move between different links.&lt;/p&gt;

&lt;p&gt;The destination IP address usually remains the remote server's IP address unless another translation mechanism modifies it.&lt;/p&gt;

&lt;p&gt;The return path does not necessarily use exactly the same routers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 10: The Remote Server Receives the SYN
&lt;/h3&gt;

&lt;p&gt;The remote server's network interface receives the traffic.&lt;/p&gt;

&lt;p&gt;Its network driver passes the information into the operating system's network stack.&lt;/p&gt;

&lt;p&gt;The Kernel processes the incoming traffic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Remote Server

NIC
 |
Network Driver
 |
Ethernet Processing
 |
IP Layer
 |
TCP Layer
 |
Socket
 |
Application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This incoming processing is conceptually the reverse of encapsulation.&lt;/p&gt;

&lt;p&gt;If a TCP socket is listening on the destination port and network policies allow communication, the server can respond with SYN-ACK.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 11: TCP Connection Is Established
&lt;/h3&gt;

&lt;p&gt;The server sends SYN-ACK.&lt;/p&gt;

&lt;p&gt;The client responds with ACK.&lt;/p&gt;

&lt;p&gt;The TCP connection is established once both sides complete the necessary state transitions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser Kernel                 Server Kernel

       SYN ------------------------&amp;gt;

       &amp;lt;-------------------- SYN-ACK

       ACK ------------------------&amp;gt;

           TCP ESTABLISHED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both sides now have transport connection state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 12: TLS Handshake
&lt;/h3&gt;

&lt;p&gt;Because the URL uses HTTPS, the client and server need secure communication.&lt;/p&gt;

&lt;p&gt;For this traditional HTTPS-over-TCP example, the TLS handshake takes place after establishing TCP.&lt;/p&gt;

&lt;p&gt;TLS provides mechanisms for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;Server authentication&lt;/li&gt;
&lt;li&gt;Data integrity&lt;/li&gt;
&lt;li&gt;Establishing cryptographic keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The browser validates the server's certificate according to its trust and identity verification rules.&lt;/p&gt;

&lt;p&gt;A successful TCP connection does not mean TLS will succeed.&lt;/p&gt;

&lt;p&gt;For example, the TCP connection may work while the TLS handshake fails because of a certificate problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 13: The Browser Sends the HTTP Request
&lt;/h3&gt;

&lt;p&gt;Once the secure connection is ready, the browser sends its HTTP request.&lt;/p&gt;

&lt;p&gt;An illustrative HTTP/1.1 request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;GET&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="no"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt;
&lt;span class="nc"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request is transmitted as encrypted application data when using HTTPS.&lt;/p&gt;

&lt;p&gt;It travels through the established connection.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 14: The Server Processes the Request
&lt;/h3&gt;

&lt;p&gt;The operating system makes the received application data available through a socket.&lt;/p&gt;

&lt;p&gt;The web server, such as NGINX, reads the request.&lt;/p&gt;

&lt;p&gt;Depending on the architecture, NGINX may:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Return a static web page&lt;/li&gt;
&lt;li&gt;Forward the request to a backend&lt;/li&gt;
&lt;li&gt;Perform reverse proxy operations&lt;/li&gt;
&lt;li&gt;Apply access rules&lt;/li&gt;
&lt;li&gt;Return an error&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The backend may also communicate with a database, cache, or another service.&lt;/p&gt;

&lt;p&gt;Those downstream communications may establish their own independent network connections.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 15: The Server Returns a Response
&lt;/h3&gt;

&lt;p&gt;The server sends an HTTP response.&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 http"&gt;&lt;code&gt;&lt;span class="no"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="no"&gt;OK&lt;/span&gt;
&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response data travels back toward the client.&lt;/p&gt;

&lt;p&gt;The client's operating system receives and processes it.&lt;/p&gt;

&lt;p&gt;The browser interprets the HTTP response and displays the website.&lt;/p&gt;

&lt;p&gt;All of this can happen within milliseconds or seconds.&lt;/p&gt;

&lt;p&gt;Connections can also be reused for multiple requests, so a new TCP and TLS handshake is not necessary for every HTTP request.&lt;/p&gt;




&lt;h2&gt;
  
  
  15. The Complete Communication Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLIENT COMPUTER
=================================

Browser / Application
        |
       DNS
        |
   Socket Interface
        |
   TCP / IP Stack
        |
   Routing Decision
        |
   ARP / Neighbor Lookup
        |
   Network Driver
        |
       NIC

=================================
        |
    Wi-Fi / Cable
        |
 Switch / Access Point
        |
 Router / Default Gateway
        |
       NAT
        |
    Modem / ONT
        |
       ISP
        |
     Internet
        |
  Data Center Network
        |
=================================

REMOTE SERVER

       NIC
        |
   Network Driver
        |
   Ethernet / IP
        |
       TCP
        |
      Socket
        |
   NGINX / Application
        |
   Backend Application
        |
   Database / Cache

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

&lt;/div&gt;



&lt;p&gt;The physical journey and protocol sequence are related, but they are not the same thing.&lt;/p&gt;

&lt;p&gt;The logical TCP connection exists between transport endpoints.&lt;/p&gt;

&lt;p&gt;Switches and routers provide the network path that allows TCP segments to travel between those endpoints.&lt;/p&gt;




&lt;h2&gt;
  
  
  16. How Does This Connect to Cloud Computing?
&lt;/h2&gt;

&lt;p&gt;When we move from a home network to AWS, Azure, Google Cloud, or a private data center, the fundamental networking concepts remain relevant.&lt;/p&gt;

&lt;p&gt;The difference is that many infrastructure components are virtualized or managed by the cloud provider.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Traditional networking&lt;/th&gt;
&lt;th&gt;AWS example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Network interface&lt;/td&gt;
&lt;td&gt;Elastic Network Interface (ENI)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local network&lt;/td&gt;
&lt;td&gt;VPC subnet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Private network environment&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Routing table&lt;/td&gt;
&lt;td&gt;VPC Route Table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Internet connectivity&lt;/td&gt;
&lt;td&gt;Internet Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Outbound access from private networks&lt;/td&gt;
&lt;td&gt;NAT Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Traffic filtering&lt;/td&gt;
&lt;td&gt;Security Groups and Network ACLs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Request distribution&lt;/td&gt;
&lt;td&gt;Load Balancer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Computer / Server&lt;/td&gt;
&lt;td&gt;EC2 Instance&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are conceptual comparisons, not exact one-to-one hardware equivalents.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is an AWS Internet Gateway?
&lt;/h3&gt;

&lt;p&gt;An Internet Gateway is a managed VPC component that supports communication between a VPC and the internet.&lt;/p&gt;

&lt;p&gt;For an EC2 instance to communicate directly with the internet over IPv4, it generally needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An appropriate route to the Internet Gateway&lt;/li&gt;
&lt;li&gt;A public IPv4 address or Elastic IP&lt;/li&gt;
&lt;li&gt;Appropriate security rules&lt;/li&gt;
&lt;li&gt;A functioning operating system and application&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Destination     Target

10.0.0.0/16     local
0.0.0.0/0       igw-xxxxxxxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Attaching an Internet Gateway alone does not automatically make every instance publicly accessible.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is an AWS NAT Gateway?
&lt;/h3&gt;

&lt;p&gt;A public NAT Gateway commonly allows resources in private subnets to initiate outbound IPv4 internet communication.&lt;/p&gt;

&lt;p&gt;It does not normally allow unsolicited inbound internet connections to those resources.&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 plaintext"&gt;&lt;code&gt;Private EC2 Instance
        |
Private Subnet Route Table
        |
    NAT Gateway
        |
 Internet Gateway
        |
     Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application running inside EC2 still uses TCP/IP networking through its operating system.&lt;/p&gt;

&lt;p&gt;Cloud networking does not replace the TCP/IP stack.&lt;/p&gt;

&lt;p&gt;It provides the infrastructure through which that traffic travels.&lt;/p&gt;




&lt;h2&gt;
  
  
  17. How Does This Connect to Kubernetes?
&lt;/h2&gt;

&lt;p&gt;Kubernetes creates another layer of networking abstraction.&lt;/p&gt;

&lt;p&gt;However, Kubernetes networking also depends on fundamental networking concepts.&lt;/p&gt;

&lt;p&gt;A typical request to a Kubernetes application might follow this architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;External Client
       |
      DNS
       |
 External Load Balancer
       |
Kubernetes Ingress / Gateway
       |
 Kubernetes Service
       |
 Application Pod
       |
 Backend / Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact traffic path depends on the networking implementation and load balancer configuration.&lt;/p&gt;

&lt;p&gt;For example, an AWS Application Load Balancer configured with IP targets can forward traffic directly to Pod IP addresses.&lt;/p&gt;

&lt;p&gt;The Kubernetes Ingress resource itself is configuration. It does not directly forward packets.&lt;/p&gt;

&lt;p&gt;An Ingress Controller implements or configures infrastructure based on those routing rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does a Pod Have Its Own Kernel?
&lt;/h3&gt;

&lt;p&gt;A standard Linux container does not have its own independent operating system Kernel.&lt;/p&gt;

&lt;p&gt;Containers share the host's Kernel.&lt;/p&gt;

&lt;p&gt;Linux network namespaces allow containers or Pods to have isolated networking environments.&lt;/p&gt;

&lt;p&gt;A Pod typically has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network namespace&lt;/li&gt;
&lt;li&gt;Network interface&lt;/li&gt;
&lt;li&gt;IP address&lt;/li&gt;
&lt;li&gt;Routing information&lt;/li&gt;
&lt;li&gt;Access to the host Kernel's networking implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Containers within the same Pod normally share the Pod's network namespace.&lt;/p&gt;

&lt;p&gt;A Container Network Interface (CNI) implementation configures Pod networking.&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 plaintext"&gt;&lt;code&gt;KUBERNETES WORKER NODE
=================================

Pod A                 Pod B
Application           Application
Network Namespace     Network Namespace
Virtual Interface     Virtual Interface
      |                      |
      +----------+-----------+
                 |
         Host Linux Kernel
                 |
          CNI Data Plane
                 |
          Node Networking
                 |
            Network

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

&lt;/div&gt;



&lt;p&gt;Kubernetes does not invent TCP, UDP, IP, MAC addresses, or routing.&lt;/p&gt;

&lt;p&gt;It uses and extends existing networking mechanisms to provide communication between distributed applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  18. Why Is This Important for DevOps and SRE Engineers?
&lt;/h2&gt;

&lt;p&gt;Imagine that you are an SRE Engineer responsible for a production application.&lt;/p&gt;

&lt;p&gt;At 2 AM, you receive an alert:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Production application is unavailable.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Users cannot access the website.&lt;/p&gt;

&lt;p&gt;What should you do?&lt;/p&gt;

&lt;p&gt;A common mistake is to immediately restart the application or Kubernetes Pods without understanding where the problem is.&lt;/p&gt;

&lt;p&gt;But a production failure can occur anywhere along the communication path.&lt;/p&gt;

&lt;p&gt;The problem could be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DNS resolution&lt;/li&gt;
&lt;li&gt;Network interface failure&lt;/li&gt;
&lt;li&gt;Missing route&lt;/li&gt;
&lt;li&gt;Incorrect firewall configuration&lt;/li&gt;
&lt;li&gt;Failed TCP handshake&lt;/li&gt;
&lt;li&gt;TLS certificate error&lt;/li&gt;
&lt;li&gt;Load balancer configuration&lt;/li&gt;
&lt;li&gt;Kubernetes Service configuration&lt;/li&gt;
&lt;li&gt;Unhealthy backend&lt;/li&gt;
&lt;li&gt;Application failure&lt;/li&gt;
&lt;li&gt;Database connectivity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A DevOps or SRE Engineer should understand the request path and systematically isolate the failing component.&lt;/p&gt;




&lt;h2&gt;
  
  
  19. Troubleshooting by Networking Layer
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Potential problem&lt;/th&gt;
&lt;th&gt;Troubleshooting tools&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Physical&lt;/td&gt;
&lt;td&gt;Disconnected cable, link failure&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ethtool&lt;/code&gt;, &lt;code&gt;ip link&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data Link&lt;/td&gt;
&lt;td&gt;VLAN or ARP problems&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ip neigh&lt;/code&gt;, &lt;code&gt;tcpdump&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;Incorrect IP address, missing route&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ip addr&lt;/code&gt;, &lt;code&gt;ip route&lt;/code&gt;, &lt;code&gt;ping&lt;/code&gt;, &lt;code&gt;traceroute&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;Port unavailable, failed handshake&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ss&lt;/code&gt;, &lt;code&gt;nc&lt;/code&gt;, &lt;code&gt;tcpdump&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TLS&lt;/td&gt;
&lt;td&gt;Certificate or handshake failure&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;openssl&lt;/code&gt;, &lt;code&gt;curl -v&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application&lt;/td&gt;
&lt;td&gt;HTTP errors, application failure&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;curl&lt;/code&gt;, application logs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DNS&lt;/td&gt;
&lt;td&gt;Hostname resolution failure&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;dig&lt;/code&gt;, &lt;code&gt;getent&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These mappings are troubleshooting starting points rather than strict boundaries.&lt;/p&gt;

&lt;p&gt;For example, DNS is an application-layer protocol, but DNS problems can themselves be caused by lower-layer network failures.&lt;/p&gt;




&lt;h2&gt;
  
  
  20. Practical Troubleshooting Commands
&lt;/h2&gt;

&lt;p&gt;The following commands help engineers inspect how networking works inside an operating system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Network Interfaces
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays network interfaces and their link state.&lt;/p&gt;

&lt;p&gt;An interface being administratively UP does not always mean its physical connection is healthy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check IP Addresses
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip addr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays assigned IP addresses and network interfaces.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Routing Information
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip route
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays routing information and can help identify a missing or incorrect default route.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Neighbor Information
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip neigh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows IP-to-link-layer address mappings and neighbor states.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test DNS Resolution
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tests whether a DNS server can resolve a domain name.&lt;/p&gt;

&lt;p&gt;To test the operating system's normal hostname resolution path on Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;getent hosts example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Test IP Connectivity
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A successful ping indicates ICMP reachability.&lt;/p&gt;

&lt;p&gt;However, a failed ping does not necessarily mean the server is unavailable. ICMP traffic may be blocked.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test TCP Connectivity
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nc -vz example.com 443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This attempts to establish a TCP connection to the destination port.&lt;/p&gt;

&lt;p&gt;A successful connection does not prove that HTTPS or the application is working.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Listening Ports
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ss -lntp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows listening TCP sockets and, when permissions allow, their associated processes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Established TCP Connections
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss -tan state established
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows established TCP connections.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check UDP Sockets
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss -uan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Inspect TCP Sockets and Internal Information
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss -tin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can display TCP connection information, including details useful for investigating transport performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test TLS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl s_client \
  -connect example.com:443 \
  -servername example.com \
  -verify_hostname example.com \
  -verify_return_error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps investigate the HTTPS server's certificate and TLS handshake.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test HTTP and HTTPS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -v https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This provides useful information about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Destination address&lt;/li&gt;
&lt;li&gt;TCP connection&lt;/li&gt;
&lt;li&gt;TLS handshake&lt;/li&gt;
&lt;li&gt;HTTP request&lt;/li&gt;
&lt;li&gt;HTTP response&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Inspect Network Packets
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo tcpdump -i any -nn &lt;span class="s1"&gt;'tcp port 443'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This displays TCP traffic involving port 443.&lt;/p&gt;

&lt;p&gt;We can inspect TCP flags such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[S]   SYN
[S.]  SYN-ACK
[.]   ACK
[R]   RST
[F.]  FIN-ACK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packet captures should only be performed on environments that you are authorized to inspect.&lt;/p&gt;




&lt;h2&gt;
  
  
  21. Understanding Common Production Errors
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;th&gt;Possible meaning&lt;/th&gt;
&lt;th&gt;What to investigate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Could not resolve host&lt;/td&gt;
&lt;td&gt;DNS resolution failure&lt;/td&gt;
&lt;td&gt;DNS configuration, resolver, DNS records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No route to host&lt;/td&gt;
&lt;td&gt;Routing or reachability problem&lt;/td&gt;
&lt;td&gt;Routes, network interfaces, firewall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connection timed out&lt;/td&gt;
&lt;td&gt;Expected network response did not arrive&lt;/td&gt;
&lt;td&gt;Packet loss, routing, firewall, server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connection refused&lt;/td&gt;
&lt;td&gt;TCP connection was actively rejected&lt;/td&gt;
&lt;td&gt;Listening port, application, firewall reject&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connection reset&lt;/td&gt;
&lt;td&gt;Established or attempted connection was reset&lt;/td&gt;
&lt;td&gt;Application, peer, proxy, firewall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Certificate error&lt;/td&gt;
&lt;td&gt;TLS identity or trust verification problem&lt;/td&gt;
&lt;td&gt;Certificate chain, hostname, expiration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 400&lt;/td&gt;
&lt;td&gt;Request rejected as invalid&lt;/td&gt;
&lt;td&gt;Request format and parameters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 401&lt;/td&gt;
&lt;td&gt;Valid authentication credentials required&lt;/td&gt;
&lt;td&gt;Authentication configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 403&lt;/td&gt;
&lt;td&gt;Request is understood but refused&lt;/td&gt;
&lt;td&gt;Authorization, policies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 404&lt;/td&gt;
&lt;td&gt;Resource not found or not disclosed&lt;/td&gt;
&lt;td&gt;URL, routing, application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 500&lt;/td&gt;
&lt;td&gt;Unexpected server-side condition&lt;/td&gt;
&lt;td&gt;Application logs, dependencies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 502&lt;/td&gt;
&lt;td&gt;Gateway received an invalid upstream response&lt;/td&gt;
&lt;td&gt;Proxy, backend, upstream protocol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 503&lt;/td&gt;
&lt;td&gt;Service temporarily unavailable&lt;/td&gt;
&lt;td&gt;Backend health, capacity, maintenance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP 504&lt;/td&gt;
&lt;td&gt;Gateway did not receive a timely upstream response&lt;/td&gt;
&lt;td&gt;Backend latency, network, timeouts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An error message provides evidence about a failure, but it does not automatically identify its root cause.&lt;/p&gt;

&lt;p&gt;For example, an HTTP 503 response proves that some HTTP-speaking component responded. It does not prove that the intended backend received the request.&lt;/p&gt;




&lt;h2&gt;
  
  
  22. Real-World SRE Scenario: Application Is Unavailable
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Incident Description
&lt;/h3&gt;

&lt;p&gt;You are working as an SRE Engineer.&lt;/p&gt;

&lt;p&gt;A production website is unavailable, and users receive the following error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;504 Gateway Timeout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client
   |
  DNS
   |
Load Balancer
   |
Ingress / Reverse Proxy
   |
Backend Application
   |
Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Initial Troubleshooting
&lt;/h3&gt;

&lt;p&gt;First, confirm the symptom.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -v https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check whether DNS resolution works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check TCP connectivity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nc -vz example.com 443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check TLS and HTTP response information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -v https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the client receives an HTTP 504 response, we have evidence that it reached an HTTP-speaking gateway.&lt;/p&gt;

&lt;p&gt;Now investigate communication between the gateway and its upstream backend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kubernetes Troubleshooting
&lt;/h3&gt;

&lt;p&gt;If the application runs in Kubernetes:&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 nodes
kubectl get pods -n production -o wide
kubectl get svc -n production
kubectl get ingress -n production
kubectl get endpointslice -n production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Investigate application 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 deployment/backend \
  -n production \
  --tail=100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the backend 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 describe pod BACKEND_POD \
  -n production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From an authorized diagnostic container, test the internal Service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -v --max-time 10 \
  http://backend.production.svc.cluster.local:5001/health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Investigate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are healthy backend endpoints available?&lt;/li&gt;
&lt;li&gt;Is the backend listening on the correct port?&lt;/li&gt;
&lt;li&gt;Is the Kubernetes Service configured correctly?&lt;/li&gt;
&lt;li&gt;Are Network Policies blocking communication?&lt;/li&gt;
&lt;li&gt;Are requests taking longer than the configured timeout?&lt;/li&gt;
&lt;li&gt;Can the backend connect to its database?&lt;/li&gt;
&lt;li&gt;Is the backend experiencing CPU or memory pressure?&lt;/li&gt;
&lt;li&gt;Did a recent deployment introduce a problem?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The engineer should use evidence from each component to locate the failure.&lt;/p&gt;

&lt;p&gt;Restarting a Pod without understanding the problem may temporarily hide a symptom while leaving the root cause unresolved.&lt;/p&gt;




&lt;h2&gt;
  
  
  23. Real-World SRE Scenario: One Kubernetes Worker Node Is NotReady
&lt;/h2&gt;

&lt;p&gt;Imagine that a production Kubernetes cluster contains three worker nodes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME       STATUS

worker-1   Ready
worker-2   Ready
worker-3   NotReady
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Networking knowledge is essential here.&lt;/p&gt;

&lt;p&gt;Possible causes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical or virtual network interface failure&lt;/li&gt;
&lt;li&gt;Routing problems&lt;/li&gt;
&lt;li&gt;Firewall configuration&lt;/li&gt;
&lt;li&gt;Kubelet unable to reach the API server&lt;/li&gt;
&lt;li&gt;CNI failure&lt;/li&gt;
&lt;li&gt;Container runtime failure&lt;/li&gt;
&lt;li&gt;Resource pressure&lt;/li&gt;
&lt;li&gt;Operating system failure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start by collecting evidence:&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 nodes -o wide
kubectl describe node worker-3
kubectl get pods -A -o wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have authorized access to the affected Linux worker node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip link
ip addr
ip route
ip neigh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check system services:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo journalctl -u kubelet -n 100
sudo journalctl -u containerd -n 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
free -h
df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>JumpToTech — DevOps &amp; SRE Engineering Production Incident Lab #01 Kubernetes Worker Node Failure — Node NotReady</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Mon, 30 Nov 2026 13:54:12 +0000</pubDate>
      <link>https://dev.to/jumptotech/jumptotech-devops-sre-engineering-production-incident-lab-01-kubernetes-worker-node-failure-41k</link>
      <guid>https://dev.to/jumptotech/jumptotech-devops-sre-engineering-production-incident-lab-01-kubernetes-worker-node-failure-41k</guid>
      <description>&lt;p&gt;&lt;strong&gt;Duration:&lt;/strong&gt; 4 hours&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Level:&lt;/strong&gt; Intermediate&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Environment:&lt;/strong&gt; Simulated On-Premises Kubernetes&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; DevOps Engineer / Site Reliability Engineer&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Tools:&lt;/strong&gt; Docker, Kind, Kubernetes, Linux, NGINX, curl&lt;/p&gt;


&lt;h1&gt;
  
  
  1. Production Incident Scenario
&lt;/h1&gt;

&lt;p&gt;Вы работаете DevOps/SRE Engineer в компании, которая поддерживает production application, запущенное в Kubernetes Cluster.&lt;/p&gt;

&lt;p&gt;Архитектура компании:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 Control Plane&lt;/li&gt;
&lt;li&gt;3 Worker Nodes&lt;/li&gt;
&lt;li&gt;3 Application Replicas&lt;/li&gt;
&lt;li&gt;Kubernetes Service&lt;/li&gt;
&lt;li&gt;Container Runtime — containerd&lt;/li&gt;
&lt;li&gt;Kubernetes Node Agent — Kubelet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Приложение должно оставаться доступным для клиентов даже при отказе одного Worker Node.&lt;/p&gt;

&lt;p&gt;В течение рабочего дня monitoring system обнаруживает проблему и отправляет alert команде Operations.&lt;/p&gt;
&lt;h2&gt;
  
  
  Incident Ticket — INC-001
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Incident ID&lt;/td&gt;
&lt;td&gt;INC-001&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Environment&lt;/td&gt;
&lt;td&gt;Production Simulation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alert&lt;/td&gt;
&lt;td&gt;Kubernetes Worker Node NotReady&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Affected Component&lt;/td&gt;
&lt;td&gt;Worker Node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customer Impact&lt;/td&gt;
&lt;td&gt;Unknown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root Cause&lt;/td&gt;
&lt;td&gt;Unknown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Assigned Team&lt;/td&gt;
&lt;td&gt;DevOps / SRE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Status&lt;/td&gt;
&lt;td&gt;Open&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Priority&lt;/td&gt;
&lt;td&gt;Pending impact assessment&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Incident Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the three Kubernetes worker nodes stopped responding to the Kubernetes Control Plane. The monitoring system generated a NodeNotReady alert. The root cause and customer impact are currently unknown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your responsibility:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Investigate the incident, identify the affected components, determine customer impact, collect evidence, identify the root cause, restore the system and verify recovery.&lt;/p&gt;


&lt;h1&gt;
  
  
  2. DevOps/SRE Engineer Responsibilities
&lt;/h1&gt;

&lt;p&gt;В реальной компании DevOps/SRE Engineer отвечает не только за deployment приложения.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Доставка приложения в нужное окружение&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Availability&lt;/td&gt;
&lt;td&gt;Обеспечение доступности приложения&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reliability&lt;/td&gt;
&lt;td&gt;Обеспечение стабильной работы системы&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;Защита инфраструктуры и коммуникации&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Observability&lt;/td&gt;
&lt;td&gt;Понимание состояния системы&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Troubleshooting&lt;/td&gt;
&lt;td&gt;Поиск и устранение проблем&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Incident Response&lt;/td&gt;
&lt;td&gt;Реагирование на инциденты&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automation&lt;/td&gt;
&lt;td&gt;Автоматизация повторяющихся процессов&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change Management&lt;/td&gt;
&lt;td&gt;Безопасное выполнение изменений&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prevention&lt;/td&gt;
&lt;td&gt;Предотвращение повторных инцидентов&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Сегодня основное внимание уделяется Troubleshooting, Availability, Reliability и Incident Response.&lt;/p&gt;


&lt;h1&gt;
  
  
  3. What Is Troubleshooting?
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting is a systematic process of identifying, investigating, isolating and resolving problems based on evidence.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Troubleshooting — это систематический процесс выявления, расследования, локализации и устранения проблемы на основании доказательств.&lt;/p&gt;

&lt;p&gt;Troubleshooting не означает выполнение случайных команд.&lt;/p&gt;

&lt;p&gt;Каждая команда должна иметь конкретную цель и отвечать на конкретный вопрос.&lt;/p&gt;
&lt;h2&gt;
  
  
  Troubleshooting Workflow
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Understand the system — понять архитектуру.&lt;/li&gt;
&lt;li&gt;Identify the symptoms — определить симптомы.&lt;/li&gt;
&lt;li&gt;Assess customer impact — определить влияние на клиентов.&lt;/li&gt;
&lt;li&gt;Collect evidence — собрать доказательства.&lt;/li&gt;
&lt;li&gt;Form a hypothesis — выдвинуть предположение.&lt;/li&gt;
&lt;li&gt;Test the hypothesis — проверить предположение.&lt;/li&gt;
&lt;li&gt;Isolate the problem — локализовать проблему.&lt;/li&gt;
&lt;li&gt;Mitigate and resolve — уменьшить влияние и устранить проблему.&lt;/li&gt;
&lt;li&gt;Verify recovery — проверить восстановление.&lt;/li&gt;
&lt;li&gt;Prevent recurrence — предотвратить повторение.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Do not restart, delete or modify production resources without understanding the problem and potential impact.&lt;/p&gt;


&lt;h1&gt;
  
  
  4. Laboratory Architecture
&lt;/h1&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 Kubernetes Control Plane
                ┌────────────────────────┐
                │ API Server             │
                │ Scheduler              │
                │ Controller Manager     │
                │ etcd                   │
                └───────────┬────────────┘
                            │
               Node Management / Heartbeat
                            │
          ┌─────────────────┼─────────────────┐
          │                 │                 │
    ┌─────▼──────┐    ┌─────▼──────┐    ┌─────▼──────┐
    │ Worker 1   │    │ Worker 2   │    │ Worker 3   │
    │            │    │            │    │            │
    │ Kubelet    │    │ Kubelet    │    │ Kubelet    │
    │ containerd │    │ containerd │    │ containerd │
    │ NGINX Pod  │    │ NGINX Pod  │    │ NGINX Pod  │
    └────────────┘    └────────────┘    └────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Application Communication
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client
   │
   ▼
NodePort Service
   │
   ├──────► Application Pod 1
   ├──────► Application Pod 2
   └──────► Application Pod 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Control Plane управляет Kubernetes Cluster, но пользовательский HTTP traffic не должен проходить через API Server для обычной коммуникации с приложением.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Kind?
&lt;/h2&gt;

&lt;p&gt;Kind stands for Kubernetes in Docker.&lt;/p&gt;

&lt;p&gt;Kind позволяет создавать Kubernetes Clusters, используя Docker containers в качестве Kubernetes Nodes.&lt;/p&gt;

&lt;p&gt;В нашей лабораторной работе каждый Node будет отдельным Docker container, внутри которого работают Linux, kubelet и containerd.&lt;/p&gt;

&lt;p&gt;Это симуляция on-premises infrastructure. Все Nodes физически находятся на одном компьютере, поэтому это не настоящая production High Availability architecture.&lt;/p&gt;


&lt;h1&gt;
  
  
  PHASE 1 — Environment Preparation
&lt;/h1&gt;
&lt;h1&gt;
  
  
  Step 1. Verify Required Tools
&lt;/h1&gt;

&lt;p&gt;Выполните:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker version
&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;kind version
&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;kubectl version --client
&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;docker info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Перед созданием infrastructure инженер должен убедиться, что необходимые инструменты установлены и доступны.&lt;/p&gt;

&lt;p&gt;Мы проверяем:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker Engine&lt;/li&gt;
&lt;li&gt;Kind&lt;/li&gt;
&lt;li&gt;Kubernetes CLI&lt;/li&gt;
&lt;li&gt;Docker connectivity&lt;/li&gt;
&lt;li&gt;Available computing resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Если Docker не запущен, Kind не сможет создать Kubernetes Cluster.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2. Check Available Resources
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker info --format &lt;span class="s1"&gt;'CPUs={{.NCPU}} MemoryBytes={{.MemTotal}}'&lt;/span&gt;
&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;docker stats --no-stream
&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;kind get clusters
&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;docker ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Создание Kubernetes Cluster требует CPU, Memory и Disk Space.&lt;/p&gt;

&lt;p&gt;Если на компьютере уже существуют другие Kubernetes Clusters, Docker containers или applications, может возникнуть resource pressure.&lt;/p&gt;

&lt;p&gt;Это называется Capacity Planning.&lt;/p&gt;

&lt;p&gt;Не удаляйте существующие clusters без разрешения преподавателя.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3. Verify Kubernetes Context
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl config current-context
&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;kubectl config get-contexts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What is Kubernetes Context?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Context определяет, с каким Kubernetes Cluster, пользователем и namespace работает kubectl.&lt;/p&gt;

&lt;p&gt;Один инженер может иметь доступ к нескольким environments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Development
Staging
Production
Local Kubernetes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why is this important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Если инженер случайно выполнит destructive command в production вместо local environment, это может привести к production outage.&lt;/p&gt;

&lt;p&gt;Во время всей лабораторной работы мы будем явно указывать:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;--context kind-node-incident
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Это уменьшает риск выполнения команд в неправильном Kubernetes Cluster.&lt;/p&gt;




&lt;h1&gt;
  
  
  PHASE 2 — Infrastructure Provisioning
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 4. Create Working Directory
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p ~/jumptotech-node-incident
&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;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/jumptotech-node-incident
&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;mkdir -p evidence
&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;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Мы создаём отдельную рабочую директорию для:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Infrastructure configuration&lt;/li&gt;
&lt;li&gt;Kubernetes manifests&lt;/li&gt;
&lt;li&gt;Incident evidence&lt;/li&gt;
&lt;li&gt;Troubleshooting results&lt;/li&gt;
&lt;li&gt;Incident documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;В реальной компании конфигурации обычно хранятся в Git repository, а результаты расследования — в incident management system.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 5. Create Kubernetes Cluster Configuration
&lt;/h1&gt;

&lt;p&gt;Создайте файл:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; kind-config.yaml &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'EOF'&lt;/span&gt;
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4

nodes:
  - role: control-plane

  - role: worker

  - role: worker

  - role: worker
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Проверьте содержимое:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat kind-config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration Explanation
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;kind&lt;/td&gt;
&lt;td&gt;Тип конфигурационного объекта&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;apiVersion&lt;/td&gt;
&lt;td&gt;Версия Kind configuration API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nodes&lt;/td&gt;
&lt;td&gt;Список Kubernetes Nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;control-plane&lt;/td&gt;
&lt;td&gt;Node, управляющий кластером&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;worker&lt;/td&gt;
&lt;td&gt;Node для запуска workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Мы используем declarative configuration.&lt;/p&gt;

&lt;p&gt;Вместо ручного создания каждого сервера мы описываем desired state нашей infrastructure.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 6. Provision Kubernetes Cluster
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kind create cluster \
  --name node-incident \
  --config kind-config.yaml \
  --wait 5m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Creating cluster "node-incident" ...
 ✓ Ensuring node image
 ✓ Preparing nodes
 ✓ Writing configuration
 ✓ Starting control-plane
 ✓ Installing CNI
 ✓ Installing StorageClass
 ✓ Joining worker nodes

Set kubectl context to "kind-node-incident"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Фактический вывод может отличаться в зависимости от версии Kind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens behind the scenes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kind выполняет следующие действия:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Подготавливает Kubernetes Node image.&lt;/li&gt;
&lt;li&gt;Создаёт Docker containers.&lt;/li&gt;
&lt;li&gt;Инициализирует Kubernetes Control Plane.&lt;/li&gt;
&lt;li&gt;Настраивает networking.&lt;/li&gt;
&lt;li&gt;Подключает Worker Nodes к Control Plane.&lt;/li&gt;
&lt;li&gt;Настраивает kubeconfig.&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Step 7. Verify Kubernetes Nodes
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl --context kind-node-incident get nodes -o wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                          STATUS   ROLES
node-incident-control-plane   Ready    control-plane
node-incident-worker          Ready    &amp;lt;none&amp;gt;
node-incident-worker2         Ready    &amp;lt;none&amp;gt;
node-incident-worker3         Ready    &amp;lt;none&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What should we understand?
&lt;/h2&gt;

&lt;p&gt;У нас четыре Kubernetes Nodes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 Control Plane&lt;/li&gt;
&lt;li&gt;3 Worker Nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Worker Nodes могут отображать ROLES как &lt;code&gt;&amp;lt;none&amp;gt;&lt;/code&gt;. Это не означает, что Node неисправен.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interview Question
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Are Kubernetes Nodes namespaced resources?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Nodes are cluster-scoped resources.&lt;/p&gt;

&lt;p&gt;Поэтому команда:&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 nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;не требует указания namespace.&lt;/p&gt;

&lt;p&gt;Pods, Deployments и Services, в отличие от Nodes, являются namespaced resources.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 8. Verify Underlying Infrastructure
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker ps --filter &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;node-incident
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Result:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node-incident-control-plane
node-incident-worker
node-incident-worker2
node-incident-worker3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes показывает логическое состояние Nodes.&lt;/p&gt;

&lt;p&gt;Docker показывает состояние инфраструктуры, на которой в нашей лабораторной работе работают Kubernetes Nodes.&lt;/p&gt;

&lt;p&gt;В реальном production это могли бы быть:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical Servers&lt;/li&gt;
&lt;li&gt;VMware Virtual Machines&lt;/li&gt;
&lt;li&gt;AWS EC2 Instances&lt;/li&gt;
&lt;li&gt;Azure Virtual Machines&lt;/li&gt;
&lt;li&gt;Google Compute Engine Instances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Инженер должен уметь расследовать проблему не только на Kubernetes level, но и на infrastructure level.&lt;/p&gt;




&lt;h1&gt;
  
  
  PHASE 3 — Understand Worker Node Components
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 9. Access Worker Node
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; -it node-incident-worker3 bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Внутри Worker Node выполните:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hostname
&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;whoami
&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;uname -a
&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;cat /etc/os-release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Мы подключаемся непосредственно к операционной системе Worker Node.&lt;/p&gt;

&lt;p&gt;В реальном on-premises environment для этого может использоваться SSH или management console.&lt;/p&gt;

&lt;p&gt;В Kind используется docker exec.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 10. Check Kubelet
&lt;/h1&gt;

&lt;p&gt;Внутри Worker Node:&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 kubelet --no-pager
&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;systemctl is-active kubelet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;active
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is Kubelet?
&lt;/h2&gt;

&lt;p&gt;Kubelet is a Kubernetes agent running on each node.&lt;/p&gt;

&lt;p&gt;Kubelet выполняет следующие функции:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communicates with Kubernetes API Server.&lt;/li&gt;
&lt;li&gt;Receives assigned Pod specifications.&lt;/li&gt;
&lt;li&gt;Manages Pod lifecycle through the container runtime.&lt;/li&gt;
&lt;li&gt;Executes health probes.&lt;/li&gt;
&lt;li&gt;Reports Node and Pod status.&lt;/li&gt;
&lt;li&gt;Renews Node Lease.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;API Server
    │
    ▼
Kubelet
    │
    ▼
Container Runtime
    │
    ▼
Application Containers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we checking kubelet?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Если kubelet перестаёт работать, Control Plane может потерять актуальную информацию о состоянии Node.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 11. Check Container Runtime
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status containerd --no-pager
&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;systemctl is-active containerd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;active
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Дополнительно:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crictl ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is containerd?
&lt;/h2&gt;

&lt;p&gt;containerd — это container runtime, который управляет жизненным циклом containers.&lt;/p&gt;

&lt;p&gt;Kubelet взаимодействует с container runtime через CRI — Container Runtime Interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interview Question:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What is the difference between kubelet and containerd?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubelet manages Kubernetes workloads on a node. Containerd manages the actual containers.&lt;/p&gt;

&lt;p&gt;Это разные компоненты. Один компонент может работать, когда другой недоступен.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 12. Check Linux System Health
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free -h
&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;df -h
&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;uptime
&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;ip addr
&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;ip route
&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;ps aux &lt;span class="o"&gt;|&lt;/span&gt; grep &lt;span class="s1"&gt;'[k]ubelet'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;free -h&lt;/td&gt;
&lt;td&gt;Проверка памяти&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;df -h&lt;/td&gt;
&lt;td&gt;Проверка дискового пространства&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uptime&lt;/td&gt;
&lt;td&gt;Проверка uptime и load average&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ip addr&lt;/td&gt;
&lt;td&gt;Проверка network interfaces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ip route&lt;/td&gt;
&lt;td&gt;Проверка routing table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ps aux&lt;/td&gt;
&lt;td&gt;Проверка процессов&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes работает поверх операционной системы.&lt;/p&gt;

&lt;p&gt;Если существуют проблемы на Linux level, они могут влиять на Kubernetes и application workloads.&lt;/p&gt;

&lt;p&gt;В Kind некоторые показатели отражают общие ресурсы Docker VM, а не отдельного физического сервера.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 13. Check Kubelet Logs
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl -u kubelet -n 30 --no-pager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is journalctl?
&lt;/h2&gt;

&lt;p&gt;journalctl позволяет просматривать systemd journal, включая logs системных сервисов.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why are logs important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Logs помогают определить:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Когда возникла проблема.&lt;/li&gt;
&lt;li&gt;Какие ошибки произошли.&lt;/li&gt;
&lt;li&gt;Какой компонент сообщил об ошибке.&lt;/li&gt;
&lt;li&gt;Были ли проблемы с network, certificates или container runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Выйдите из Worker Node:&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;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  PHASE 4 — Application Deployment
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Step 14. Create Production Namespace
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl --context kind-node-incident \
  create namespace production
&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;kubectl --context kind-node-incident get namespaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Namespaces позволяют логически разделять Kubernetes resources.&lt;/p&gt;

&lt;p&gt;В этой лабораторной работе namespace production симулирует production environment.&lt;/p&gt;

&lt;p&gt;Это не настоящий production cluster.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 15. Create Application Deployment
&lt;/h1&gt;

&lt;p&gt;Создайте файл deployment.yaml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; deployment.yaml &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'EOF'&lt;/span&gt;
apiVersion: apps/v1
kind: Deployment

metadata:
  name: web-app
  namespace: production

spec:
  replicas: 3

  selector:
    matchLabels:
      app: web-app

  template:
    metadata:
      labels:
        app: web-app

    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app: web-app
              topologyKey: kubernetes.io/hostname

      containers:
        - name: nginx
          image: nginx:alpine

          ports:
            - containerPort: 80

          resources:
            requests:
              cpu: 50m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi

          readinessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 3
            periodSeconds: 5

          livenessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 10
EOF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deployment Configuration Explanation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Replicas
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Мы хотим поддерживать три экземпляра приложения.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Requests
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;50m&lt;/span&gt;
  &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;64Mi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Requests используются Scheduler при принятии решения о размещении Pod.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Limits
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;200m&lt;/span&gt;
  &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;128Mi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Limits ограничивают использование ресурсов container.&lt;/p&gt;

&lt;p&gt;CPU limit может приводить к CPU throttling. Превышение memory limit может приводить к OOM termination.&lt;/p&gt;

&lt;h3&gt;
  
  
  Readiness Probe
&lt;/h3&gt;

&lt;p&gt;Readiness Probe определяет, готов ли Pod принимать traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Liveness Probe
&lt;/h3&gt;

&lt;p&gt;Liveness Probe проверяет, необходимо ли перезапустить container из-за нарушения его работоспособности.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pod Anti-Affinity
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;podAntiAffinity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;requiredDuringSchedulingIgnoredDuringExecution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Эта конфигурация запрещает Scheduler размещать несколько соответствующих Pods приложения на одном Node.&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="na"&gt;topologyKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kubernetes.io/hostname&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Распределение выполняется по hostname Kubernetes Nodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need Pod Anti-Affinity?
&lt;/h2&gt;

&lt;p&gt;Without distribution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Worker 1: Pod 1, Pod 2, Pod 3
Worker 2: Empty
Worker 3: Empty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Если Worker 1 перестанет работать, все три реплики будут затронуты.&lt;/p&gt;

&lt;p&gt;With distribution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Worker 1: Pod 1
Worker 2: Pod 2
Worker 3: Pod 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Если Worker 3 перестанет работать, две другие реплики могут продолжить обслуживать клиентов.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Having multiple replicas does not automatically guarantee High Availability.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 16. Deploy Application
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl --context kind-node-incident \
  apply -f deployment.yaml
&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;kubectl --context kind-node-incident \
  rollout status deployment/web-app \
  -n production --timeout=180s
&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;kubectl --context kind-node-incident \
  get deployments -n production
&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;kubectl --context kind-node-incident \
  get pods -n production -o wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME             READY   STATUS    NODE
web-app-xxx-a    1/1     Running   node-incident-worker
web-app-xxx-b    1/1     Running   node-incident-worker2
web-app-xxx-c    1/1     Running   node-incident-worker3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pod names will be different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verification Requirement:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Убедитесь, что все три Pods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running&lt;/li&gt;
&lt;li&gt;Ready&lt;/li&gt;
&lt;li&gt;Distributed across three different Worker Nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Не переходите к следующему шагу, пока application deployment не завершён успешно.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 17. Create Kubernetes Service
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; service.yaml &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'EOF'&lt;/span&gt;
apiVersion: v1
kind: Service

metadata:
  name: web-service
  namespace: production

spec:
  type: NodePort

  selector:
    app: web-app

  ports:
    - port: 80
      targetPort: 80
      nodePort: 30080
EOF
&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;kubectl --context kind-node-incident \
  apply -f service.yaml
&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;kubectl --context kind-node-incident \
  get services -n production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is Kubernetes Service?
&lt;/h2&gt;

&lt;p&gt;Service предоставляет стабильную сетевую точку доступа к группе Pods.&lt;/p&gt;

&lt;p&gt;Pods могут пересоздаваться, получать новые IP addresses и перемещаться между Nodes.&lt;/p&gt;

&lt;p&gt;Service позволяет клиенту обращаться к приложению без необходимости знать IP каждого Pod.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;port: 80&lt;/td&gt;
&lt;td&gt;Service port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;targetPort: 80&lt;/td&gt;
&lt;td&gt;Application container port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;nodePort: 30080&lt;/td&gt;
&lt;td&gt;Port exposed on Kubernetes Nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;selector&lt;/td&gt;
&lt;td&gt;Определяет соответствующие Pods&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Step 18. Verify Service Endpoints
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl --context kind-node-incident \
  get endpointslices -n production
&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;kubectl --context kind-node-incident \
  get endpointslices -n production \
  -l kubernetes.io/service-name=web-service \
  -o yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Найдите:&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="na"&gt;conditions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Наличие Service не гарантирует, что у него существуют доступные application endpoints.&lt;/p&gt;

&lt;p&gt;EndpointSlices позволяют проверить, какие Pods связаны с Service и какие из них готовы принимать traffic.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 19. Verify HTTP Communication
&lt;/h1&gt;

&lt;p&gt;Получите IP первого Worker Node:&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="nv"&gt;HEALTHY_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;docker inspect \
  -f &lt;span class="s1"&gt;'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'&lt;/span&gt; \
  node-incident-worker&lt;span class="o"&gt;)&lt;/span&gt;
&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;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"$HEALTHY_IP"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Отправьте HTTP request из Control Plane container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; node-incident-control-plane \
  curl -i --max-time 5 \
  &lt;span class="s2"&gt;"http://${HEALTHY_IP}:30080/"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Running Pods не являются достаточным доказательством того, что application доступен.&lt;/p&gt;

&lt;p&gt;Мы должны проверить реальную коммуникацию между клиентом и приложением.&lt;/p&gt;

&lt;p&gt;В этом тесте Control Plane container используется только как test client. Пользовательский запрос не&lt;/p&gt;

</description>
      <category>devops</category>
      <category>infrastructure</category>
      <category>kubernetes</category>
      <category>sre</category>
    </item>
    <item>
      <title>JumpToTech Digital Banking Production-Grade DevOps, DevSecOps, SRE, Kubernetes and GitOps Engineering Lab</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Tue, 10 Nov 2026 14:57:05 +0000</pubDate>
      <link>https://dev.to/jumptotech/jumptotech-digital-banking-production-grade-devops-devsecops-sre-kubernetes-and-gitops-ah3</link>
      <guid>https://dev.to/jumptotech/jumptotech-digital-banking-production-grade-devops-devsecops-sre-kubernetes-and-gitops-ah3</guid>
      <description>&lt;p&gt;AWS + Kubernetes&lt;/p&gt;

&lt;p&gt;Project: JumpToTech Digital Banking Platform\&lt;br&gt;
Industry: Financial Services / Digital Banking\&lt;br&gt;
Primary role: DevOps / Cloud / Platform Engineer\&lt;br&gt;
Supporting roles: SRE, Backend, Frontend, DBA, Security, QA, Network and Compliance\&lt;br&gt;
Architecture: AWS, Java Spring Boot, React, PostgreSQL, Docker, Amazon ECR, Amazon EKS, Terraform, Helm, Argo CD, Prometheus and Grafana&lt;/p&gt;

&lt;p&gt;This lab will take students from a developer's source code to a production-style banking platform, including infrastructure provisioning, secure CI/CD, Kubernetes deployments, database connectivity, monitoring, incident response and disaster recovery.&lt;/p&gt;

&lt;p&gt;It will also teach students how to explain their engineering decisions during real DevOps and SRE interviews.&lt;/p&gt;

&lt;p&gt;Important distinction: We have already built and tested significant portions of the banking application and CI pipeline. The full EKS, GitOps, Aurora, security and observability architecture below is the target implementation for the extended lab, not a claim that every component has already been deployed. The application is a simulated banking system using fictional accounts and transactions, not a regulated production bank.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Executive project overview
&lt;/h2&gt;

&lt;p&gt;Imagine you have joined a financial technology company as a DevOps Engineer.&lt;/p&gt;

&lt;p&gt;The company is launching a new digital banking application that allows customers to authenticate securely, view their accounts, transfer money between eligible accounts, review transaction histories and manage administrative operations.&lt;/p&gt;

&lt;p&gt;The backend developers have implemented the banking business logic using Java and Spring Boot. Frontend developers have built a React application. Your responsibility is to establish the infrastructure and delivery platform that allows the application to operate reliably, securely and continuously.&lt;/p&gt;

&lt;p&gt;The business requirements are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking transactions must not be lost or processed twice.&lt;/li&gt;
&lt;li&gt;Application changes must be tested and security-scanned before deployment.&lt;/li&gt;
&lt;li&gt;Production workloads must be resilient to individual Pod and node failures.&lt;/li&gt;
&lt;li&gt;Database access must be restricted to authorized application components.&lt;/li&gt;
&lt;li&gt;Every deployment must be traceable and reversible.&lt;/li&gt;
&lt;li&gt;Critical incidents must generate actionable alerts.&lt;/li&gt;
&lt;li&gt;The system must support auditing, backup, recovery and access control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A production banking platform also requires formal threat modeling, risk assessments, compliance controls and operational approvals. This lab demonstrates engineering patterns but does not by itself establish PCI DSS, SOC 2 or other regulatory compliance.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. End-to-end production architecture
&lt;/h2&gt;

&lt;p&gt;Reference AWS banking architecture&lt;/p&gt;

&lt;p&gt;Banking customers&lt;/p&gt;

&lt;p&gt;Web browser / HTTPS&lt;/p&gt;

&lt;p&gt;Route 53 → CloudFront → AWS WAF&lt;/p&gt;

&lt;p&gt;DNS, TLS, CDN, edge protection&lt;/p&gt;

&lt;p&gt;Application Load Balancer&lt;/p&gt;

&lt;p&gt;HTTPS listener / Kubernetes Ingress rules&lt;/p&gt;

&lt;p&gt;Frontend&lt;/p&gt;

&lt;p&gt;Nginx + React&lt;/p&gt;

&lt;p&gt;Deployment → ClusterIP Service&lt;/p&gt;

&lt;p&gt;Banking API&lt;/p&gt;

&lt;p&gt;Spring Boot / Java 21&lt;/p&gt;

&lt;p&gt;Deployment → ClusterIP Service&lt;/p&gt;

&lt;p&gt;Private database tier&lt;/p&gt;

&lt;p&gt;Amazon Aurora PostgreSQL or Amazon RDS PostgreSQL&lt;/p&gt;

&lt;p&gt;Multi-AZ · Encryption · Backups · Restricted Security Groups&lt;/p&gt;

&lt;p&gt;Platform operations&lt;/p&gt;

&lt;p&gt;EKS · Helm · Argo CD · ECR · Terraform&lt;/p&gt;

&lt;p&gt;Security and SRE&lt;/p&gt;

&lt;p&gt;IAM · Secrets · NetworkPolicy · Prometheus · Grafana&lt;/p&gt;

&lt;p&gt;The architecture has two separate paths:&lt;/p&gt;

&lt;p&gt;Application traffic: Customer → HTTPS → load balancer → Kubernetes Service → healthy application Pod → database.&lt;/p&gt;

&lt;p&gt;Software delivery: Developer → GitHub → CI → ECR → GitOps repository → Argo CD → Helm → EKS.&lt;/p&gt;

&lt;p&gt;Students must understand both paths. A successful CI pipeline does not necessarily mean a successful deployment, and a running Pod does not necessarily mean the banking application is healthy.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. The engineering team: who does what?
&lt;/h2&gt;

&lt;p&gt;A DevOps Engineer does not develop and operate a banking platform alone. The project requires a cross-functional team with clearly defined ownership.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Team member&lt;/th&gt;
&lt;th&gt;Primary responsibility&lt;/th&gt;
&lt;th&gt;DevOps collaboration&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product Manager&lt;/td&gt;
&lt;td&gt;Business requirements and release priorities&lt;/td&gt;
&lt;td&gt;Release readiness&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Solution Architect&lt;/td&gt;
&lt;td&gt;System architecture and nonfunctional requirements&lt;/td&gt;
&lt;td&gt;AWS and EKS design&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend Engineer&lt;/td&gt;
&lt;td&gt;Banking APIs, transfers, ledger, authentication&lt;/td&gt;
&lt;td&gt;Docker, database, runtime configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend Engineer&lt;/td&gt;
&lt;td&gt;Customer portal and API integration&lt;/td&gt;
&lt;td&gt;Build pipeline, CDN, ingress&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DevOps / Platform Engineer&lt;/td&gt;
&lt;td&gt;Infrastructure, CI/CD, GitOps, Kubernetes&lt;/td&gt;
&lt;td&gt;All engineering teams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SRE&lt;/td&gt;
&lt;td&gt;Reliability, SLOs, incidents, capacity&lt;/td&gt;
&lt;td&gt;Monitoring, scaling, recovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DBA&lt;/td&gt;
&lt;td&gt;PostgreSQL performance, schema, backup, replication&lt;/td&gt;
&lt;td&gt;RDS/Aurora, migrations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security Engineer&lt;/td&gt;
&lt;td&gt;IAM, threat modeling, vulnerability management&lt;/td&gt;
&lt;td&gt;OIDC, RBAC, scanning, secrets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;QA Engineer&lt;/td&gt;
&lt;td&gt;Automated and integration testing&lt;/td&gt;
&lt;td&gt;CI quality gates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network Engineer&lt;/td&gt;
&lt;td&gt;VPC, DNS, connectivity, firewalls&lt;/td&gt;
&lt;td&gt;Ingress, routing, network isolation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compliance / Risk&lt;/td&gt;
&lt;td&gt;Audit evidence, control requirements, approvals&lt;/td&gt;
&lt;td&gt;Traceability and evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Incident Commander&lt;/td&gt;
&lt;td&gt;Coordinates major incidents&lt;/td&gt;
&lt;td&gt;Escalation and recovery&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  What does the DevOps Engineer actually own?
&lt;/h3&gt;

&lt;p&gt;A typical DevOps Engineer on this project would:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provision AWS infrastructure using Terraform.&lt;/li&gt;
&lt;li&gt;Build secure Docker images and maintain build pipelines.&lt;/li&gt;
&lt;li&gt;Configure GitHub Actions CI and ECR publishing.&lt;/li&gt;
&lt;li&gt;Set up AWS IAM roles and GitHub OIDC authentication.&lt;/li&gt;
&lt;li&gt;Provision and operate the EKS platform with the platform team.&lt;/li&gt;
&lt;li&gt;Package Kubernetes workloads using Helm.&lt;/li&gt;
&lt;li&gt;Configure Argo CD for GitOps-based deployments.&lt;/li&gt;
&lt;li&gt;Implement ingress, service routing, network policies and Kubernetes RBAC.&lt;/li&gt;
&lt;li&gt;Integrate secrets, metrics, logging and alerting.&lt;/li&gt;
&lt;li&gt;Support application teams during releases, outages and performance investigations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The DevOps Engineer collaborates with the DBA on database connectivity and migrations, with Security on least-privilege access, and with SRE on operational readiness. Database transaction correctness remains primarily a backend and database engineering responsibility.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. What we have already implemented
&lt;/h2&gt;

&lt;p&gt;The current JumpToTech Digital Banking project includes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Current evidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GitHub repository&lt;/td&gt;
&lt;td&gt;Created and connected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Java Spring Boot backend&lt;/td&gt;
&lt;td&gt;Implemented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;React frontend&lt;/td&gt;
&lt;td&gt;Implemented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL integration tests&lt;/td&gt;
&lt;td&gt;Passing in GitHub Actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend tests&lt;/td&gt;
&lt;td&gt;13 passing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trivy dependency scanning&lt;/td&gt;
&lt;td&gt;Passing in latest shared CI run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dockerfiles&lt;/td&gt;
&lt;td&gt;Verified by ECR workflow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS ECR repositories&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub OIDC integration&lt;/td&gt;
&lt;td&gt;Configured; trust-policy mismatch diagnosed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ECR image publishing&lt;/td&gt;
&lt;td&gt;Not yet confirmed successful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terraform-managed EKS&lt;/td&gt;
&lt;td&gt;Planned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Helm and Argo CD deployment&lt;/td&gt;
&lt;td&gt;Planned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RDS/Aurora production database&lt;/td&gt;
&lt;td&gt;Planned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production observability and security controls&lt;/td&gt;
&lt;td&gt;Planned&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The latest shared CI run succeeded for commit &lt;code&gt;96da899&lt;/code&gt;. This establishes a useful foundation, but it is only the first part of the production delivery lifecycle.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Phase 1 — AWS infrastructure and networking
&lt;/h2&gt;

&lt;p&gt;Before deploying Kubernetes, students must understand the AWS infrastructure supporting the banking application.&lt;/p&gt;
&lt;h3&gt;
  
  
  5.1 Production-style VPC design
&lt;/h3&gt;

&lt;p&gt;VPC: 10.20.0.0/16 — three Availability Zones&lt;/p&gt;

&lt;p&gt;AZ A&lt;/p&gt;

&lt;p&gt;Public&lt;/p&gt;

&lt;p&gt;ALB / NAT&lt;/p&gt;

&lt;p&gt;Private app&lt;/p&gt;

&lt;p&gt;EKS nodes&lt;/p&gt;

&lt;p&gt;Isolated DB&lt;/p&gt;

&lt;p&gt;RDS / Aurora&lt;/p&gt;

&lt;p&gt;AZ B&lt;/p&gt;

&lt;p&gt;Public&lt;/p&gt;

&lt;p&gt;ALB / NAT&lt;/p&gt;

&lt;p&gt;Private app&lt;/p&gt;

&lt;p&gt;EKS nodes&lt;/p&gt;

&lt;p&gt;Isolated DB&lt;/p&gt;

&lt;p&gt;RDS / Aurora&lt;/p&gt;

&lt;p&gt;AZ C&lt;/p&gt;

&lt;p&gt;Public&lt;/p&gt;

&lt;p&gt;ALB / NAT&lt;/p&gt;

&lt;p&gt;Private app&lt;/p&gt;

&lt;p&gt;EKS nodes&lt;/p&gt;

&lt;p&gt;Isolated DB&lt;/p&gt;

&lt;p&gt;RDS / Aurora&lt;/p&gt;

&lt;p&gt;A sample subnet plan:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Subnet&lt;/th&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Public A/B/C&lt;/td&gt;
&lt;td&gt;10.20.0.0/24, 10.20.1.0/24, 10.20.2.0/24&lt;/td&gt;
&lt;td&gt;Public ALB, NAT gateways&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Private application A/B/C&lt;/td&gt;
&lt;td&gt;10.20.10.0/24, 10.20.11.0/24, 10.20.12.0/24&lt;/td&gt;
&lt;td&gt;EKS worker nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Isolated database A/B/C&lt;/td&gt;
&lt;td&gt;10.20.20.0/24, 10.20.21.0/24, 10.20.22.0/24&lt;/td&gt;
&lt;td&gt;RDS/Aurora subnet group&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These CIDRs are illustrative. Production sizing must account for Pod IP consumption, VPC CNI prefix delegation, node scaling and future growth.&lt;/p&gt;
&lt;h3&gt;
  
  
  5.2 Internet Gateway versus NAT Gateway
&lt;/h3&gt;

&lt;p&gt;Internet Gateway (IGW): Enables internet routing for resources with appropriate public addressing and routes. An internet-facing ALB typically resides in public subnets.&lt;/p&gt;

&lt;p&gt;NAT Gateway: Allows private workloads to initiate outbound connections without accepting unsolicited inbound internet connections.&lt;/p&gt;

&lt;p&gt;VPC endpoints: Let workloads reach services such as ECR, S3 and AWS Secrets Manager privately, reducing reliance on NAT. Private EKS designs may also need endpoints for STS, CloudWatch and other AWS APIs.&lt;/p&gt;

&lt;p&gt;The database subnets should not have an internet route merely to allow database administration.&lt;/p&gt;
&lt;h3&gt;
  
  
  5.3 AWS Security Groups
&lt;/h3&gt;

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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Port&lt;/th&gt;
&lt;th&gt;Reason&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Customer&lt;/td&gt;
&lt;td&gt;Public ALB&lt;/td&gt;
&lt;td&gt;443&lt;/td&gt;
&lt;td&gt;HTTPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ALB&lt;/td&gt;
&lt;td&gt;EKS application targets&lt;/td&gt;
&lt;td&gt;App listener port&lt;/td&gt;
&lt;td&gt;Frontend/API traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend workload&lt;/td&gt;
&lt;td&gt;RDS/Aurora&lt;/td&gt;
&lt;td&gt;5432&lt;/td&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authorized monitoring&lt;/td&gt;
&lt;td&gt;Metrics endpoints&lt;/td&gt;
&lt;td&gt;Defined metrics port&lt;/td&gt;
&lt;td&gt;Observability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Administrators&lt;/td&gt;
&lt;td&gt;AWS/EKS control interfaces&lt;/td&gt;
&lt;td&gt;Restricted&lt;/td&gt;
&lt;td&gt;Operations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Security Groups protect network interfaces. Kubernetes NetworkPolicies control permitted Pod traffic where enforced by the chosen network-policy implementation. Both layers matter.&lt;/p&gt;
&lt;h3&gt;
  
  
  5.4 Terraform project structure
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;infrastructure/
├── environments/
│   ├── dev/
│   ├── staging/
│   └── prod/
├── modules/
│   ├── vpc/
│   ├── eks/
│   ├── ecr/
│   ├── iam/
│   ├── database/
│   ├── kms/
│   └── observability/
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Use separate Terraform state and AWS permissions for each environment. A production workflow should have reviewed plans, restricted applies, remote state locking and state encryption.&lt;/p&gt;

&lt;p&gt;A basic student workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform fmt -recursive
terraform init
terraform validate
terraform plan -out=tfplan
terraform show tfplan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply only after reviewing the plan and confirming the selected AWS account, region, workspace and expected cost.&lt;/p&gt;

&lt;p&gt;Production interview question: Why do we use Terraform instead of creating everything manually?&lt;/p&gt;

&lt;p&gt;Answer: Terraform makes infrastructure declarative, version-controlled, reviewable and repeatable. It supports drift detection and consistent environments. It does not eliminate the need for change control or careful state management.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Phase 2 — Containerization with Docker
&lt;/h2&gt;

&lt;p&gt;Our banking platform has two independently deployable application components.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/kh6FO_oJpGC9utLaawiKJ5oe6dVwzXxBXpkz93kk-gEWH1WzDDckuLA7hMg6_fxC6_CSsQSW626oQETysdSALxi6h_tzflMyK_dRbDlM1K4JpA0XbTVm5IIPGFIXh_eX214BNPC6sKHblPofby9Dfkdt1c2wcdVyzFToA3X_CRc?purpose=inline" rel="noopener noreferrer"&gt;Optimizing Docker Images for Spring Boot Apps with Multi-Stage Builds | by Aymen FARHANI | Medium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Backend image&lt;/p&gt;

&lt;p&gt;Java 21, Spring Boot, PostgreSQL driver and banking business logic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/1HOA-8Qfm5tLZSRzctkd_ZsHz7zUE9EkyAyIfAmv6b-Z-fdpeegmzRhay7GBsSVW_ahkwNCDl8trr1gpSluRo0HuPAiz7RH055jI_wt-FljbMVU4BOg3Jvl63EhhywSOyvAD7HbgnDbzIhvtc9ezFFN4FiStS2Sa5nQgOS8N8kg?purpose=inline" rel="noopener noreferrer"&gt;⚙️ Part 2: Host Your React App &amp;amp; API with NGINX — Step-by-Step Guide - DEV Community&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frontend image&lt;/p&gt;

&lt;p&gt;React application built with Node.js and served using Nginx.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.1 Multi-stage Docker builds
&lt;/h3&gt;

&lt;p&gt;For the backend, the first stage compiles the Java application; the second stage contains only the runtime and executable JAR.&lt;/p&gt;

&lt;p&gt;For the frontend, the first stage runs &lt;code&gt;npm ci&lt;/code&gt; and &lt;code&gt;npm run build&lt;/code&gt;; the second serves the static files using Nginx.&lt;/p&gt;

&lt;p&gt;This reduces the final image size and avoids shipping Maven, Node build tooling and unnecessary source files into production.&lt;/p&gt;

&lt;p&gt;A production-ready Dockerfile should also consider non-root execution, image digests, minimal base images, vulnerability scanning, read-only root filesystems where supported, and predictable build outputs.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.2 Local Docker verification
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/jumptotech-digital-banking

docker build --platform linux/amd64 \
  -t jumptotech-banking-backend:dev ./backend

docker build --platform linux/amd64 \
  -t jumptotech-banking-frontend:dev ./frontend

docker images &lt;span class="o"&gt;|&lt;/span&gt; grep jumptotech-banking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These builds validate packaging, not the full banking transaction flow. The backend still requires database connectivity, secrets and application configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 Docker versus Kubernetes
&lt;/h3&gt;

&lt;p&gt;Docker builds and runs containers. Kubernetes schedules and manages workloads across nodes, including replicas, service discovery, health checks, rollouts and recovery.&lt;/p&gt;

&lt;p&gt;Interview question: Why not deploy a single Docker container on EC2?&lt;/p&gt;

&lt;p&gt;Answer: That can be appropriate for a small application. EKS becomes valuable when the organization needs a shared container platform with standardized scheduling, deployments, scaling, service discovery and operational controls. It also adds cost and complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Phase 3 — CI/CD with GitHub Actions
&lt;/h2&gt;

&lt;p&gt;Secure software delivery lifecycle&lt;/p&gt;

&lt;p&gt;1. Developer commit&lt;/p&gt;

&lt;p&gt;Pull request / code review&lt;/p&gt;

&lt;p&gt;2. CI validation&lt;/p&gt;

&lt;p&gt;Java tests + React tests&lt;/p&gt;

&lt;p&gt;3. Security gates&lt;/p&gt;

&lt;p&gt;Trivy + secret scanning&lt;/p&gt;

&lt;p&gt;4. Docker build&lt;/p&gt;

&lt;p&gt;Versioned images&lt;/p&gt;

&lt;p&gt;5. AWS ECR&lt;/p&gt;

&lt;p&gt;Immutable image digest&lt;/p&gt;

&lt;p&gt;6. GitOps change&lt;/p&gt;

&lt;p&gt;Update Helm image digest&lt;/p&gt;

&lt;p&gt;7. Argo CD&lt;/p&gt;

&lt;p&gt;Reconcile EKS workloads&lt;/p&gt;

&lt;p&gt;8. Verification&lt;/p&gt;

&lt;p&gt;Health + metrics + rollback&lt;/p&gt;

&lt;h3&gt;
  
  
  7.1 Continuous Integration
&lt;/h3&gt;

&lt;p&gt;Our current CI includes:&lt;/p&gt;

&lt;p&gt;Backend: Maven, Java 21, Testcontainers and PostgreSQL integration tests.&lt;/p&gt;

&lt;p&gt;Frontend: Node.js dependency installation, ESLint, Vitest and production build.&lt;/p&gt;

&lt;p&gt;Security: Trivy dependency vulnerability scans with blocking HIGH/CRITICAL findings.&lt;/p&gt;

&lt;p&gt;For the extended lab, add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secret detection and software composition analysis.&lt;/li&gt;
&lt;li&gt;Static application security testing (SAST).&lt;/li&gt;
&lt;li&gt;Dependency and SBOM generation.&lt;/li&gt;
&lt;li&gt;Container image scanning after build.&lt;/li&gt;
&lt;li&gt;Infrastructure-as-code and Kubernetes manifest scanning.&lt;/li&gt;
&lt;li&gt;Artifact provenance and image signing.&lt;/li&gt;
&lt;li&gt;Branch protection and required code reviews.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security gates must have defined exception procedures. A security scanner reporting no findings is not proof that the application is free from vulnerabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Continuous Delivery and Continuous Deployment
&lt;/h3&gt;

&lt;p&gt;These terms are different.&lt;/p&gt;

&lt;p&gt;Continuous Delivery: Every successful change is prepared for release, but production promotion can require approval.&lt;/p&gt;

&lt;p&gt;Continuous Deployment: Changes that pass automated controls are deployed without manual approval.&lt;/p&gt;

&lt;p&gt;For a banking environment, a common approach is automated development and staging deployment, with controlled production promotion, risk-based approvals and automated rollback procedures.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.3 What happened in our actual CI troubleshooting?
&lt;/h3&gt;

&lt;p&gt;This is an important teaching case.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Incident&lt;/th&gt;
&lt;th&gt;Root cause / finding&lt;/th&gt;
&lt;th&gt;Engineering lesson&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trivy action could not resolve&lt;/td&gt;
&lt;td&gt;Invalid action reference&lt;/td&gt;
&lt;td&gt;Pin verified action versions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trivy ignore files missing&lt;/td&gt;
&lt;td&gt;Files existed locally but not in Git&lt;/td&gt;
&lt;td&gt;CI only sees committed files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maven Central HTTP 429&lt;/td&gt;
&lt;td&gt;Dependency-resolution rate limiting&lt;/td&gt;
&lt;td&gt;Cache dependencies, avoid aggressive retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend Testcontainers failed&lt;/td&gt;
&lt;td&gt;Docker environment could not be detected&lt;/td&gt;
&lt;td&gt;Validate runner and container configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local Trivy clean, GitHub failed&lt;/td&gt;
&lt;td&gt;Local Spring Boot 4.1.2 versus committed 3.3.4&lt;/td&gt;
&lt;td&gt;Test and scan the same commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS STS denied ECR publishing&lt;/td&gt;
&lt;td&gt;GitHub OIDC subject did not match IAM trust policy&lt;/td&gt;
&lt;td&gt;Diagnose identity claims, not just IAM permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These examples demonstrate why a DevOps Engineer must distinguish application failures, build failures, network failures, authentication failures and security findings.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Phase 4 — AWS OIDC and IAM security
&lt;/h2&gt;

&lt;p&gt;This is one of the most important sections in the lab.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.1 Why not use AWS access keys in GitHub Secrets?
&lt;/h3&gt;

&lt;p&gt;A traditional pipeline might store:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are long-lived credentials unless explicitly rotated or revoked. If exposed, they may remain usable beyond the pipeline execution.&lt;/p&gt;

&lt;p&gt;With OpenID Connect (OIDC), GitHub requests a short-lived identity token. AWS validates the token and, if the IAM trust conditions match, issues temporary role credentials through AWS STS.&lt;/p&gt;

&lt;p&gt;GitHub Actions workflow&lt;/p&gt;

&lt;p&gt;Requests signed OIDC token&lt;/p&gt;

&lt;p&gt;AWS STS&lt;/p&gt;

&lt;p&gt;Validates issuer, audience, subject and role trust&lt;/p&gt;

&lt;p&gt;Temporary AWS credentials&lt;/p&gt;

&lt;p&gt;Limited permissions and lifetime&lt;/p&gt;

&lt;p&gt;Amazon ECR&lt;/p&gt;

&lt;p&gt;Push authorized container images&lt;/p&gt;

&lt;h3&gt;
  
  
  8.2 Our real OIDC failure
&lt;/h3&gt;

&lt;p&gt;Our initial AWS trust policy expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;repo:jumptotechschooldevops/jumptotech-digital-banking-batch5:ref:refs/heads/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the actual GitHub token contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;repo:jumptotechschooldevops@87104292/jumptotech-digital-banking-batch5@1452025901:ref:refs/heads/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This environment uses an OIDC subject containing organization and repository IDs. Because IAM &lt;code&gt;StringEquals&lt;/code&gt; requires an exact match, STS rejected the request.&lt;/p&gt;

&lt;p&gt;The diagnostic claims showed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iss: https://token.actions.githubusercontent.com
aud: sts.amazonaws.com
ref: refs/heads/main
event_name: workflow_run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The solution was to align the role's trust policy with the observed subject while keeping the audience and repository/branch restriction.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.3 IAM trust policy versus permission policy
&lt;/h3&gt;

&lt;p&gt;These are two different things.&lt;/p&gt;

&lt;p&gt;Trust policy: Who may assume the role?&lt;/p&gt;

&lt;p&gt;Permission policy: What may the role do after assuming it?&lt;/p&gt;

&lt;p&gt;A successful STS role assumption does not automatically grant ECR access.&lt;/p&gt;

&lt;p&gt;The ECR publisher should have only the necessary permissions, such as repository layer upload, image push and authorization-token retrieval.&lt;/p&gt;

&lt;p&gt;It should not receive &lt;code&gt;AdministratorAccess&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.4 Production security considerations
&lt;/h3&gt;

&lt;p&gt;For production, students must also learn to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restrict which repositories, branches or approved environments can assume a role.&lt;/li&gt;
&lt;li&gt;Use separate roles for CI publishing, Argo CD image access and infrastructure deployment.&lt;/li&gt;
&lt;li&gt;Avoid printing OIDC tokens or AWS credentials in logs.&lt;/li&gt;
&lt;li&gt;Use GitHub environment protections and required reviewers.&lt;/li&gt;
&lt;li&gt;Monitor CloudTrail for unexpected role assumptions.&lt;/li&gt;
&lt;li&gt;Prefer immutable image digests instead of mutable &lt;code&gt;latest&lt;/code&gt; tags.&lt;/li&gt;
&lt;li&gt;Pin GitHub Actions to reviewed immutable commits.&lt;/li&gt;
&lt;li&gt;Remove temporary OIDC diagnostic steps after verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Interview question: What does &lt;code&gt;sts:AssumeRoleWithWebIdentity&lt;/code&gt; do?&lt;/p&gt;

&lt;p&gt;Answer: It exchanges a valid externally issued web identity token, subject to an IAM role's trust policy, for temporary AWS role credentials.&lt;/p&gt;

&lt;p&gt;Interview question: Why did your ECR pipeline fail even though the IAM role existed?&lt;/p&gt;

&lt;p&gt;Answer: The role existed, but its trust policy did not match the actual GitHub OIDC token subject. We inspected the token's nonsecret claims, identified the mismatch, updated the trust relationship and reran authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Phase 5 — Amazon ECR and image promotion
&lt;/h2&gt;

&lt;p&gt;Use separate repositories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jumptotech-banking-backend
jumptotech-banking-frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The build pipeline should publish images with immutable commit-derived tags and record the resulting image digests.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;668484272259.dkr.ecr.us-east-2.amazonaws.com/
  jumptotech-banking-backend:&amp;lt;commit-sha&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The deployed Kubernetes workload should reference a tested image digest rather than relying only on &lt;code&gt;latest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For a stronger production design, promote the same tested image from development to staging and production. Do not rebuild different images for each environment.&lt;/p&gt;

&lt;p&gt;Also configure ECR encryption, image scanning, lifecycle policies and repository permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Phase 6 — Amazon EKS cluster
&lt;/h2&gt;

&lt;h3&gt;
  
  
  10.1 What is EKS?
&lt;/h3&gt;

&lt;p&gt;Amazon Elastic Kubernetes Service provides a managed Kubernetes control plane. AWS operates the managed control-plane infrastructure; your team remains responsible for workload configuration, access controls, node strategy, networking, observability and application security.&lt;/p&gt;

&lt;h3&gt;
  
  
  10.2 Core Kubernetes architecture
&lt;/h3&gt;

&lt;p&gt;Kubernetes control plane&lt;/p&gt;

&lt;p&gt;API Server · etcd · Scheduler · Controller Manager&lt;/p&gt;

&lt;p&gt;Worker 1&lt;/p&gt;

&lt;p&gt;kubelet · containerd · CNI&lt;/p&gt;

&lt;p&gt;Banking Pods&lt;/p&gt;

&lt;p&gt;Node agents&lt;/p&gt;

&lt;p&gt;Worker 2&lt;/p&gt;

&lt;p&gt;kubelet · containerd · CNI&lt;/p&gt;

&lt;p&gt;Banking Pods&lt;/p&gt;

&lt;p&gt;Node agents&lt;/p&gt;

&lt;p&gt;Worker 3&lt;/p&gt;

&lt;p&gt;kubelet · containerd · CNI&lt;/p&gt;

&lt;p&gt;Banking Pods&lt;/p&gt;

&lt;p&gt;Node agents&lt;/p&gt;

&lt;h3&gt;
  
  
  10.3 Kubernetes control-plane components
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;API Server&lt;/td&gt;
&lt;td&gt;Entry point for Kubernetes API requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;etcd&lt;/td&gt;
&lt;td&gt;Stores Kubernetes cluster state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scheduler&lt;/td&gt;
&lt;td&gt;Selects nodes for unscheduled Pods&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Controller Manager&lt;/td&gt;
&lt;td&gt;Reconciles desired and observed state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kubelet&lt;/td&gt;
&lt;td&gt;Manages Pods on each node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;containerd&lt;/td&gt;
&lt;td&gt;Runs containers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNI&lt;/td&gt;
&lt;td&gt;Provides Pod networking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kube-proxy or eBPF dataplane&lt;/td&gt;
&lt;td&gt;Implements Service traffic forwarding&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CoreDNS&lt;/td&gt;
&lt;td&gt;Resolves Kubernetes service names&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  10.4 Production EKS considerations
&lt;/h3&gt;

&lt;p&gt;Use private worker nodes distributed across Availability Zones. Configure managed node groups or an approved autoscaling solution, workload identity, audit logging, encrypted storage, Pod scheduling constraints and capacity monitoring.&lt;/p&gt;

&lt;p&gt;A three-AZ design is a resilience target, not a guarantee of zero downtime. You must test failover and confirm that the application and database can tolerate a zone failure.&lt;/p&gt;

&lt;p&gt;Basic commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws eks update-kubeconfig \
  --region us-east-2 \
  --name jumptotech-banking-prod

kubectl get nodes -o wide
kubectl get pods -A
kubectl get namespaces
kubectl get events -A --sort-by=.lastTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cluster name is illustrative; students should replace it with the actual Terraform-created cluster name.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Phase 7 — Kubernetes workload objects
&lt;/h2&gt;

&lt;p&gt;Students must understand why each Kubernetes resource exists, not just memorize commands.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kubernetes resource&lt;/th&gt;
&lt;th&gt;Banking use case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Namespace&lt;/td&gt;
&lt;td&gt;Separate banking, monitoring and GitOps workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Run stateless frontend and backend replicas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ReplicaSet&lt;/td&gt;
&lt;td&gt;Maintain desired Pod replicas under a Deployment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod&lt;/td&gt;
&lt;td&gt;Run one or more closely coupled containers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ClusterIP Service&lt;/td&gt;
&lt;td&gt;Stable internal access to the banking API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NodePort Service&lt;/td&gt;
&lt;td&gt;Demonstrate node-level service exposure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LoadBalancer Service&lt;/td&gt;
&lt;td&gt;Expose a service through a cloud load balancer when appropriate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ingress&lt;/td&gt;
&lt;td&gt;Route external HTTP/HTTPS requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ConfigMap&lt;/td&gt;
&lt;td&gt;Nonsecret runtime configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secret&lt;/td&gt;
&lt;td&gt;Kubernetes secret object; preferably synchronized from an external secret manager&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ServiceAccount&lt;/td&gt;
&lt;td&gt;Workload identity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StatefulSet&lt;/td&gt;
&lt;td&gt;Stateful workloads with stable identities and storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DaemonSet&lt;/td&gt;
&lt;td&gt;Node-level logging, security and monitoring agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PersistentVolume / PVC&lt;/td&gt;
&lt;td&gt;Persistent storage for eligible workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HPA&lt;/td&gt;
&lt;td&gt;Scale application replicas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PDB&lt;/td&gt;
&lt;td&gt;Limit voluntary disruptions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NetworkPolicy&lt;/td&gt;
&lt;td&gt;Restrict Pod traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Role / RoleBinding&lt;/td&gt;
&lt;td&gt;Namespace-scoped Kubernetes authorization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ClusterRole / ClusterRoleBinding&lt;/td&gt;
&lt;td&gt;Cluster-scoped authorization&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  11.1 Namespace
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Namespace&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app.kubernetes.io/part-of&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jumptotech-banking&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Production environments should usually use separate clusters or AWS accounts where stronger isolation is required, not rely solely on namespaces.&lt;/p&gt;

&lt;h3&gt;
  
  
  11.2 Backend Deployment
&lt;/h3&gt;

&lt;p&gt;This is a teaching manifest. It assumes that the application supports the specified Actuator health endpoints and that the ServiceAccount and secret synchronization are configured separately.&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="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&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="p"&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="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;revisionHistoryLimit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;RollingUpdate&lt;/span&gt;
    &lt;span class="na"&gt;rollingUpdate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;maxSurge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
      &lt;span class="na"&gt;maxUnavailable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;serviceAccountName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-api&lt;/span&gt;
      &lt;span class="na"&gt;automountServiceAccountToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="na"&gt;terminationGracePeriodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
      &lt;span class="na"&gt;securityContext&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;runAsNonRoot&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;seccompProfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;RuntimeDefault&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;backend&lt;/span&gt;
          &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;BANKING_BACKEND_IMAGE_DIGEST&lt;/span&gt;
          &lt;span class="na"&gt;imagePullPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;IfNotPresent&lt;/span&gt;
          &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;
          &lt;span class="na"&gt;envFrom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-db-credentials&lt;/span&gt;
          &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/actuator/health/readiness&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
          &lt;span class="na"&gt;livenessProbe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/actuator/health/liveness&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
          &lt;span class="na"&gt;startupProbe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/actuator/health/liveness&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;
            &lt;span class="na"&gt;failureThreshold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
          &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;250m&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;512Mi&lt;/span&gt;
            &lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1Gi&lt;/span&gt;
          &lt;span class="na"&gt;securityContext&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;allowPrivilegeEscalation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
            &lt;span class="na"&gt;capabilities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;drop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ALL"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="na"&gt;readOnlyRootFilesystem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Before applying, validate that the Java runtime and container image work with a read-only filesystem, writable temporary directories, the configured UID and these memory settings. Use an actual ECR image digest in place of the placeholder.&lt;/p&gt;

&lt;h3&gt;
  
  
  11.3 Readiness, liveness and startup probes
&lt;/h3&gt;

&lt;p&gt;Readiness: Can this Pod safely receive traffic?&lt;/p&gt;

&lt;p&gt;Liveness: Is the process healthy enough to keep running?&lt;/p&gt;

&lt;p&gt;Startup: Has the application completed its initial startup?&lt;/p&gt;

&lt;p&gt;For banking workloads, readiness may include selected critical dependencies, but liveness should generally not fail merely because a shared database is temporarily unavailable. Otherwise, a database outage can cause widespread application restarts.&lt;/p&gt;

&lt;h3&gt;
  
  
  11.4 RollingUpdate strategy
&lt;/h3&gt;

&lt;p&gt;With three replicas, &lt;code&gt;maxSurge: 1&lt;/code&gt; and &lt;code&gt;maxUnavailable: 0&lt;/code&gt;, Kubernetes can create one additional Pod during an update while aiming to keep all three desired replicas available.&lt;/p&gt;

&lt;p&gt;This does not guarantee zero downtime. Application startup, database migrations, traffic draining and actual capacity must also be handled correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  11.5 ClusterIP Service
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&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="p"&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="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterIP&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http&lt;/span&gt;
      &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;
      &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A Pod can call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://banking-backend.banking.svc.cluster.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CoreDNS resolves the service name to its ClusterIP. The Kubernetes service dataplane then forwards traffic to an eligible endpoint, normally represented in EndpointSlices.&lt;/p&gt;

&lt;h3&gt;
  
  
  11.6 NodePort versus ClusterIP versus LoadBalancer
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Typical use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ClusterIP&lt;/td&gt;
&lt;td&gt;Exposes a Service inside the cluster&lt;/td&gt;
&lt;td&gt;Backend APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NodePort&lt;/td&gt;
&lt;td&gt;Allocates a port on nodes for Service traffic&lt;/td&gt;
&lt;td&gt;Labs or specialized networking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LoadBalancer&lt;/td&gt;
&lt;td&gt;Requests cloud load-balancer integration&lt;/td&gt;
&lt;td&gt;Externally exposed services&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For production banking applications, prefer a controlled ALB/Ingress design for HTTP/HTTPS rather than exposing application NodePorts directly to the public internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  11.7 Ingress routing
&lt;/h3&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://bank.example.com/        → frontend
https://bank.example.com/api/*   → backend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An illustrative AWS ALB Ingress:&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="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;internet-facing&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ip&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/listen-ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'[{"HTTPS":443}]'&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/certificate-arn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;REPLACE_WITH_ACM_CERT_ARN&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;ingressClassName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alb&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bank.example.com&lt;/span&gt;
      &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/api&lt;/span&gt;
            &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
            &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
                &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;
          &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
            &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
            &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-frontend&lt;/span&gt;
                &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This requires the AWS Load Balancer Controller, appropriate IAM permissions, subnet discovery and a valid ACM certificate. The example domain is not an actual banking endpoint.&lt;/p&gt;

&lt;p&gt;In production, enforce HTTPS and carefully configure WAF, trusted headers, session cookies, CSRF protections and any proxy forwarding behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Phase 8 — DaemonSet, StatefulSet and persistent storage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  12.1 DaemonSet
&lt;/h3&gt;

&lt;p&gt;A DaemonSet ensures that an eligible set of nodes runs the designated agent Pods.&lt;/p&gt;

&lt;p&gt;Banking platform examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fluent Bit or another node-level log collector.&lt;/li&gt;
&lt;li&gt;Node metrics exporters.&lt;/li&gt;
&lt;li&gt;Runtime security agents.&lt;/li&gt;
&lt;li&gt;Approved network agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A DaemonSet is not normally the correct resource for the banking business API.&lt;/p&gt;

&lt;p&gt;DaemonSet behavior&lt;/p&gt;

&lt;p&gt;Node 1&lt;/p&gt;

&lt;p&gt;Log agent&lt;/p&gt;

&lt;p&gt;Node 2&lt;/p&gt;

&lt;p&gt;Log agent&lt;/p&gt;

&lt;p&gt;Node 3&lt;/p&gt;

&lt;p&gt;Log agent&lt;/p&gt;

&lt;p&gt;One logging-agent Pod per eligible node in this illustrative cluster.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.2 StatefulSet
&lt;/h3&gt;

&lt;p&gt;A StatefulSet is useful when applications require stable Pod identities, ordered lifecycle behavior and persistent volume associations.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A PostgreSQL instance for a classroom exercise.&lt;/li&gt;
&lt;li&gt;A Kafka broker cluster managed with appropriate operational tooling.&lt;/li&gt;
&lt;li&gt;Certain stateful monitoring or storage components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A StatefulSet does not automatically provide database replication, backups, automatic failover or transaction consistency.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.3 Should we run PostgreSQL inside EKS for banking production?
&lt;/h3&gt;

&lt;p&gt;For this project, the preferred production target is managed Amazon RDS or Aurora, not a manually maintained PostgreSQL StatefulSet.&lt;/p&gt;

&lt;p&gt;Students should still deploy a PostgreSQL StatefulSet in an isolated lab to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Headless Services.&lt;/li&gt;
&lt;li&gt;Stable Pod names such as &lt;code&gt;postgres-0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;PVC creation through &lt;code&gt;volumeClaimTemplates&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;EBS CSI dynamic provisioning.&lt;/li&gt;
&lt;li&gt;Pod rescheduling and volume attachment.&lt;/li&gt;
&lt;li&gt;Backup and recovery responsibilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is an educational exercise, not the recommended production database architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.4 PersistentVolume and PersistentVolumeClaim
&lt;/h3&gt;

&lt;p&gt;A PVC requests storage. A StorageClass defines how Kubernetes dynamically provisions it. On AWS, the EBS CSI driver can provision block volumes.&lt;/p&gt;

&lt;p&gt;Important considerations include Availability Zone placement, access modes, storage encryption, snapshots and the fact that an EBS volume does not automatically become multi-AZ storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Phase 9 — Kubernetes NetworkPolicy
&lt;/h2&gt;

&lt;p&gt;For a banking platform, the principle is deny by default, then explicitly allow required traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  13.1 Default deny
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default-deny&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This policy selects all Pods in the namespace. It only works as intended if the cluster has a network-policy enforcement implementation enabled.&lt;/p&gt;

&lt;h3&gt;
  
  
  13.2 Allow frontend-to-backend traffic
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;allow-frontend-to-backend&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-frontend&lt;/span&gt;
      &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
          &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This permits frontend Pods in the same namespace to reach backend Pods on port 8080.&lt;/p&gt;

&lt;p&gt;It does not by itself allow direct ALB-to-backend traffic. For an ALB using IP targets, ingress and egress policies must be designed and tested for the actual traffic source and dataplane behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  13.3 Database connectivity
&lt;/h3&gt;

&lt;p&gt;For RDS/Aurora outside Kubernetes, use restrictive database Security Groups. Kubernetes egress policies may also constrain database-bound traffic using CIDR-based rules or supported higher-level network controls.&lt;/p&gt;

&lt;p&gt;Be careful with IP-based policies when database endpoints can fail over or change addresses. DNS-aware policy capabilities depend on the network-policy implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  13.4 DNS traffic
&lt;/h3&gt;

&lt;p&gt;A default-deny egress policy can also block DNS resolution. Students should create a narrowly scoped DNS egress rule permitting traffic to the actual cluster DNS service.&lt;/p&gt;

&lt;p&gt;Interview scenario: The backend Pod is Running and Ready, but database connections time out after a NetworkPolicy change.&lt;/p&gt;

&lt;p&gt;A good investigation checks NetworkPolicies, DNS, database endpoint resolution, Security Groups, routes, database health and application logs. Do not assume the Pod needs restarting.&lt;/p&gt;

&lt;h2&gt;
  
  
  14. Phase 10 — Kubernetes RBAC and AWS workload identity
&lt;/h2&gt;

&lt;h3&gt;
  
  
  14.1 RBAC
&lt;/h3&gt;

&lt;p&gt;Kubernetes RBAC answers:&lt;/p&gt;

&lt;p&gt;Who can perform which Kubernetes API operations on which resources?&lt;/p&gt;

&lt;p&gt;For example, a developer may be allowed to view Pods and logs in a development namespace without permission to delete workloads or read production Secrets.&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="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rbac.authorization.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Role&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-readonly&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"pods"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pods/log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"services"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"list"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"apps"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"deployments"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"list"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Bind this Role to an authorized group or subject using a RoleBinding.&lt;/p&gt;

&lt;h3&gt;
  
  
  14.2 Role versus ClusterRole
&lt;/h3&gt;

&lt;p&gt;A Role defines permissions within a namespace. A ClusterRole can define cluster-scoped permissions or reusable namespaced permissions.&lt;/p&gt;

&lt;p&gt;A RoleBinding grants permissions in its namespace, while a ClusterRoleBinding grants permissions at cluster scope.&lt;/p&gt;

&lt;h3&gt;
  
  
  14.3 Kubernetes RBAC versus AWS IAM
&lt;/h3&gt;

&lt;p&gt;These are separate authorization systems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kubernetes RBAC: Controls Kubernetes API access.&lt;/li&gt;
&lt;li&gt;AWS IAM: Controls access to AWS services such as S3, ECR and Secrets Manager.&lt;/li&gt;
&lt;li&gt;EKS access management: Maps authorized AWS principals into Kubernetes access, through supported EKS access entries or other configured mechanisms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For AWS access from application Pods, use EKS Pod Identity or appropriately configured IAM Roles for Service Accounts (IRSA), not hardcoded AWS keys.&lt;/p&gt;

&lt;p&gt;The application ServiceAccount should have only the permissions it needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  15. Phase 11 — Banking database architecture: RDS versus Aurora
&lt;/h2&gt;

&lt;p&gt;This is a core interview topic.&lt;/p&gt;

&lt;h3&gt;
  
  
  15.1 Amazon RDS PostgreSQL
&lt;/h3&gt;

&lt;p&gt;Amazon RDS for PostgreSQL is a managed PostgreSQL database service. AWS manages much of the infrastructure operation, including supported backups, patching workflows and high-availability configurations.&lt;/p&gt;

&lt;p&gt;RDS PostgreSQL is often suitable for applications that need PostgreSQL compatibility with predictable capacity and relatively straightforward database operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  15.2 Amazon Aurora PostgreSQL
&lt;/h3&gt;

&lt;p&gt;Amazon Aurora PostgreSQL-Compatible Edition is a managed relational database engine designed around Aurora's distributed storage architecture.&lt;/p&gt;

&lt;p&gt;Aurora can offer useful features for high availability, read scaling and managed failover. It is not automatically the best or cheapest choice for every workload.&lt;/p&gt;

&lt;p&gt;RDS PostgreSQL&lt;/p&gt;

&lt;p&gt;Managed PostgreSQL with instance-based storage and optional Multi-AZ configurations&lt;/p&gt;

&lt;p&gt;Aurora PostgreSQL&lt;/p&gt;

&lt;p&gt;Aurora cluster storage architecture with writer and optional reader instances&lt;/p&gt;

&lt;h3&gt;
  
  
  15.3 When should we choose each?
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;RDS PostgreSQL&lt;/th&gt;
&lt;th&gt;Aurora PostgreSQL&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Small or moderate application&lt;/td&gt;
&lt;td&gt;Often a good fit&lt;/td&gt;
&lt;td&gt;May be unnecessary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL compatibility&lt;/td&gt;
&lt;td&gt;Strong&lt;/td&gt;
&lt;td&gt;Strong, with engine-specific differences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High availability&lt;/td&gt;
&lt;td&gt;Multi-AZ options&lt;/td&gt;
&lt;td&gt;Aurora cluster failover&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read scaling&lt;/td&gt;
&lt;td&gt;Read replicas / supported Multi-AZ architectures&lt;/td&gt;
&lt;td&gt;Aurora readers and reader endpoint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage architecture&lt;/td&gt;
&lt;td&gt;RDS-managed database storage&lt;/td&gt;
&lt;td&gt;Aurora distributed cluster storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Often simpler to estimate&lt;/td&gt;
&lt;td&gt;Requires evaluation of compute, storage, I/O and options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operational complexity&lt;/td&gt;
&lt;td&gt;Familiar PostgreSQL model&lt;/td&gt;
&lt;td&gt;Additional cluster and endpoint considerations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For a student lab, start with RDS PostgreSQL if the objective is straightforward database connectivity and operations. Introduce Aurora when teaching distributed storage, reader scaling, failover and advanced managed database architecture.&lt;/p&gt;

&lt;p&gt;For a real banking system, select based on measured workload, RTO/RPO, regulatory requirements, availability objectives, feature compatibility and total cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  15.4 Database connection flow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Spring Boot backend Pod
       |
       | PostgreSQL protocol / TLS
       v
RDS Proxy (optional)
       |
       v
RDS PostgreSQL or Aurora writer
       |
       v
Persistent banking transaction data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RDS Proxy can help manage connection pooling and certain failover scenarios, but it does not solve every connection or transaction issue. Application retry behavior must be designed carefully.&lt;/p&gt;

&lt;h3&gt;
  
  
  15.5 Banking transaction correctness
&lt;/h3&gt;

&lt;p&gt;Our backend uses PostgreSQL-backed integration tests and includes transfer, ledger and idempotency logic.&lt;/p&gt;

&lt;p&gt;For banking-style transfers, students should understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database transactions and atomicity.&lt;/li&gt;
&lt;li&gt;ACID guarantees.&lt;/li&gt;
&lt;li&gt;Pessimistic versus optimistic locking.&lt;/li&gt;
&lt;li&gt;Concurrent transfers and deadlocks.&lt;/li&gt;
&lt;li&gt;Idempotency keys.&lt;/li&gt;
&lt;li&gt;Ledger consistency.&lt;/li&gt;
&lt;li&gt;Database constraints.&lt;/li&gt;
&lt;li&gt;Retry safety.&lt;/li&gt;
&lt;li&gt;Audit trails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a transfer between two accounts should not debit one account without reliably applying the corresponding credit and ledger records.&lt;/p&gt;

&lt;p&gt;Interview question: Why can't Kubernetes guarantee that a banking transfer happens exactly once?&lt;/p&gt;

&lt;p&gt;Answer: Kubernetes manages workloads, not business transaction semantics. Exactly-once business effects require application-level idempotency, database constraints and transaction design, especially when requests are retried after timeouts.&lt;/p&gt;

&lt;h3&gt;
  
  
  15.6 Database migrations
&lt;/h3&gt;

&lt;p&gt;Use a controlled migration process such as Flyway.&lt;/p&gt;

&lt;p&gt;In production, avoid having every application replica independently attempt incompatible schema changes during startup. Prefer a single controlled migration job or release stage, with backward-compatible schema changes and explicit rollback planning.&lt;/p&gt;

&lt;p&gt;For zero-downtime releases, use an expand-and-contract migration strategy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add backward-compatible schema changes.&lt;/li&gt;
&lt;li&gt;Deploy application code supporting old and new structures.&lt;/li&gt;
&lt;li&gt;Migrate or backfill data safely.&lt;/li&gt;
&lt;li&gt;Remove obsolete schema elements in a later release.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  15.7 Backup and disaster recovery
&lt;/h3&gt;

&lt;p&gt;The database plan must include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automated backups and point-in-time recovery.&lt;/li&gt;
&lt;li&gt;Multi-AZ availability.&lt;/li&gt;
&lt;li&gt;Encryption at rest and in transit.&lt;/li&gt;
&lt;li&gt;Backup retention policies.&lt;/li&gt;
&lt;li&gt;Regular restore tests.&lt;/li&gt;
&lt;li&gt;RTO and RPO definitions.&lt;/li&gt;
&lt;li&gt;Regional disaster-recovery planning where required.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RTO: Maximum acceptable time to restore service.&lt;/p&gt;

&lt;p&gt;RPO: Maximum acceptable data loss measured in time.&lt;/p&gt;

&lt;p&gt;Multi-AZ is not the same as a backup, and a backup is not proof of recoverability until restoration is tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  16. Phase 12 — Helm: packaging Kubernetes applications
&lt;/h2&gt;

&lt;p&gt;Helm helps manage Kubernetes application configurations through versioned charts.&lt;/p&gt;

&lt;p&gt;Instead of manually maintaining separate Deployment, Service, Ingress, HPA and other YAML files for every environment, we create a reusable Helm chart.&lt;/p&gt;

&lt;h3&gt;
  
  
  16.1 Suggested Helm structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm/
└── banking/
    ├── Chart.yaml
    ├── values.yaml
    ├── values-dev.yaml
    ├── values-staging.yaml
    ├── values-prod.yaml
    └── templates/
        ├── deployment-backend.yaml
        ├── deployment-frontend.yaml
        ├── service-backend.yaml
        ├── service-frontend.yaml
        ├── ingress.yaml
        ├── hpa.yaml
        ├── networkpolicy.yaml
        ├── serviceaccount.yaml
        └── pdb.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  16.2 Example production values
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicaCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;REPLACE_WITH_ECR_BACKEND&lt;/span&gt;
    &lt;span class="na"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;REPLACE_WITH_IMAGE_DIGEST&lt;/span&gt;
  &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;250m&lt;/span&gt;
      &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;512Mi&lt;/span&gt;
    &lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1Gi&lt;/span&gt;

&lt;span class="na"&gt;frontend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicaCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;REPLACE_WITH_ECR_FRONTEND&lt;/span&gt;
    &lt;span class="na"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;REPLACE_WITH_IMAGE_DIGEST&lt;/span&gt;

&lt;span class="na"&gt;autoscaling&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;minReplicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;maxReplicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
  &lt;span class="na"&gt;targetCPUUtilizationPercentage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;

&lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bank.example.com&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;These are illustrative Helm values. Templates must be written to consume them.&lt;/p&gt;

&lt;h3&gt;
  
  
  16.3 Helm commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm lint ./helm/banking

helm template banking ./helm/banking \
  -f ./helm/banking/values-prod.yaml

helm upgrade --install banking ./helm/banking \
  --namespace banking \
  --create-namespace \
  -f ./helm/banking/values-dev.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final command is appropriate for a controlled development lab. In the GitOps production model, Argo CD should manage the application's Helm release rather than engineers making routine manual changes directly in the cluster.&lt;/p&gt;

&lt;p&gt;Interview question: What is the difference between Helm and Argo CD?&lt;/p&gt;

&lt;p&gt;Answer: Helm packages and templates Kubernetes resources. Argo CD continuously reconciles the cluster with the desired state stored in Git. Argo CD can deploy Helm charts.&lt;/p&gt;

&lt;h2&gt;
  
  
  17. Phase 13 — Argo CD and GitOps
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/wweamSkSnYizZXbTMefdUqb5h8jFofJg4miKnBGMsvxhwjCWeb_UxtyH7k-Iw1GQsgHfbMIIlGZ_ULur9l3GAN2z8vt1RxYIMzkIkzS9lOE4BTwTJ0TsHVYY_AwcntK4_d7F4i5fsBgGDiNv9YzgOI18GGdYSxt8ahe0_NOn0cg?purpose=inline" rel="noopener noreferrer"&gt;GitOps on Kubernetes with ArgoCD. Implementing declarative, automated… | by Jakub Jakubowski | Apr, 2026 | Medium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/ugKGXT13V4gYqIoncZEOB1ix3UK-2zig90Bscyv5588dSjfLEaqpIksuEfHhw64zvaHRzVGECMpaO71E6g3zd6EFDYNipkhAjRPOY41aXLYlGrjBqj8SizG5EDL1Tw6OXK81BbTX11Yk1sxoQx_KJ9H-sTmKRb2agWbav37qWXA?purpose=inline" rel="noopener noreferrer"&gt;Enhance Kubernetes deployment efficiency with Argo CD and ApplicationSet | Red Hat Developer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/S2V5oqvOkCCQVEJIsFzstDmRVlM7qnWeUocigNOhVp0nK1Ix7yJZ-DtJs_tZxLPI9OkLObWE6VEuXw6Pn2STVwZHp8xG5Ui_JmITSoQfknklZt4m0gL301P3dlf1rgeM3iNC-mcibF7n1RI4HF3CCc7Slk2_eLbGnlGEw8z46Hc?purpose=inline" rel="noopener noreferrer"&gt;How to Set Up GitOps with ArgoCD on Kubernetes — Even If You’ve Never Heard of GitOps (2026) | by AbdulRahman Mostafa | Apr, 2026 | Medium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7&lt;/p&gt;

&lt;h3&gt;
  
  
  17.1 Why GitOps?
&lt;/h3&gt;

&lt;p&gt;In a traditional pipeline, GitHub Actions may directly execute:&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 -f deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a GitOps model, the pipeline builds and publishes an artifact, then updates a Git repository containing the desired deployment configuration.&lt;/p&gt;

&lt;p&gt;Argo CD detects the Git change and reconciles Kubernetes resources.&lt;/p&gt;

&lt;p&gt;This separates image-building permissions from Kubernetes deployment permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  17.2 Recommended repository separation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jumptotech-digital-banking-batch5/
├── backend/
├── frontend/
├── .github/workflows/
└── docs/

jumptotech-banking-gitops/
├── applications/
│   ├── dev/
│   ├── staging/
│   └── prod/
├── helm/
└── environments/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application repository owns source code, tests and image builds. The GitOps repository owns deployment configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  17.3 Example Argo CD Application
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;argoproj.io/v1alpha1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Application&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-dev&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;argocd&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;project&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
  &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;repoURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/jumptotechschooldevops/jumptotech-banking-gitops.git&lt;/span&gt;
    &lt;span class="na"&gt;targetRevision&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;helm/banking&lt;/span&gt;
    &lt;span class="na"&gt;helm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;valueFiles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;values-dev.yaml&lt;/span&gt;
  &lt;span class="na"&gt;destination&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://kubernetes.default.svc&lt;/span&gt;
    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-dev&lt;/span&gt;
  &lt;span class="na"&gt;syncPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;automated&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;prune&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;selfHeal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;syncOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;CreateNamespace=true&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This example assumes the GitOps repository, Helm chart and Argo CD AppProject have been created. It is a proposed configuration.&lt;/p&gt;

&lt;p&gt;For production, use a protected GitOps revision and carefully control automated pruning and self-healing. Production promotion may require a reviewed pull request and a manual synchronization approval.&lt;/p&gt;

&lt;h3&gt;
  
  
  17.4 Argo CD states
&lt;/h3&gt;

&lt;p&gt;Synced: The desired Kubernetes configuration matches the Git source.&lt;/p&gt;

&lt;p&gt;OutOfSync: The live configuration differs from Git.&lt;/p&gt;

&lt;p&gt;Healthy: The application's health assessments indicate expected operational status.&lt;/p&gt;

&lt;p&gt;Degraded: One or more resources are unhealthy.&lt;/p&gt;

&lt;p&gt;An application can be Synced but unhealthy. Git configuration agreement does not guarantee business functionality.&lt;/p&gt;

&lt;h3&gt;
  
  
  17.5 Rollback strategy
&lt;/h3&gt;

&lt;p&gt;For a failed application release:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Identify the deployed image digest and GitOps commit.&lt;/li&gt;
&lt;li&gt;Evaluate whether the problem is code, configuration, infrastructure or database-related.&lt;/li&gt;
&lt;li&gt;Revert or promote a previously tested deployment configuration.&lt;/li&gt;
&lt;li&gt;Allow Argo CD to reconcile.&lt;/li&gt;
&lt;li&gt;Verify application health, transaction correctness and monitoring.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Database migrations require special attention because rolling back application code does not automatically reverse schema or data changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  18. Phase 14 — Autoscaling, high availability and resilience
&lt;/h2&gt;

&lt;h3&gt;
  
  
  18.1 Horizontal Pod Autoscaler
&lt;/h3&gt;

&lt;p&gt;HPA adjusts the desired number of application replicas based on supported metrics.&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 yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoscaling/v2&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;HorizontalPodAutoscaler&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend-hpa&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;scaleTargetRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;banking-backend&lt;/span&gt;
  &lt;span class="na"&gt;minReplicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;maxReplicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
  &lt;span class="na"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Resource&lt;/span&gt;
      &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cpu&lt;/span&gt;
        &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Utilization&lt;/span&gt;
          &lt;span class="na"&gt;averageUtilization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;CPU-based HPA requires usable CPU requests and a working metrics pipeline.&lt;/p&gt;

&lt;p&gt;For banking workloads, CPU alone may not represent capacity. Database connections, request latency, queue depth and transaction throughput may be more meaningful scaling signals.&lt;/p&gt;

&lt;h3&gt;
  
  
  18.2 HPA versus node autoscaling
&lt;/h3&gt;

&lt;p&gt;HPA scales application replicas.&lt;/p&gt;

&lt;p&gt;Node autoscaling adds or removes cluster compute capacity.&lt;/p&gt;

&lt;p&gt;If HPA creates additional Pods but no node has sufficient capacity, those Pods may remain Pending until capacity becomes available.&lt;/p&gt;

&lt;h3&gt;
  
  
  18.3 PodDisruptionBudget
&lt;/h3&gt;

&lt;p&gt;A PDB helps protect a minimum number of available Pods during voluntary disruptions, such as controlled node draining.&lt;/p&gt;

&lt;p&gt;It does not prevent all failures or guarantee availability during an unplanned outage.&lt;/p&gt;

&lt;h3&gt;
  
  
  18.4 Availability Zone resilience
&lt;/h3&gt;

&lt;p&gt;Spread application replicas across Availability Zones using topology spread constraints and appropriate node placement.&lt;/p&gt;

&lt;p&gt;Test the loss of a node and the loss of an Availability Zone in a controlled environment. Observe Pod rescheduling, ingress behavior, database failover and recovery time.&lt;/p&gt;

&lt;h2&gt;
  
  
  19. Phase 15 — Production monitoring with Prometheus and Grafana
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/lqgn2D28Y4wAWzfnvdysi-iOCXpT0QPPOfkH3UGG800MJz-SwmAXpV4Dxn-Lek597zyrs7np803muBaSwxkm0haE5s7sS91z2dABhUohZxC-07h3z3G991Iq5vKPbMSDwUnuOxbPLCp2PPeW4JJ_pc91fmVuUMLjp9Zwq7t524A?purpose=inline" rel="noopener noreferrer"&gt;A set of modern Grafana dashboards for Kubernetes | by David Calvert | Medium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/lxrJ7Mx_YnkZqrBIJKi9bWFdxKFA26zSa3ygbLLexjrYd1J0ubpSEn7XweHnVTK8-jRxqB7BnlXOC8GsCMwQ6-YyYJw0uXIqJReHd-dzC-dMR2F5H9WUTH11SYEnHgr0qu0KaSwFy4jYCWlJpjOPpM9uhT8SehX9WDpyTvoLA7g?purpose=inline" rel="noopener noreferrer"&gt;Prometheus Operator 簡介 - Tech Learning&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://images.openai.com/static-rsc-4/pu6749sI3oTqMMWZvYorOOcvjbT6y__K4XB_G1f29Y7Ws9UDur8A943fLqHyWKoX4F9dydxhuN9qFm0dJuePz7EcFcFHft0-2ivJXcdoD18CYDJJsxUoc2oHBbwIswMBMachB4yE-HVqfLqqI2Qz9jKkeS9kSdnKzY6RjaClPQ0?purpose=inline" rel="noopener noreferrer"&gt;Kubernetes / Views / Nodes | Grafana Labs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7&lt;/p&gt;

&lt;p&gt;A production-style banking platform needs monitoring at multiple layers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Important metrics&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Infrastructure&lt;/td&gt;
&lt;td&gt;Node CPU, memory, disk, network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes&lt;/td&gt;
&lt;td&gt;Pod restarts, unavailable replicas, pending Pods&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application&lt;/td&gt;
&lt;td&gt;HTTP errors, latency, throughput&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;Connections, locks, replication lag, storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Business&lt;/td&gt;
&lt;td&gt;Transfer success/failure, duplicate prevention&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;Authentication failures, access anomalies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delivery&lt;/td&gt;
&lt;td&gt;Deployment failures, rollback frequency&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  19.1 Essential PromQL examples
&lt;/h3&gt;

&lt;p&gt;Unavailable Deployment replicas&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="n"&gt;kube_deployment_status_replicas_unavailable&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"banking"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Container restarts over one hour&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pod&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;increase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;kube_pod_container_status_restarts_total&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"banking"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1h&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Backend HTTP 5xx error rate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;http_server_requests_seconds_count&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"banking"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=~&lt;/span&gt;&lt;span class="s2"&gt;"5.."&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The HTTP metric example assumes the application exports Micrometer metrics with the relevant labels. Confirm actual labels in Prometheus before using it.&lt;/p&gt;

&lt;p&gt;95th percentile request latency&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nf"&gt;histogram_quantile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;le&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;http_server_requests_seconds_bucket&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"banking"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This requires a compatible histogram metric with bucket data.&lt;/p&gt;

&lt;h3&gt;
  
  
  19.2 Grafana dashboards
&lt;/h3&gt;

&lt;p&gt;Students should build dashboards covering:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kubernetes cluster health.&lt;/li&gt;
&lt;li&gt;Banking backend availability.&lt;/li&gt;
&lt;li&gt;API latency and error rates.&lt;/li&gt;
&lt;li&gt;PostgreSQL connections and performance.&lt;/li&gt;
&lt;li&gt;Transaction outcomes and idempotency failures.&lt;/li&gt;
&lt;li&gt;Deployment health and rollback events.&lt;/li&gt;
&lt;li&gt;Security and authentication anomalies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use application-level metrics without exposing customer identifiers, account numbers, secrets or other sensitive financial information.&lt;/p&gt;

&lt;h3&gt;
  
  
  19.3 Alerting and incident response
&lt;/h3&gt;

&lt;p&gt;A useful alert is actionable. It identifies a symptom, severity, affected service and runbook.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="n"&gt;kube_deployment_status_replicas_unavailable&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"banking"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;deployment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"banking-backend"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This expression alone is not a complete production alert. Add a suitable evaluation duration, labels, annotations, routing and runbook link.&lt;/p&gt;

&lt;p&gt;For a banking service, prioritize user-impacting symptoms such as elevated transfer failures, sustained API 5xx rates and abnormal latency, rather than paging for every isolated Pod restart.&lt;/p&gt;

&lt;p&gt;Alerts can route through Grafana Alerting or Alertmanager to PagerDuty and approved notification channels.&lt;/p&gt;

&lt;h2&gt;
  
  
  20. Phase 16 — Production banking security
&lt;/h2&gt;

&lt;p&gt;Security is not a single Trivy step. It is a set of controls across the entire delivery and runtime lifecycle.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Security layer&lt;/th&gt;
&lt;th&gt;Required engineering controls&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Source code&lt;/td&gt;
&lt;td&gt;Reviews, branch protection, secret scanning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI/CD&lt;/td&gt;
&lt;td&gt;OIDC, least-privilege runners, pinned actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Container images&lt;/td&gt;
&lt;td&gt;Minimal images, non-root, scanning, signing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;Private ECR, restricted push/pull, retention&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes&lt;/td&gt;
&lt;td&gt;RBAC, Pod Security Standards, workload isolation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Networking&lt;/td&gt;
&lt;td&gt;Private subnets, WAF, TLS, Security Groups, NetworkPolicies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secrets&lt;/td&gt;
&lt;td&gt;AWS Secrets Manager, KMS, rotation, controlled access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;TLS, encryption, least-privilege DB roles, auditing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Identity&lt;/td&gt;
&lt;td&gt;MFA, session protection, account authorization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monitoring&lt;/td&gt;
&lt;td&gt;Audit logs, threat detection, anomaly alerting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recovery&lt;/td&gt;
&lt;td&gt;Encrypted backups, restore testing, incident plans&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  20.1 Secrets management
&lt;/h3&gt;

&lt;p&gt;Do not put database passwords into Helm values or Git.&lt;/p&gt;

&lt;p&gt;For the lab, integrate AWS Secrets Manager with a supported Kubernetes secret synchronization mechanism such as External Secrets Operator, or use an appropriate Secrets Store CSI design.&lt;/p&gt;

&lt;p&gt;Kubernetes Secrets are not automatically equivalent to a dedicated secrets manager. Their storage, access, rotation and exposure must be controlled.&lt;/p&gt;

&lt;h3&gt;
  
  
  20.2 Application security
&lt;/h3&gt;

&lt;p&gt;Because this is a banking-style system, students should also discuss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secure password storage and MFA.&lt;/li&gt;
&lt;li&gt;Authentication and session expiration.&lt;/li&gt;
&lt;li&gt;CSRF and XSS protection.&lt;/li&gt;
&lt;li&gt;Object-level authorization.&lt;/li&gt;
&lt;li&gt;Rate limiting.&lt;/li&gt;
&lt;li&gt;Secure API input validation.&lt;/li&gt;
&lt;li&gt;Transaction limits and fraud controls.&lt;/li&gt;
&lt;li&gt;Immutable or tamper-evident audit records.&lt;/li&gt;
&lt;li&gt;Separation of duties.&lt;/li&gt;
&lt;li&gt;Sensitive-data minimization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A DevOps Engineer helps provide the infrastructure controls and delivery checks. Backend and security teams own much of the application-specific implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  20.3 Supply-chain security
&lt;/h3&gt;

&lt;p&gt;An advanced version of the lab should generate an SBOM, sign container images and verify provenance before deployment.&lt;/p&gt;

&lt;p&gt;For production, image scanning should cover the actual built container image, not only &lt;code&gt;pom.xml&lt;/code&gt; and &lt;code&gt;package-lock.json&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  21. Phase 17 — On-call incident simulation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Incident: Midnight banking transfer failures
&lt;/h3&gt;

&lt;p&gt;SEV-1 simulation&lt;/p&gt;

&lt;p&gt;02:15 AM · Production-like staging environment&lt;/p&gt;

&lt;p&gt;Grafana reports elevated HTTP 503 responses from the banking API.&lt;/p&gt;

&lt;p&gt;The Kubernetes dashboard shows that all backend Pods are Running and Ready.&lt;/p&gt;

&lt;p&gt;Customers cannot complete transfers.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does the on-call DevOps/SRE Engineer do?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Acknowledge the incident&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Confirm the alert, determine impact and notify the Incident Commander according to the escalation policy.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check recent changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examine Argo CD deployment history, GitHub Actions, configuration changes, database events and network-policy updates.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify application symptoms&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Review HTTP status rates, application logs, transfer failure metrics and request latency.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Investigate Kubernetes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check Deployments, Pods, Services, EndpointSlices, DNS and recent events.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Investigate database connectivity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Coordinate with the DBA to check RDS/Aurora availability, connections, locks, failover events and database-side errors.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Restore service safely&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If a recently introduced NetworkPolicy caused the failure, revert the reviewed GitOps change or apply the authorized emergency recovery procedure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validate transaction integrity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Confirm that failed or retried transfers did not create duplicate ledger entries or inconsistent balances.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conduct a post-incident review&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Document the timeline, customer impact, root cause, contributing factors and prevention measures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Useful investigation commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods -n banking -o wide

kubectl get deploy,svc,endpointslice -n banking

kubectl get networkpolicy -n banking

kubectl describe deploy banking-backend -n banking

kubectl logs deployment/banking-backend \
  -n banking --since=20m --all-containers=true

kubectl get events -n banking \
  --sort-by=.lastTimestamp

kubectl rollout &lt;span class="nb"&gt;history&lt;/span&gt; deployment/banking-backend \
  -n banking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The incident should also demonstrate the difference between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;502 Bad Gateway: A gateway received an invalid response from an upstream.&lt;/li&gt;
&lt;li&gt;503 Service Unavailable: A service or intermediary cannot currently serve the request.&lt;/li&gt;
&lt;li&gt;504 Gateway Timeout: A gateway did not receive a timely upstream response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These statuses suggest different investigations, but their exact meaning depends on which component generated them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incident team responsibilities
&lt;/h3&gt;

&lt;p&gt;The Incident Commander coordinates response. The SRE or DevOps on-call investigates infrastructure and routing. Backend engineers examine application behavior. The DBA investigates database health. Security joins when compromise or suspicious activity is suspected.&lt;/p&gt;

&lt;p&gt;In banking, restoration must not sacrifice transaction correctness. Never blindly retry non-idempotent transfer requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  22. Phase 18 — Production interview questions and answers
&lt;/h2&gt;

&lt;p&gt;These questions cover the major topics students should be able to explain after completing the lab.&lt;/p&gt;

&lt;p&gt;Interview question bank&lt;/p&gt;

&lt;p&gt;27 questions&lt;/p&gt;

&lt;p&gt;Choose a topicCI/CD and Docker&lt;/p&gt;

&lt;p&gt;What happens after a developer pushes code?&lt;/p&gt;

&lt;p&gt;Why use multi-stage Docker builds?&lt;/p&gt;

&lt;p&gt;Why use immutable image digests?&lt;/p&gt;

&lt;p&gt;What is the difference between CI, continuous delivery and continuous deployment?&lt;/p&gt;

&lt;p&gt;Show all answersHide answers&lt;/p&gt;

&lt;h2&gt;
  
  
  23. Student implementation roadmap
&lt;/h2&gt;

&lt;p&gt;This capstone is best delivered as a multi-week project rather than one enormous deployment exercise.&lt;/p&gt;

&lt;p&gt;8-week capstone checklist&lt;/p&gt;

&lt;p&gt;0 / 8 complete&lt;/p&gt;

&lt;p&gt;Week 1 — Banking application and local development&lt;/p&gt;

&lt;p&gt;Run backend, frontend and PostgreSQL; validate transfers and test suite&lt;/p&gt;

&lt;p&gt;Week 2 — Docker and GitHub Actions&lt;/p&gt;

&lt;p&gt;Build images; configure tests, Trivy and secure CI&lt;/p&gt;

&lt;p&gt;Week 3 — AWS infrastructure and OIDC&lt;/p&gt;

&lt;p&gt;Terraform VPC, ECR, IAM roles and secure publishing&lt;/p&gt;

&lt;p&gt;Week 4 — EKS and Kubernetes fundamentals&lt;/p&gt;

&lt;p&gt;Deploy application, Services, probes, ingress and replicas&lt;/p&gt;

&lt;p&gt;Week 5 — Helm and Argo CD&lt;/p&gt;

&lt;p&gt;Create Helm chart, GitOps repository and environment promotion&lt;/p&gt;

&lt;p&gt;Week 6 — Kubernetes security and stateful workloads&lt;/p&gt;

&lt;p&gt;NetworkPolicy, RBAC, DaemonSet, StatefulSet, EBS CSI&lt;/p&gt;

&lt;p&gt;Week 7 — RDS/Aurora and database operations&lt;/p&gt;

&lt;p&gt;Private connectivity, migration, backups, failover and recovery&lt;/p&gt;

&lt;p&gt;Week 8 — Monitoring, scaling and incidents&lt;/p&gt;

&lt;p&gt;Prometheus, Grafana, HPA, PagerDuty and SEV-1 simulation&lt;/p&gt;

&lt;h3&gt;
  
  
  Final student deliverables
&lt;/h3&gt;

&lt;p&gt;Each student team should submit a GitHub application repository, a Terraform infrastructure repository, a GitOps repository, working Docker images in ECR, Helm charts, Kubernetes manifests, security policies, test results, an architecture diagram, Grafana dashboards, an incident runbook and a written post-incident report.&lt;/p&gt;

&lt;p&gt;For the final demonstration, the team should deploy a new banking application version, verify a successful transfer, intentionally introduce a controlled failure in a nonproduction environment, detect it through monitoring, restore service and explain what happened.&lt;/p&gt;

&lt;p&gt;The evaluation should measure both technical correctness and the team's ability to communicate engineering decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  24. How to describe this project in a DevOps interview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project: Production-Style Digital Banking Platform on AWS and Kubernetes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I worked on an end-to-end digital banking platform built with Java Spring Boot, React and PostgreSQL. The platform supported customer authentication, account management, banking transfers, transaction history and administrative functionality.&lt;/p&gt;

&lt;p&gt;My DevOps responsibilities included designing the CI/CD architecture, containerizing the application, integrating security scanning, configuring AWS ECR publishing and establishing the target Kubernetes deployment architecture.&lt;/p&gt;

&lt;p&gt;We used GitHub Actions to automate backend integration tests with PostgreSQL Testcontainers, frontend tests and vulnerability scanning with Trivy. We integrated GitHub Actions with AWS using OpenID Connect and IAM roles rather than storing long-lived AWS access keys.&lt;/p&gt;

&lt;p&gt;One issue we encountered was an AWS STS authentication failure caused by a mismatch between the GitHub OIDC token subject and the IAM role trust policy. We investigated the token claims, identified the mismatch and corrected the trust configuration.&lt;/p&gt;

&lt;p&gt;The broader production-style architecture uses Amazon EKS, Helm, Argo CD, Kubernetes Deployments and Services, ingress routing, RBAC, NetworkPolicies and managed PostgreSQL through RDS or Aurora. It also incorporates monitoring, alerting, autoscaling, backup planning and incident response.&lt;/p&gt;

&lt;p&gt;The project demonstrates how DevOps, backend, frontend, security, database and SRE teams collaborate to deliver reliable and secure applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When presenting this project, I distinguish the components we implemented and tested from the extended production architecture we designed for the lab.&lt;/p&gt;

&lt;h2&gt;
  
  
  25. What makes this a strong banking DevOps capstone?
&lt;/h2&gt;

&lt;p&gt;The value of this project is not simply that it uses Docker, Kubernetes, Terraform and AWS. It is that students learn how these technologies interact when something goes wrong.&lt;/p&gt;

&lt;p&gt;They learn why an application can pass local tests but fail in CI; why a GitHub workflow can have valid YAML but insufficient AWS permissions; why a Pod can be Ready while the API is unavailable; why database availability is different from transaction correctness; and why a production release requires more than a successful image build.&lt;/p&gt;

&lt;p&gt;The end goal is for every JumpToTech student to be able to explain the complete path from a developer's Git commit to a secure, observable and recoverable banking application—and demonstrate it through a working lab.&lt;/p&gt;

&lt;p&gt;This is the architectural and teaching foundation. The next implementation deliverable should be a version-controlled lab repository with executable Terraform modules, Helm templates, Argo CD Applications, Kubernetes policies, observability configurations and verified commands. The examples above are a reference design, not a substitute for deploying and validating those resources together.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Tell me about yourself.</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Fri, 06 Nov 2026 20:11:57 +0000</pubDate>
      <link>https://dev.to/jumptotech/tell-me-about-yourself-1j4</link>
      <guid>https://dev.to/jumptotech/tell-me-about-yourself-1j4</guid>
      <description>&lt;p&gt;Tell me about yourself.&lt;br&gt;
I am DevOps Engineer with more than 5 years experience. I started at Southwest Airlines as Cloud Engineer, and after one year I got promoted to DevOps Engineer. Since September 2023 I work at Capital One. Mostly I work with AWS, Kubernetes, Terraform and GitLab CI/CD. I also used Azure, and monitoring tools like Prometheus, Grafana and Datadog. I support production, do on-call, and work on reliability, security and cost. I like to automate manual work and help developers ship apps safely.&lt;br&gt;
Why BigTime?&lt;br&gt;
You are building AI-powered platform, and I think AI brings many good opportunities for DevOps. Your stack is AWS, Kubernetes, Terraform and GitLab, and this is what I work with every day. I also like that engineers get ownership and solve problems independently.&lt;br&gt;
What is your day to day?&lt;br&gt;
In the morning I check alerts and dashboards in Datadog and Grafana. Then standup. Most of the day I work on Terraform, GitLab pipelines and deployments to EKS with Helm. I help developers when deployments fail. I do patching, upgrades, cost and security work. When I am on-call, I handle incidents. I update documentation in Confluence.&lt;br&gt;
Tell me about a hard production incident.&lt;br&gt;
After a release we had 60 replicas in 3 Availability Zones, and HTTP 500 errors went up to 18 percent. I was the on-call engineer. I checked dashboards, logs, Kubernetes deployment status and the deployment history. The errors started with the release, so we rolled back to the last stable version. I checked that pods were healthy and the error rate went down. Root cause was wrong database connection setting in the new version. After this I added canary deployments, smoke tests in the pipeline, automatic rollback on high error rate, and wrote a postmortem and runbook.&lt;br&gt;
How do you replace long-lived credentials?&lt;br&gt;
I move secrets to Vault or AWS Secrets Manager with automatic rotation. Apps on EKS use IAM roles for service accounts, so pods get short-lived credentials. GitLab pipelines use OIDC to assume IAM roles, no static AWS keys. EC2 and Windows servers use instance roles. For RDS, passwords are in Secrets Manager with rotation. This helps with SOC 2 audits too.&lt;br&gt;
Windows EC2 in production, you cannot RDP, and you cannot restart. What do you do?&lt;br&gt;
First I check if the app still works for users, maybe only RDP is broken. I check status checks, security group port 3389, NACL, route table, and the Route 53 record. Then I use SSM Session Manager or Run Command with PowerShell. I check if the RDP service is running and restart only this service, check Windows firewall, CPU, memory and disk space. I look at the console screenshot, system log and CloudWatch metrics. If restart is really needed, I take a snapshot, move traffic to other instances behind the load balancer, talk to the team, and do it in a maintenance window.&lt;br&gt;
How did you save $160K?&lt;br&gt;
I added cost allocation tags so we see who spends what. I rightsized big EC2 instances, turned off dev and test at night and weekends, cleaned unused EBS volumes, snapshots and load balancers. S3 lifecycle policies to cheaper storage. Better EKS node sizing and autoscaling. Savings Plans and Reserved Instances for stable workloads. Budgets and alerts in Cost Explorer and CloudWatch.&lt;br&gt;
How did you reduce MTTD by 25 percent?&lt;br&gt;
I made better dashboards in Grafana and Datadog for each service. Alerts based on real symptoms like error rate, latency and pod restarts. I removed noisy alerts so the team trusts them. I added health checks and synthetic monitoring. Alerts go to PagerDuty and Slack with runbook links.&lt;br&gt;
Biggest issue you fixed with Grafana?&lt;br&gt;
Booking service on EKS was slow every few days. I made a dashboard with memory, restarts and latency together. Memory went up slowly, then pods got OOMKilled and latency jumped. It was a memory leak and low memory limits. Developers fixed the leak, I fixed requests and limits and added alerts for memory growth and restarts.&lt;br&gt;
What are the RDS replication types?&lt;br&gt;
Multi-AZ is synchronous replication to a standby in another Availability Zone, for high availability and automatic failover, you cannot read from it. Read Replicas are asynchronous, for scaling reads and reporting, can be cross-region, and can be promoted for disaster recovery. SQL Server Multi-AZ uses Always On or mirroring.&lt;br&gt;
RDS vs Aurora?&lt;br&gt;
Standard RDS is managed database with its own EBS storage per instance. Aurora is AWS cloud database for MySQL and PostgreSQL. Storage is shared and separate from compute, data copied 6 times across 3 Availability Zones, storage grows automatically. Up to 15 replicas with very low lag, failover under 30 seconds. Aurora is faster but more expensive. Aurora does not support SQL Server.&lt;br&gt;
GitLab pipeline with two different AWS roles, how do you configure?&lt;br&gt;
I use GitLab OIDC. The job gets an ID token and assumes IAM role. Role one is read-only for terraform plan, runs on merge requests. Role two has write permissions for apply and deploy, and the trust policy allows only main branch, protected branch and production environment. Stages are validate, plan, apply, deploy. Apply is manual approval with the saved plan. Deploy updates kubeconfig and runs helm upgrade. In EKS I map the role to RBAC with access entries, so it deploys only to its namespaces.&lt;br&gt;
What happens when you type bigtime.net in browser?&lt;br&gt;
DNS finds the IP with UDP port 53, through the resolver to Route 53. Then TCP three-way handshake, SYN, SYN-ACK, ACK. Then TLS handshake on port 443, server sends certificate and they agree on keys. Then HTTP GET request. Traffic goes through CloudFront or load balancer, then to EC2 or EKS, and the app talks to RDS. Response comes back and browser shows the page.&lt;br&gt;
How do you make sure the app uses S3 securely, encryption in transit?&lt;br&gt;
Bucket policy denies requests when aws:SecureTransport is false, so only HTTPS. I can require TLS 1.2 with s3:TlsVersion. App uses IAM role, least privilege, no keys. VPC gateway endpoint so traffic stays private, and bucket policy limited to this endpoint. Block Public Access on. Check with CloudTrail and AWS Config rule s3-bucket-ssl-requests-only.&lt;br&gt;
Some S3 objects are not encrypted with your KMS key, why and how to fix?&lt;br&gt;
Default encryption works only for new objects, so old objects keep old encryption. Also if the client sends its own encryption header, it overrides the default. I find them with S3 Inventory. I re-encrypt with S3 Batch Operations copy in place. To prevent, bucket policy denies PutObject if encryption is not aws:kms or the key ID is not my key ARN. KMS key policy allows only the right roles. AWS Config for monitoring.&lt;br&gt;
Same Terraform module in dev and prod, you add an IP range, dev plan is clean, prod plan wants to destroy route table associations. Why?&lt;br&gt;
The module uses count with a list. Terraform tracks resources by index. In prod the list is longer or in different order, so new item shifts indexes and Terraform wants to destroy and recreate. Fix is for_each with stable keys like the IP range. Use moved blocks or terraform state mv to move existing resources without destroy. Add prevent_destroy on critical resources, and require approval in the pipeline if prod plan shows destroy. Also check drift with plan -refresh-only and provider versions.&lt;br&gt;
Kubernetes app gets 502 for about 10 seconds during every deployment. Readiness probe is present. What do you check?&lt;br&gt;
Most likely old pods shutting down. Kubernetes sends SIGTERM and removes the pod at the same time, but the load balancer still sends traffic for few seconds. Fix is preStop hook with sleep 10 to 15 seconds, app handles SIGTERM gracefully, terminationGracePeriodSeconds longer than the sleep. Rolling update with maxUnavailable 0 and maxSurge 1. With ALB, enable pod readiness gates and check deregistration delay and keep-alive timeout. Add PodDisruptionBudget. Check ALB logs and pod events.&lt;br&gt;
How do you use AI in your work?&lt;br&gt;
I use chat for quick questions and errors. For bigger tasks I use AI agents like Claude Code. It reads the repo, makes a plan, changes Terraform or pipelines, and runs terraform plan or tests. I review the plan and the changes before merge. Agents use tools through MCP and need limited permissions, like read-only in prod and no apply without human approval. I never put secrets or customer data into AI tools.&lt;/p&gt;

&lt;p&gt;Next round they may also ask these, because they are in the job description:&lt;/p&gt;

&lt;p&gt;How do you deploy and monitor .NET apps?&lt;br&gt;
I build the app in GitLab CI with dotnet build and dotnet test, then package it. For Windows on EC2, I deploy with PowerShell scripts or SSM Run Command to IIS, and take the server out of the load balancer during deploy. For Linux, I put .NET Core in Docker and deploy to EKS or ECS with Helm. For monitoring I use CloudWatch agent for Windows logs and IIS logs, and Datadog APM or OpenTelemetry for traces, errors and response time.&lt;br&gt;
How do you patch Windows and Linux servers?&lt;br&gt;
I use AWS Systems Manager Patch Manager with patch baselines and maintenance windows. First patch dev and test, then prod. For prod, I patch in groups, so not all servers behind the load balancer go down at once. Before patching I take snapshots. After patching I check the app health and the compliance report in SSM. For EKS nodes I update the AMI and do rolling node replacement.&lt;br&gt;
EKS vs ECS vs App Runner?&lt;br&gt;
EKS is Kubernetes, more control and flexible, good for complex apps, but more work to manage. ECS is AWS own container service, simpler, works well with Fargate and other AWS services. App Runner is the simplest, you give it image or code, and AWS handles everything, good for small web apps and APIs.&lt;br&gt;
What is Helmfile?&lt;br&gt;
Helmfile manages many Helm releases in one file. You define all charts, versions and values for each environment in one place, and run helmfile apply. It is good for keeping environments consistent and works well in CI/CD.&lt;br&gt;
What is Terragrunt and why use it?&lt;br&gt;
Terragrunt is a wrapper for Terraform. It keeps the code DRY, so you don’t copy the same backend and provider config in every environment. It manages remote state config, dependencies between modules, and lets you run plan or apply across many modules and accounts.&lt;br&gt;
How do you help with SOC 2?&lt;br&gt;
I make sure access is least privilege with IAM roles and SSO, encryption at rest with KMS and in transit with TLS, logs in CloudTrail and CloudWatch, vulnerability scanning with Inspector or image scanning in the pipeline, and patching. I keep evidence and documentation ready for auditors, like access reviews and change history from GitLab merge requests.&lt;br&gt;
What is your disaster recovery approach?&lt;br&gt;
First we agree on RTO and RPO with the business. Backups for RDS with automated snapshots and cross-region copies, S3 versioning and replication, all infrastructure in Terraform so we can rebuild fast. We write a DR runbook and test it, because a plan that is not tested does not work.&lt;br&gt;
Have you worked with Lambda?&lt;br&gt;
Yes, I used Lambda for automation, like stopping dev instances at night, cleaning old snapshots, and processing S3 events. I deploy it with Terraform, give it a small IAM role, and monitor with CloudWatch logs and alarms for errors and duration.&lt;br&gt;
What is Ansible used for?&lt;br&gt;
Configuration management. It connects to servers over SSH for Linux or WinRM for Windows, and runs playbooks to install software, change config and patch. It is agentless and idempotent, so you can run it many times and it gives the same result.&lt;br&gt;
Biggest weakness?&lt;br&gt;
Sometimes I go too deep into a problem and want to fix it myself. Now I set a time limit, and if I don’t solve it, I ask the team early.&lt;br&gt;
Where do you see yourself in 3 to 5 years?&lt;br&gt;
I want to grow into Senior or Lead DevOps Engineer, own bigger parts of the platform, and help build automation and AI tools for the team.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>career</category>
      <category>devops</category>
      <category>terraform</category>
    </item>
    <item>
      <title>HERC RENTALS INTERVIEW PREP Cloud and Platform Engineering Manager WHAT WE LEARNED IN ROUND ONE</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Fri, 06 Nov 2026 20:09:53 +0000</pubDate>
      <link>https://dev.to/jumptotech/herc-rentals-interview-prepcloud-and-platform-engineering-managerwhat-we-learned-in-round-one-3jc3</link>
      <guid>https://dev.to/jumptotech/herc-rentals-interview-prepcloud-and-platform-engineering-managerwhat-we-learned-in-round-one-3jc3</guid>
      <description>&lt;p&gt;HERC RENTALS INTERVIEW PREP&lt;br&gt;
Cloud and Platform Engineering Manager&lt;/p&gt;

&lt;p&gt;WHAT WE LEARNED IN ROUND ONE&lt;/p&gt;

&lt;p&gt;Team is 5 engineers, all senior and technically strong.&lt;br&gt;
Main problem is no clear structure or daily plan, people work in different directions.&lt;br&gt;
App teams do not fully understand the pipelines and need a simple standard path.&lt;br&gt;
Architecture and infra decisions are made together as a team, but there is no formal process.&lt;br&gt;
They use EKS for many microservices and ECS Fargate for small apps.&lt;br&gt;
Identity is Okta.&lt;br&gt;
AI is still at concept stage, integrating into backend apps, user access is limited, and they are careful because people misuse it.&lt;br&gt;
The manager wants someone who observes the current process first, finds gaps day to day, works close with another manager, and removes leadership blockers.&lt;br&gt;
Job post clouds are AWS, Azure, OCI with Terraform, CloudFormation and Bicep.&lt;br&gt;
Job is on-site in Bonita Springs, Florida.&lt;/p&gt;

&lt;p&gt;YOUR PITCH, TELL ME ABOUT YOURSELF&lt;/p&gt;

&lt;p&gt;Thank you for having me again. I am a DevOps engineer with more than five years of experience on AWS. Four years at Yelp and now at Zulily. My daily work is Terraform, Kubernetes on EKS, GitHub Actions pipelines and CloudWatch monitoring. At Yelp I improved deployment speed by 35 percent with blue-green deployments and automatic rollback. I also mentored junior engineers, wrote runbooks and helped onboard new people, and that is the part I enjoy most. In our first conversation I learned your team is very senior but needs structure and a clear path for app teams. That is exactly what I like to build. I want to stay hands-on and also help the team move in one direction.&lt;/p&gt;

&lt;p&gt;Numbers to remember: 5 plus years, 35 percent faster deployments, CKAD January 2025, AWS Solutions Architect Associate August 2026.&lt;/p&gt;

&lt;p&gt;LEADERSHIP ANSWERS&lt;/p&gt;

&lt;p&gt;What is your leadership experience?&lt;br&gt;
I have not been a formal manager with direct reports yet. But at Yelp I mentored junior engineers, onboarded new people, wrote runbooks and led knowledge sharing. A team of five is a good size for me, I can coach and still be hands-on.&lt;/p&gt;

&lt;p&gt;How would you lead senior engineers?&lt;br&gt;
I would not micromanage. I give clear goals and priorities, and each senior person owns one area, like Terraform, CI/CD or EKS. I stay hands-on with them on hard problems. Senior people want trust and direction, not control.&lt;/p&gt;

&lt;p&gt;How do you resolve conflict between two engineers?&lt;br&gt;
I bring both together and let each explain without interrupting. We go back to the goal, cost, security, reliability or time. I ask for facts, data or a small proof of concept. If they still disagree, I decide, explain why, and write it down. Then we disagree and commit. At Yelp two engineers disagreed on speed versus safety, and we chose blue-green with automatic rollback, which gave us 35 percent faster deployments.&lt;/p&gt;

&lt;p&gt;One engineer is not meeting expectations, what do you do?&lt;br&gt;
Private one on one first, I listen and ask what is going on. Then I make expectations clear with examples and small goals with dates. I give support, pair them with a strong engineer and remove blockers. Weekly check-ins. If no progress, I work with HR on a fair, documented plan.&lt;/p&gt;

&lt;p&gt;How do you prioritize when everything is urgent?&lt;br&gt;
Business impact and risk. Production and security issues first, then work that unblocks app teams, then improvements. I agree on top priorities with my manager every week so the team is not pulled in many directions.&lt;/p&gt;

&lt;p&gt;How do you report to leadership?&lt;br&gt;
Short and simple. A monthly update with roadmap, risks, cloud cost trend, and a few metrics like deployment frequency, failed changes, incidents and time to recover.&lt;/p&gt;

&lt;p&gt;How do you handle an outage as the escalation point?&lt;br&gt;
First stop the impact with rollback or failover. Update people every 30 minutes. One person leads, others fix. After, a blameless postmortem with clear action items and owners.&lt;/p&gt;

&lt;p&gt;TECHNICAL ANSWERS FROM ROUND ONE&lt;/p&gt;

&lt;p&gt;Recent architecture you deployed?&lt;br&gt;
At Zulily, an app on EKS with DocumentDB. VPC across multiple availability zones. Public subnets only for the load balancer, private subnets for EKS nodes and the database. Route 53 to the load balancer with TLS, then to pods. DocumentDB is private, only the app security group can reach it, IAM least privilege. HPA adds pods, Cluster Autoscaler adds nodes, so it grows during sales and shrinks after. Everything in Terraform modules, same code for dev, staging and prod. GitHub Actions with tests, terraform plan review and approval before prod. CloudWatch for alerts.&lt;/p&gt;

&lt;p&gt;Kubernetes experience?&lt;br&gt;
Four years on EKS at Yelp and now Zulily, CKAD certified. Helm charts so every team deploys the same way. Liveness and readiness probes for self-healing. HPA and Cluster Autoscaler. I troubleshoot CrashLoopBackOff, image pull errors and resource limits with kubectl describe, logs and events.&lt;/p&gt;

&lt;p&gt;EKS versus ECS Fargate?&lt;br&gt;
EKS fits many microservices, more control, Helm, one deployment pattern. Fargate fits small apps, no nodes to manage, less work. My hands-on is EKS, ECS is new for me but the ideas are very close.&lt;/p&gt;

&lt;p&gt;Event based architecture and Lambda?&lt;br&gt;
Services do not call each other directly, one sends an event and others react. EventBridge routes events, SNS sends to many, SQS queues so nothing is lost, Lambda runs code when an event comes. Watch the 15 minute timeout, memory, cold starts, IAM role, dead letter queues, and make processing safe to run twice. I am familiar, but have not built big systems myself.&lt;/p&gt;

&lt;p&gt;Identity?&lt;br&gt;
AWS IAM roles and least privilege. GitHub Actions deploys with IAM roles, no long term keys. IAM roles for Kubernetes service accounts on EKS. Okta and Active Directory I know the ideas, single sign on, MFA, groups mapped to AWS roles through IAM Identity Center.&lt;/p&gt;

&lt;p&gt;How do you use AI?&lt;br&gt;
Claude AI daily as a helper. Draft pipelines, review Terraform, explain errors, write documentation. Always review and test, never share secrets or customer data. I agree with your careful approach, start small, approved tools, human review, and guardrails like logging and access control.&lt;/p&gt;

&lt;p&gt;NEW TOPICS LIKELY IN ROUND TWO&lt;/p&gt;

&lt;p&gt;Landing zones&lt;br&gt;
Key words: AWS Organizations, Control Tower, separate accounts per environment, SCPs, central logging.&lt;br&gt;
Answer: A landing zone is the secure starting setup for all cloud accounts. Separate accounts for prod, non-prod, security and logging, with guardrails so teams cannot break the rules.&lt;/p&gt;

&lt;p&gt;Azure basics&lt;br&gt;
Key words: subscriptions, resource groups, VNet, AKS, Entra ID, Bicep.&lt;br&gt;
Answer: Azure is very similar to AWS. VNet is like VPC, AKS is like EKS, Entra ID is like IAM, Bicep is like CloudFormation. Terraform works on both.&lt;/p&gt;

&lt;p&gt;OCI basics&lt;br&gt;
Key words: tenancy, compartments, VCN, OKE.&lt;br&gt;
Answer: OCI uses compartments to organize resources, VCN is like VPC, OKE is their Kubernetes. Often used for Oracle databases and ERP.&lt;/p&gt;

&lt;p&gt;Terraform at scale&lt;br&gt;
Key words: modules, remote state, state locking, separate folders per environment, plan review in pull request.&lt;br&gt;
Answer: I already do this at Zulily with S3 state and DynamoDB locking. The same pattern works with Azure and OCI providers.&lt;/p&gt;

&lt;p&gt;Hybrid networking&lt;br&gt;
Key words: site to site VPN, Direct Connect, ExpressRoute, Transit Gateway, private DNS.&lt;br&gt;
Answer: It connects on-prem to cloud. VPN is quick and cheap, Direct Connect or ExpressRoute is private and faster for production.&lt;/p&gt;

&lt;p&gt;Disaster recovery&lt;br&gt;
Key words: RTO, RPO, backup and restore, pilot light, warm standby, multi-region.&lt;br&gt;
Answer: RTO is how fast we recover, RPO is how much data we can lose. We choose the strategy by business need and cost, and we test restores regularly.&lt;/p&gt;

&lt;p&gt;Cloud cost, FinOps&lt;br&gt;
Key words: tagging, right-sizing, Savings Plans, Reserved Instances, spot, Cost Explorer, budgets and alerts.&lt;br&gt;
Answer: First tag everything so we know who spends what. Then right-size, turn off unused dev at night, Savings Plans for steady work, spot for flexible work. Monthly cost report to leadership.&lt;/p&gt;

&lt;p&gt;Security&lt;br&gt;
Key words: Secrets Manager, KMS encryption, GuardDuty, Security Hub, image scanning, CIS benchmarks.&lt;br&gt;
Answer: Least privilege, encrypt everything, no secrets in code, scan images in the pipeline, and work with the security team to fix findings by priority.&lt;/p&gt;

&lt;p&gt;Observability&lt;br&gt;
Key words: metrics, logs, traces, CloudWatch, Datadog, Prometheus and Grafana, alert fatigue.&lt;br&gt;
Answer: Alert only on what users feel, every alert has a runbook, same dashboards across clouds.&lt;/p&gt;

&lt;p&gt;Self-service platform&lt;br&gt;
Key words: golden path, pipeline templates, Helm and Terraform modules, developer portal like Backstage.&lt;br&gt;
Answer: App teams get a standard template and can deploy alone, the platform team keeps guardrails. This fixes the pipeline confusion they told us about.&lt;/p&gt;

&lt;p&gt;Vendors and managed services&lt;br&gt;
Key words: SLAs, quarterly reviews, cost, escalation path.&lt;br&gt;
Answer: Clear SLAs, regular review meetings, and our team still understands what the vendor runs.&lt;/p&gt;

&lt;p&gt;HONEST GAP ANSWERS&lt;/p&gt;

&lt;p&gt;Pattern for every gap: say honestly you have not done it in production, show you know the idea, connect it to something you did, end with how fast you learn.&lt;/p&gt;

&lt;p&gt;Formal manager: Not formal yet, but mentoring, onboarding, runbooks and knowledge sharing at Yelp. Ready for the next step.&lt;br&gt;
Azure and OCI: Not in production, my work is AWS. Concepts map one to one and Terraform works on all three, so I can be productive fast.&lt;br&gt;
Bicep and CloudFormation: Terraform is my main tool. Same idea, declare resources, review the plan, deploy.&lt;br&gt;
ECS: Hands-on is EKS. ECS task definitions and services are close to Kubernetes deployments.&lt;br&gt;
Active Directory and Okta: Not managed them, but I know single sign on, MFA, groups mapped to cloud roles. Strong IAM background.&lt;br&gt;
Event driven and Lambda at scale: Familiar, not built big systems. I can support it with Terraform, IAM and monitoring.&lt;br&gt;
FinOps and DR ownership: Have not owned it fully, familiar with right-sizing, Savings Plans, backup and restore testing, RTO and RPO.&lt;br&gt;
Vendor management: Not owned vendor contracts yet, but I know the basics, clear SLAs and regular reviews.&lt;/p&gt;

&lt;p&gt;30 60 90 DAY PLAN&lt;/p&gt;

&lt;p&gt;First 30 days, listen and learn. One on one with each of the 5 engineers and the other manager. Sit with app teams and watch where they get stuck with pipelines. Review the AWS, Azure and OCI setup, Terraform code, incidents and cloud cost. Write a gap list and agree on top priorities with my manager.&lt;/p&gt;

&lt;p&gt;Days 31 to 60, quick wins and structure. Weekly planning and a short daily sync so work is visible. Each senior engineer owns one area. Simple design doc and weekly design review for bigger decisions. First standard pipeline template for app teams.&lt;/p&gt;

&lt;p&gt;Days 61 to 90, scale it. Golden path documentation and runbooks so app teams onboard alone. Monthly report to leadership with roadmap, risks, cost and delivery metrics. Plan for cost tagging, DR testing and safe AI tools.&lt;/p&gt;

&lt;p&gt;QUESTIONS TO ASK&lt;/p&gt;

&lt;p&gt;Do not repeat what they already answered: team size, seniority, Okta, EKS and ECS, AI stage.&lt;/p&gt;

&lt;p&gt;For the hiring manager or director:&lt;br&gt;
What would make you say after 6 months, this was the right hire?&lt;br&gt;
How is work split between AWS, Azure and OCI, and is there a plan to consolidate?&lt;br&gt;
How does this role divide work with the other manager?&lt;br&gt;
What is the biggest risk on the platform today?&lt;/p&gt;

&lt;p&gt;For engineers on the team:&lt;br&gt;
What slows you down most in a normal week?&lt;br&gt;
How do app teams ask you for help today, tickets, Slack or meetings?&lt;br&gt;
What would you want from a new manager?&lt;/p&gt;

&lt;p&gt;For HR or recruiter:&lt;br&gt;
Is there relocation support for the move to Bonita Springs?&lt;br&gt;
Is there a leadership program for new managers?&lt;br&gt;
What are the next steps and timeline?&lt;/p&gt;

&lt;p&gt;LOGISTICS AND FINAL TIPS&lt;/p&gt;

&lt;p&gt;Relocation: have a clear yes and a realistic start date ready, because you live in Vancouver, WA and the job is on-site in Florida.&lt;br&gt;
Salary: research the range for cloud engineering managers in Southwest Florida and give a range, not one number.&lt;br&gt;
About Herc: they rent equipment to construction, industrial and event customers. Read their latest news the day before and mention one recent fact.&lt;br&gt;
Every answer: short, one real example, end with a question.&lt;br&gt;
Use their words back: structure, observe first, golden path for app teams, careful with AI. It shows you listened.&lt;br&gt;
Send a thank you email the same day and mention one thing you discussed.&lt;br&gt;
Practice the pitch out loud three times.&lt;br&gt;
Practice the Azure and OCI mapping to AWS.&lt;br&gt;
Prepare one outage story and one cost saving idea.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>cloud</category>
      <category>interview</category>
      <category>management</category>
    </item>
    <item>
      <title>JumpToTech DevOps/SRE Capstone Project: EstateFlow — Enterprise AWS EKS, CI/CD, Production Operations &amp; Incident Response</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Fri, 06 Nov 2026 04:02:22 +0000</pubDate>
      <link>https://dev.to/jumptotech/jumptotech-devopssre-capstone-project-estateflow-enterprise-aws-eks-production-environment-54gl</link>
      <guid>https://dev.to/jumptotech/jumptotech-devopssre-capstone-project-estateflow-enterprise-aws-eks-production-environment-54gl</guid>
      <description>&lt;p&gt;&lt;strong&gt;Level:&lt;/strong&gt; Beginner to Advanced DevOps/SRE&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Project:&lt;/strong&gt; EstateFlow — Real Estate Management Platform&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Environment:&lt;/strong&gt; Local Docker Compose and AWS EKS Training Environment&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Roles:&lt;/strong&gt; DevOps Engineer, Site Reliability Engineer, Platform Engineer&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Welcome to EstateFlow
&lt;/h2&gt;

&lt;p&gt;Imagine you have joined a real estate technology company as a DevOps Engineer.&lt;/p&gt;

&lt;p&gt;The developers have already built an application where customers can browse properties, view listings, and manage real estate information.&lt;/p&gt;

&lt;p&gt;Your responsibility is to take ownership of the infrastructure and deployment process.&lt;/p&gt;

&lt;p&gt;You will learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand an existing application and its dependencies.&lt;/li&gt;
&lt;li&gt;Run the application locally using Docker Compose.&lt;/li&gt;
&lt;li&gt;Build and test Docker images.&lt;/li&gt;
&lt;li&gt;Automate CI/CD with GitHub Actions.&lt;/li&gt;
&lt;li&gt;Deploy containerized workloads to Amazon EKS.&lt;/li&gt;
&lt;li&gt;Configure networking, storage, and AWS permissions.&lt;/li&gt;
&lt;li&gt;Troubleshoot real-world Kubernetes incidents.&lt;/li&gt;
&lt;li&gt;Perform daily operational checks.&lt;/li&gt;
&lt;li&gt;Communicate during incidents and document your findings.&lt;/li&gt;
&lt;li&gt;Prepare for technical DevOps/SRE interviews.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This is not just a Kubernetes deployment exercise. It is an end-to-end engineering training project.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2. GitHub Repository — Source of Truth
&lt;/h2&gt;

&lt;p&gt;All application code, infrastructure configurations, scripts, and detailed engineering documentation are maintained in the EstateFlow GitHub repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/jumptotechschooldevops/jumptotech-estateflow" rel="noopener noreferrer"&gt;JumpToTech EstateFlow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start Here:&lt;/strong&gt; &lt;a href="https://github.com/jumptotechschooldevops/jumptotech-estateflow/tree/main/docs" rel="noopener noreferrer"&gt;Engineering Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This DEV Community article explains the project, engineering responsibilities, learning path, and practical scenarios.&lt;/p&gt;

&lt;p&gt;For exact deployment commands, Kubernetes manifests, CI/CD configuration, and troubleshooting procedures, follow the GitHub documentation.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Understand the Application Architecture
&lt;/h2&gt;

&lt;p&gt;EstateFlow is a full-stack property listing application.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;React, TypeScript, Vite, NGINX&lt;/td&gt;
&lt;td&gt;User interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;Node.js, Express&lt;/td&gt;
&lt;td&gt;REST API and business logic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;Persistent property data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cache&lt;/td&gt;
&lt;td&gt;Redis&lt;/td&gt;
&lt;td&gt;Cache property reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Containers&lt;/td&gt;
&lt;td&gt;Docker&lt;/td&gt;
&lt;td&gt;Package application services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local environment&lt;/td&gt;
&lt;td&gt;Docker Compose&lt;/td&gt;
&lt;td&gt;Run application dependencies together&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud platform&lt;/td&gt;
&lt;td&gt;AWS EKS&lt;/td&gt;
&lt;td&gt;Kubernetes orchestration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Container registry&lt;/td&gt;
&lt;td&gt;Amazon ECR&lt;/td&gt;
&lt;td&gt;Store container images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persistent storage&lt;/td&gt;
&lt;td&gt;Amazon EBS&lt;/td&gt;
&lt;td&gt;Store PostgreSQL data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image storage&lt;/td&gt;
&lt;td&gt;Amazon S3&lt;/td&gt;
&lt;td&gt;Store property images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CI/CD&lt;/td&gt;
&lt;td&gt;GitHub Actions&lt;/td&gt;
&lt;td&gt;Build, test, scan, and deploy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;IAM, IRSA, NetworkPolicy&lt;/td&gt;
&lt;td&gt;Control access and communication&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Request flow
&lt;/h3&gt;

&lt;p&gt;For local Docker Compose development:&lt;/p&gt;

&lt;p&gt;Browser → NGINX Frontend → Express Backend → PostgreSQL / Redis&lt;/p&gt;

&lt;p&gt;NGINX serves the frontend application and proxies &lt;code&gt;/api/*&lt;/code&gt; requests to the backend.&lt;/p&gt;

&lt;p&gt;For the AWS EKS environment, the repository provides Kubernetes resources for frontend, backend, PostgreSQL, Redis, Services, Ingress, and NetworkPolicy.&lt;/p&gt;

&lt;p&gt;The exact external request path depends on the deployed Ingress and load balancer configuration.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Phase One — Start Like a DevOps Engineer
&lt;/h2&gt;

&lt;p&gt;In a real engineering team, your first responsibility is to understand the environment before making changes.&lt;/p&gt;

&lt;p&gt;Verify your tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws --version
kubectl version --client
docker --version
git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify your AWS identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sts get-caller-identity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the Kubernetes environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl config current-context
kubectl get nodes
kubectl get pods -A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Interview question:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What do you check before making changes to production infrastructure?&lt;/p&gt;

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

&lt;p&gt;"First, I verify the AWS account, region, Kubernetes context, and namespace. Then I review the health of the application, recent deployments, and existing incidents. I want to understand the current state before making changes."&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Phase Two — Run EstateFlow Locally
&lt;/h2&gt;

&lt;p&gt;The repository provides a Docker Compose environment containing frontend, backend, PostgreSQL, and Redis.&lt;/p&gt;

&lt;p&gt;Clone the repository and open the project directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cp .env.example .env
docker compose config
docker compose up --build -d
docker compose ps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default local application URLs are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend: &lt;code&gt;http://localhost:8080&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Backend API: &lt;code&gt;http://localhost:5000/api&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;API through NGINX: &lt;code&gt;http://localhost:8080/api&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -i http://localhost:8080
curl -i http://localhost:8080/api/health
curl -i http://localhost:8080/api/properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Engineering responsibility
&lt;/h3&gt;

&lt;p&gt;Do not immediately blame Kubernetes when an application fails.&lt;/p&gt;

&lt;p&gt;First verify whether the application works in a controlled local environment.&lt;/p&gt;

&lt;p&gt;This helps distinguish application problems from infrastructure problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Phase Three — CI/CD and Container Security
&lt;/h2&gt;

&lt;p&gt;The repository includes GitHub Actions workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.github/workflows/ci.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Students should inspect these workflows to understand the actual build, test, security, and deployment stages.&lt;/p&gt;

&lt;p&gt;Important concepts include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull requests and code review&lt;/li&gt;
&lt;li&gt;Automated tests and linting&lt;/li&gt;
&lt;li&gt;Docker image builds&lt;/li&gt;
&lt;li&gt;Container vulnerability scanning&lt;/li&gt;
&lt;li&gt;Amazon ECR&lt;/li&gt;
&lt;li&gt;AWS authentication&lt;/li&gt;
&lt;li&gt;Deployment automation&lt;/li&gt;
&lt;li&gt;Rollback planning&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interview question
&lt;/h3&gt;

&lt;p&gt;What happens when a developer creates a pull request?&lt;/p&gt;

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

&lt;p&gt;"Our CI pipeline validates the code before it is merged. We run the configured checks, including tests and security scanning. If a required check fails, we investigate before allowing the change to proceed."&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Phase Four — Deploy to Amazon EKS
&lt;/h2&gt;

&lt;p&gt;The repository maintains Kubernetes configurations under:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;infra/k8s/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace and application configuration&lt;/li&gt;
&lt;li&gt;Kubernetes Secrets example&lt;/li&gt;
&lt;li&gt;PostgreSQL StatefulSet&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Backend and frontend Deployments&lt;/li&gt;
&lt;li&gt;Ingress&lt;/li&gt;
&lt;li&gt;Horizontal Pod Autoscaler&lt;/li&gt;
&lt;li&gt;NetworkPolicy&lt;/li&gt;
&lt;li&gt;Kustomize configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start with the repository's &lt;code&gt;infra/k8s/README.md&lt;/code&gt; and deployment guides.&lt;/p&gt;

&lt;p&gt;Before deploying, verify your AWS account, cluster, namespace, image references, storage requirements, and permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; The existence of a Kubernetes YAML file does not prove that a resource is deployed or healthy. Students must validate the actual environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Phase Five — Kubernetes Networking
&lt;/h2&gt;

&lt;p&gt;A DevOps Engineer must understand how applications communicate.&lt;/p&gt;

&lt;p&gt;Key topics include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pod IP addresses&lt;/li&gt;
&lt;li&gt;ClusterIP Services&lt;/li&gt;
&lt;li&gt;Headless Services&lt;/li&gt;
&lt;li&gt;CoreDNS&lt;/li&gt;
&lt;li&gt;Kubernetes Endpoints and EndpointSlices&lt;/li&gt;
&lt;li&gt;Ingress&lt;/li&gt;
&lt;li&gt;AWS Application Load Balancer&lt;/li&gt;
&lt;li&gt;NetworkPolicy&lt;/li&gt;
&lt;li&gt;Security Groups&lt;/li&gt;
&lt;li&gt;TCP ports and DNS resolution&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Practical troubleshooting scenario
&lt;/h3&gt;

&lt;p&gt;A backend application cannot connect to PostgreSQL.&lt;/p&gt;

&lt;p&gt;The PostgreSQL Service exists, but the application reports database connectivity failures.&lt;/p&gt;

&lt;p&gt;What should you investigate?&lt;/p&gt;

&lt;p&gt;First, establish the actual failure.&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 -n YOUR_NAMESPACE
kubectl get svc -n YOUR_NAMESPACE
kubectl get endpointslice -n YOUR_NAMESPACE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check Pod events and application 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 describe pod YOUR_POSTGRES_POD -n YOUR_NAMESPACE
kubectl logs YOUR_BACKEND_POD -n YOUR_NAMESPACE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then investigate DNS resolution, TCP connectivity, NetworkPolicy, and database authentication as indicated by the symptoms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interview answer:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"I troubleshoot the connection layer by layer. I first confirm that the database Pod is scheduled and healthy, and that the Service has ready endpoints. Then I test DNS resolution and TCP connectivity. If networking works, I investigate credentials, database configuration, and application logs."&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Phase Six — PostgreSQL and Persistent Storage
&lt;/h2&gt;

&lt;p&gt;PostgreSQL requires persistent storage because database information must survive container replacement.&lt;/p&gt;

&lt;p&gt;The EstateFlow Kubernetes configuration uses a StatefulSet with a PersistentVolumeClaim.&lt;/p&gt;

&lt;p&gt;Students should understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;StatefulSet versus Deployment&lt;/li&gt;
&lt;li&gt;PersistentVolume and PersistentVolumeClaim&lt;/li&gt;
&lt;li&gt;StorageClass&lt;/li&gt;
&lt;li&gt;Amazon EBS CSI driver&lt;/li&gt;
&lt;li&gt;ReadWriteOnce&lt;/li&gt;
&lt;li&gt;Availability Zones&lt;/li&gt;
&lt;li&gt;Volume attachment and scheduling&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Incident scenario — PostgreSQL Pending
&lt;/h3&gt;

&lt;p&gt;During a practical Kubernetes troubleshooting session, we investigated a PostgreSQL Pod that remained in &lt;code&gt;Pending&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The PersistentVolume was bound to an EBS volume in &lt;code&gt;us-east-1d&lt;/code&gt;, but the existing worker nodes were located in other Availability Zones.&lt;/p&gt;

&lt;p&gt;The Kubernetes scheduler could not place the Pod on a compatible node.&lt;/p&gt;

&lt;p&gt;The investigation included:&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 postgres-0 -n real-estate-company
kubectl get pvc -n real-estate-company
kubectl describe pv YOUR_PV_NAME
kubectl get nodes -L topology.kubernetes.io/zone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The recovery approach was to add a compatible EKS worker node in the same Availability Zone as the EBS volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  Interview question
&lt;/h3&gt;

&lt;p&gt;Why can a PostgreSQL Pod remain Pending even when its PVC is Bound?&lt;/p&gt;

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

&lt;p&gt;"A bound PVC does not guarantee that Kubernetes can schedule the Pod. For zonal EBS storage, the Pod must run on a compatible node in the same Availability Zone as the volume. I check Pod scheduling events, PV node affinity, and worker node zones before changing infrastructure."&lt;/p&gt;

&lt;p&gt;Never delete a production database PVC or EBS volume as an initial troubleshooting step.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Phase Seven — Daily DevOps/SRE Operations
&lt;/h2&gt;

&lt;p&gt;The repository includes a dedicated daily operations section:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docs/03-daily-operations/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Students should practice operational routines such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checking cluster and application health&lt;/li&gt;
&lt;li&gt;Reviewing failed workloads&lt;/li&gt;
&lt;li&gt;Inspecting recent deployments&lt;/li&gt;
&lt;li&gt;Investigating events and logs&lt;/li&gt;
&lt;li&gt;Checking infrastructure dependencies&lt;/li&gt;
&lt;li&gt;Recording operational findings&lt;/li&gt;
&lt;li&gt;Escalating issues to the appropriate engineering team&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The objective is to learn how engineers maintain an application after deployment, not just how they deploy it once.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Phase Eight — Incident Response and Runbooks
&lt;/h2&gt;

&lt;p&gt;The repository contains:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docs/04-runbooks/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;docs/05-incident-management/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;docs/14-incident-simulations/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The incident simulation section includes 10 gradable exercises.&lt;/p&gt;

&lt;p&gt;Students practice the engineering workflow:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Detect → Investigate → Communicate → Mitigate → Verify → Document&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;During an incident, technical commands are only part of the job.&lt;/p&gt;

&lt;p&gt;You must also understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Incident severity&lt;/li&gt;
&lt;li&gt;Ownership and escalation&lt;/li&gt;
&lt;li&gt;Communication with developers and other teams&lt;/li&gt;
&lt;li&gt;Customer impact&lt;/li&gt;
&lt;li&gt;Safe mitigation&lt;/li&gt;
&lt;li&gt;Verification of service restoration&lt;/li&gt;
&lt;li&gt;Post-incident documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interview question
&lt;/h3&gt;

&lt;p&gt;What do you do when a production application becomes unavailable?&lt;/p&gt;

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

&lt;p&gt;"I first confirm the incident and assess its impact. I check monitoring, application health, recent deployments, and infrastructure dependencies. I communicate the situation to the responsible teams, work on a safe mitigation, and verify recovery. After the incident, I document the root cause, timeline, and preventive actions."&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Phase Nine — Monitoring and Observability
&lt;/h2&gt;

&lt;p&gt;The repository includes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docs/08-monitoring-and-observability/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This section distinguishes existing capabilities from proposed improvements.&lt;/p&gt;

&lt;p&gt;Students should learn to interpret:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application availability&lt;/li&gt;
&lt;li&gt;Pod readiness and restarts&lt;/li&gt;
&lt;li&gt;CPU and memory utilization&lt;/li&gt;
&lt;li&gt;Deployment health&lt;/li&gt;
&lt;li&gt;Application logs&lt;/li&gt;
&lt;li&gt;Metrics and alerts&lt;/li&gt;
&lt;li&gt;Service Level Indicators and Service Level Objectives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not claim a monitoring integration is operational until it has been configured and tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Phase Ten — Change Management and Engineering Documentation
&lt;/h2&gt;

&lt;p&gt;Production engineering requires controlled changes.&lt;/p&gt;

&lt;p&gt;The repository includes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docs/06-engineering-records/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;docs/07-change-management/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;docs/11-handover/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Students should practice documenting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What changed&lt;/li&gt;
&lt;li&gt;Why the change was necessary&lt;/li&gt;
&lt;li&gt;Who reviewed it&lt;/li&gt;
&lt;li&gt;Expected impact&lt;/li&gt;
&lt;li&gt;Verification results&lt;/li&gt;
&lt;li&gt;Rollback procedures&lt;/li&gt;
&lt;li&gt;Remaining risks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A successful deployment is not complete until its outcome is verified and communicated.&lt;/p&gt;

&lt;h2&gt;
  
  
  14. Phase Eleven — Interview Preparation
&lt;/h2&gt;

&lt;p&gt;The EstateFlow repository contains dedicated interview preparation materials:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docs/10-interview-preparation/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;docs/15-star-interview-portfolio/&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;docs/16-student-portfolios/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Students can prepare answers using the technical work they actually completed.&lt;/p&gt;

&lt;p&gt;For every lab, practice explaining:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What was the problem?&lt;/li&gt;
&lt;li&gt;How did you detect it?&lt;/li&gt;
&lt;li&gt;Which commands did you run?&lt;/li&gt;
&lt;li&gt;What did the results tell you?&lt;/li&gt;
&lt;li&gt;How did you resolve the problem?&lt;/li&gt;
&lt;li&gt;How did you verify the solution?&lt;/li&gt;
&lt;li&gt;How would you prevent the issue from happening again?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use the STAR method to organize real experiences into interview stories.&lt;/p&gt;

&lt;p&gt;Do not present a simulated incident as a real production outage. Explain clearly that it was a production-style training environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  15. Recommended Student Learning Paths
&lt;/h2&gt;

&lt;p&gt;The repository supports three different reading paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  Path A — New DevOps Engineer
&lt;/h3&gt;

&lt;p&gt;Start with onboarding, architecture, deployment, daily operations, runbooks, engineering records, change management, student labs, and assessments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Path B — On-Call / SRE
&lt;/h3&gt;

&lt;p&gt;Focus on daily operations, runbooks, incident management, monitoring, incident simulations, and shift handover.&lt;/p&gt;

&lt;h3&gt;
  
  
  Path C — Interview Preparation
&lt;/h3&gt;

&lt;p&gt;Study architecture, deployment guides, runbooks, the end-to-end capstone lab, interview questions, STAR stories, and portfolio documentation.&lt;/p&gt;

&lt;p&gt;These paths are documented in &lt;code&gt;docs/README.md&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  16. Student Assessments and Portfolio
&lt;/h2&gt;

&lt;p&gt;EstateFlow includes student assessments, a scoring rubric, and an end-to-end capstone exercise.&lt;/p&gt;

&lt;p&gt;Students should build a portfolio that demonstrates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Technical understanding&lt;/li&gt;
&lt;li&gt;Hands-on deployment experience&lt;/li&gt;
&lt;li&gt;Troubleshooting methodology&lt;/li&gt;
&lt;li&gt;Incident communication&lt;/li&gt;
&lt;li&gt;Engineering documentation&lt;/li&gt;
&lt;li&gt;Interview readiness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The public repository contains student-facing materials. Instructor-only answers and grading guidance are maintained separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  17. Final Project Objective
&lt;/h2&gt;

&lt;p&gt;By the end of the EstateFlow capstone, students should be able to explain and demonstrate how a DevOps/SRE Engineer works across the application lifecycle.&lt;/p&gt;

&lt;p&gt;That includes understanding the application, managing infrastructure, deploying changes, responding to incidents, communicating with teams, and documenting engineering decisions.&lt;/p&gt;

&lt;p&gt;The goal is not to memorize Kubernetes commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal is to develop the judgment and troubleshooting skills required to operate real systems.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Project Resources
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/jumptotechschooldevops/jumptotech-estateflow" rel="noopener noreferrer"&gt;JumpToTech EstateFlow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complete documentation:&lt;/strong&gt; &lt;code&gt;docs/README.md&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kubernetes configurations:&lt;/strong&gt; &lt;code&gt;infra/k8s/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CI/CD:&lt;/strong&gt; &lt;code&gt;.github/workflows/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incident simulations:&lt;/strong&gt; &lt;code&gt;docs/14-incident-simulations/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interview preparation:&lt;/strong&gt; &lt;code&gt;docs/10-interview-preparation/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JumpToTech — Learn DevOps by building, operating, troubleshooting, and documenting real-world-style systems.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>BigTime interview real time questions and answers</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Thu, 05 Nov 2026 19:04:23 +0000</pubDate>
      <link>https://dev.to/jumptotech/interview-real-time-questions-and-answers-g0k</link>
      <guid>https://dev.to/jumptotech/interview-real-time-questions-and-answers-g0k</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Tell me about yourself.&lt;br&gt;
I am DevOps Engineer with more than 5 years experience. I started at Southwest Airlines as Cloud Engineer, and after one year I got promoted to DevOps Engineer. Since September 2023 I work at Capital One. Mostly I work with AWS, Kubernetes, Terraform and GitLab CI/CD. I also used Azure, and monitoring tools like Prometheus, Grafana and Datadog. I support production, do on-call, and work on reliability, security and cost. I like to automate manual work and help developers ship apps safely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why BigTime?&lt;br&gt;
You are building AI-powered platform, and I think AI brings many good opportunities for DevOps. Your stack is AWS, Kubernetes, Terraform and GitLab, and this is what I work with every day. I also like that engineers get ownership and solve problems independently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is your day to day?&lt;br&gt;
In the morning I check alerts and dashboards in Datadog and Grafana. Then standup. Most of the day I work on Terraform, GitLab pipelines and deployments to EKS with Helm. I help developers when deployments fail. I do patching, upgrades, cost and security work. When I am on-call, I handle incidents. I update documentation in Confluence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tell me about a hard production incident.&lt;br&gt;
After a release we had 60 replicas in 3 Availability Zones, and HTTP 500 errors went up to 18 percent. I was the on-call engineer. I checked dashboards, logs, Kubernetes deployment status and the deployment history. The errors started with the release, so we rolled back to the last stable version. I checked that pods were healthy and the error rate went down. Root cause was wrong database connection setting in the new version. After this I added canary deployments, smoke tests in the pipeline, automatic rollback on high error rate, and wrote a postmortem and runbook.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you replace long-lived credentials?&lt;br&gt;
I move secrets to Vault or AWS Secrets Manager with automatic rotation. Apps on EKS use IAM roles for service accounts, so pods get short-lived credentials. GitLab pipelines use OIDC to assume IAM roles, no static AWS keys. EC2 and Windows servers use instance roles. For RDS, passwords are in Secrets Manager with rotation. This helps with SOC 2 audits too.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows EC2 in production, you cannot RDP, and you cannot restart. What do you do?&lt;br&gt;
First I check if the app still works for users, maybe only RDP is broken. I check status checks, security group port 3389, NACL, route table, and the Route 53 record. Then I use SSM Session Manager or Run Command with PowerShell. I check if the RDP service is running and restart only this service, check Windows firewall, CPU, memory and disk space. I look at the console screenshot, system log and CloudWatch metrics. If restart is really needed, I take a snapshot, move traffic to other instances behind the load balancer, talk to the team, and do it in a maintenance window.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How did you save $160K?&lt;br&gt;
I added cost allocation tags so we see who spends what. I rightsized big EC2 instances, turned off dev and test at night and weekends, cleaned unused EBS volumes, snapshots and load balancers. S3 lifecycle policies to cheaper storage. Better EKS node sizing and autoscaling. Savings Plans and Reserved Instances for stable workloads. Budgets and alerts in Cost Explorer and CloudWatch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How did you reduce MTTD by 25 percent?&lt;br&gt;
I made better dashboards in Grafana and Datadog for each service. Alerts based on real symptoms like error rate, latency and pod restarts. I removed noisy alerts so the team trusts them. I added health checks and synthetic monitoring. Alerts go to PagerDuty and Slack with runbook links.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Biggest issue you fixed with Grafana?&lt;br&gt;
Booking service on EKS was slow every few days. I made a dashboard with memory, restarts and latency together. Memory went up slowly, then pods got OOMKilled and latency jumped. It was a memory leak and low memory limits. Developers fixed the leak, I fixed requests and limits and added alerts for memory growth and restarts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What are the RDS replication types?&lt;br&gt;
Multi-AZ is synchronous replication to a standby in another Availability Zone, for high availability and automatic failover, you cannot read from it. Read Replicas are asynchronous, for scaling reads and reporting, can be cross-region, and can be promoted for disaster recovery. SQL Server Multi-AZ uses Always On or mirroring.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RDS vs Aurora?&lt;br&gt;
Standard RDS is managed database with its own EBS storage per instance. Aurora is AWS cloud database for MySQL and PostgreSQL. Storage is shared and separate from compute, data copied 6 times across 3 Availability Zones, storage grows automatically. Up to 15 replicas with very low lag, failover under 30 seconds. Aurora is faster but more expensive. Aurora does not support SQL Server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitLab pipeline with two different AWS roles, how do you configure?&lt;br&gt;
I use GitLab OIDC. The job gets an ID token and assumes IAM role. Role one is read-only for terraform plan, runs on merge requests. Role two has write permissions for apply and deploy, and the trust policy allows only main branch, protected branch and production environment. Stages are validate, plan, apply, deploy. Apply is manual approval with the saved plan. Deploy updates kubeconfig and runs helm upgrade. In EKS I map the role to RBAC with access entries, so it deploys only to its namespaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What happens when you type bigtime.net in browser?&lt;br&gt;
DNS finds the IP with UDP port 53, through the resolver to Route 53. Then TCP three-way handshake, SYN, SYN-ACK, ACK. Then TLS handshake on port 443, server sends certificate and they agree on keys. Then HTTP GET request. Traffic goes through CloudFront or load balancer, then to EC2 or EKS, and the app talks to RDS. Response comes back and browser shows the page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you make sure the app uses S3 securely, encryption in transit?&lt;br&gt;
Bucket policy denies requests when aws:SecureTransport is false, so only HTTPS. I can require TLS 1.2 with s3:TlsVersion. App uses IAM role, least privilege, no keys. VPC gateway endpoint so traffic stays private, and bucket policy limited to this endpoint. Block Public Access on. Check with CloudTrail and AWS Config rule s3-bucket-ssl-requests-only.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some S3 objects are not encrypted with your KMS key, why and how to fix?&lt;br&gt;
Default encryption works only for new objects, so old objects keep old encryption. Also if the client sends its own encryption header, it overrides the default. I find them with S3 Inventory. I re-encrypt with S3 Batch Operations copy in place. To prevent, bucket policy denies PutObject if encryption is not aws:kms or the key ID is not my key ARN. KMS key policy allows only the right roles. AWS Config for monitoring.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Same Terraform module in dev and prod, you add an IP range, dev plan is clean, prod plan wants to destroy route table associations. Why?&lt;br&gt;
The module uses count with a list. Terraform tracks resources by index. In prod the list is longer or in different order, so new item shifts indexes and Terraform wants to destroy and recreate. Fix is for_each with stable keys like the IP range. Use moved blocks or terraform state mv to move existing resources without destroy. Add prevent_destroy on critical resources, and require approval in the pipeline if prod plan shows destroy. Also check drift with plan -refresh-only and provider versions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kubernetes app gets 502 for about 10 seconds during every deployment. Readiness probe is present. What do you check?&lt;br&gt;
Most likely old pods shutting down. Kubernetes sends SIGTERM and removes the pod at the same time, but the load balancer still sends traffic for few seconds. Fix is preStop hook with sleep 10 to 15 seconds, app handles SIGTERM gracefully, terminationGracePeriodSeconds longer than the sleep. Rolling update with maxUnavailable 0 and maxSurge 1. With ALB, enable pod readiness gates and check deregistration delay and keep-alive timeout. Add PodDisruptionBudget. Check ALB logs and pod events.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you use AI in your work?&lt;br&gt;
I use chat for quick questions and errors. For bigger tasks I use AI agents like Claude Code. It reads the repo, makes a plan, changes Terraform or pipelines, and runs terraform plan or tests. I review the plan and the changes before merge. Agents use tools through MCP and need limited permissions, like read-only in prod and no apply without human approval. I never put secrets or customer data into AI tools.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next round they may also ask these, because they are in the job description:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;How do you deploy and monitor .NET apps?&lt;br&gt;
I build the app in GitLab CI with dotnet build and dotnet test, then package it. For Windows on EC2, I deploy with PowerShell scripts or SSM Run Command to IIS, and take the server out of the load balancer during deploy. For Linux, I put .NET Core in Docker and deploy to EKS or ECS with Helm. For monitoring I use CloudWatch agent for Windows logs and IIS logs, and Datadog APM or OpenTelemetry for traces, errors and response time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you patch Windows and Linux servers?&lt;br&gt;
I use AWS Systems Manager Patch Manager with patch baselines and maintenance windows. First patch dev and test, then prod. For prod, I patch in groups, so not all servers behind the load balancer go down at once. Before patching I take snapshots. After patching I check the app health and the compliance report in SSM. For EKS nodes I update the AMI and do rolling node replacement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EKS vs ECS vs App Runner?&lt;br&gt;
EKS is Kubernetes, more control and flexible, good for complex apps, but more work to manage. ECS is AWS own container service, simpler, works well with Fargate and other AWS services. App Runner is the simplest, you give it image or code, and AWS handles everything, good for small web apps and APIs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is Helmfile?&lt;br&gt;
Helmfile manages many Helm releases in one file. You define all charts, versions and values for each environment in one place, and run helmfile apply. It is good for keeping environments consistent and works well in CI/CD.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is Terragrunt and why use it?&lt;br&gt;
Terragrunt is a wrapper for Terraform. It keeps the code DRY, so you don't copy the same backend and provider config in every environment. It manages remote state config, dependencies between modules, and lets you run plan or apply across many modules and accounts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you help with SOC 2?&lt;br&gt;
I make sure access is least privilege with IAM roles and SSO, encryption at rest with KMS and in transit with TLS, logs in CloudTrail and CloudWatch, vulnerability scanning with Inspector or image scanning in the pipeline, and patching. I keep evidence and documentation ready for auditors, like access reviews and change history from GitLab merge requests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is your disaster recovery approach?&lt;br&gt;
First we agree on RTO and RPO with the business. Backups for RDS with automated snapshots and cross-region copies, S3 versioning and replication, all infrastructure in Terraform so we can rebuild fast. We write a DR runbook and test it, because a plan that is not tested does not work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have you worked with Lambda?&lt;br&gt;
Yes, I used Lambda for automation, like stopping dev instances at night, cleaning old snapshots, and processing S3 events. I deploy it with Terraform, give it a small IAM role, and monitor with CloudWatch logs and alarms for errors and duration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is Ansible used for?&lt;br&gt;
Configuration management. It connects to servers over SSH for Linux or WinRM for Windows, and runs playbooks to install software, change config and patch. It is agentless and idempotent, so you can run it many times and it gives the same result.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Biggest weakness?&lt;br&gt;
Sometimes I go too deep into a problem and want to fix it myself. Now I set a time limit, and if I don't solve it, I ask the team early.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Where do you see yourself in 3 to 5 years?&lt;br&gt;
I want to grow into Senior or Lead DevOps Engineer, own bigger parts of the platform, and help build automation and AI tools for the team.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>career</category>
      <category>devops</category>
      <category>interview</category>
    </item>
    <item>
      <title>JumpToTech DevOps Bootcamp Real Estate Company — Complete AWS EKS Integration Lab</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Thu, 05 Nov 2026 17:45:05 +0000</pubDate>
      <link>https://dev.to/jumptotech/jumptotech-devops-bootcamp-real-estate-company-complete-aws-eks-integration-lab-19h9</link>
      <guid>https://dev.to/jumptotech/jumptotech-devops-bootcamp-real-estate-company-complete-aws-eks-integration-lab-19h9</guid>
      <description>&lt;h2&gt;
  
  
  1. What you will build
&lt;/h2&gt;

&lt;p&gt;Customer / Browser&lt;/p&gt;

&lt;p&gt;View properties, submit inquiries&lt;/p&gt;

&lt;p&gt;AWS Application Load Balancer&lt;/p&gt;

&lt;p&gt;Kubernetes Ingress managed by AWS Load Balancer Controller&lt;/p&gt;

&lt;p&gt;Frontend Deployment&lt;/p&gt;

&lt;p&gt;Nginx + React&lt;/p&gt;

&lt;p&gt;frontend-service&lt;/p&gt;

&lt;p&gt;Backend Deployment&lt;/p&gt;

&lt;p&gt;FastAPI + SQL&lt;/p&gt;

&lt;p&gt;backend-service&lt;/p&gt;

&lt;p&gt;Amazon RDS PostgreSQL&lt;/p&gt;

&lt;p&gt;Main application database — outside Kubernetes&lt;/p&gt;

&lt;p&gt;Separate PostgreSQL StatefulSet&lt;/p&gt;

&lt;p&gt;PVC → PV → AWS EBS volume&lt;/p&gt;

&lt;p&gt;Persistence experiment only&lt;/p&gt;

&lt;p&gt;Fluent Bit DaemonSet&lt;/p&gt;

&lt;p&gt;Collects node container logs → CloudWatch Logs&lt;/p&gt;

&lt;h3&gt;
  
  
  What each component is responsible for
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend Deployment&lt;/td&gt;
&lt;td&gt;Runs website Pods and maintains desired replicas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend Deployment&lt;/td&gt;
&lt;td&gt;Runs API Pods that process property and inquiry requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ReplicaSet&lt;/td&gt;
&lt;td&gt;Maintains Pods created by a Deployment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ClusterIP Service&lt;/td&gt;
&lt;td&gt;Provides a stable internal network endpoint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ingress / ALB&lt;/td&gt;
&lt;td&gt;Routes incoming HTTP traffic to Services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amazon RDS&lt;/td&gt;
&lt;td&gt;Manages PostgreSQL database infrastructure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StatefulSet&lt;/td&gt;
&lt;td&gt;Maintains stable Pod identities for our separate database experiment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PVC / PV&lt;/td&gt;
&lt;td&gt;Connects the StatefulSet to persistent storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StorageClass&lt;/td&gt;
&lt;td&gt;Defines how storage is dynamically provisioned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EBS CSI Driver&lt;/td&gt;
&lt;td&gt;Integrates Kubernetes storage operations with AWS EBS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DaemonSet&lt;/td&gt;
&lt;td&gt;Ensures a log collection agent runs on eligible nodes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kubelet&lt;/td&gt;
&lt;td&gt;Starts and monitors Pod containers on a worker node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IAM&lt;/td&gt;
&lt;td&gt;Controls AWS permissions for controllers and workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes Secret&lt;/td&gt;
&lt;td&gt;Provides application credentials to Pods&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Important: We will not place RDS inside a StatefulSet. These are two separate database deployment models.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Lab phases
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Inspect existing repository and EKS cluster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Verify frontend/backend application and Docker images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Deploy frontend/backend using Deployments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Create internal ClusterIP Services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Configure ALB Ingress&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Provision and connect Amazon RDS PostgreSQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Deploy separate PostgreSQL StatefulSet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Configure EBS CSI, StorageClass and PVC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;Deploy Fluent Bit DaemonSet with CloudWatch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Test, troubleshoot, document and clean up&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a multi-session project, not a 30-minute exercise. Complete one phase successfully before proceeding.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Phase 1 — Inspect the existing project
&lt;/h2&gt;

&lt;p&gt;Why: A DevOps Engineer should understand the existing infrastructure and application before modifying it.&lt;/p&gt;

&lt;p&gt;On the EC2 instance:&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;cd&lt;/span&gt; ~/real-estate-company

&lt;span class="nb"&gt;pwd
&lt;/span&gt;git status &lt;span class="nt"&gt;--short&lt;/span&gt;
git remote &lt;span class="nt"&gt;-v&lt;/span&gt;

&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; backend
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; frontend
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; k8s

find backend frontend k8s &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-maxdepth&lt;/span&gt; 2 &lt;span class="nt"&gt;-type&lt;/span&gt; f | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect Docker and Kubernetes files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; Dockerfile &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s1"&gt;'*.yaml'&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s1"&gt;'*.yml'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the AWS identity and cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sts get-caller-identity
aws configure get region
kubectl config current-context
kubectl get nodes &lt;span class="nt"&gt;-o&lt;/span&gt; wide
kubectl get namespaces
kubectl get deployments,services,ingresses &lt;span class="nt"&gt;-A&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Student checkpoint: Identify the frontend technology, backend technology, existing container ports, current Kubernetes namespace, ECR repositories and EKS cluster name.&lt;/p&gt;

&lt;p&gt;Do not print &lt;code&gt;.env&lt;/code&gt; files, passwords, tokens or database connection strings into shared classroom screenshots.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Phase 2 — Prepare the application
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What the application must do
&lt;/h3&gt;

&lt;p&gt;Your Real Estate Company will have two parts.&lt;/p&gt;

&lt;p&gt;Frontend: Display available properties, prices, locations and an inquiry form.&lt;/p&gt;

&lt;p&gt;Backend: Return property listings, receive customer inquiries, validate requests and save them in PostgreSQL.&lt;/p&gt;

&lt;p&gt;The backend is responsible for SQL operations. Kubernetes is responsible for running and connecting the application, not for implementing its business logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1 Reference backend — FastAPI
&lt;/h3&gt;

&lt;p&gt;If your existing backend already implements these features, retain it and adapt the Kubernetes configuration. Otherwise, create this reference backend in a separate directory so that you do not overwrite your classmates' work.&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;cd&lt;/span&gt; ~/real-estate-company
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; lab-reference/backend
&lt;span class="nb"&gt;cd &lt;/span&gt;lab-reference/backend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;requirements.txt&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fastapi==0.115.12
uvicorn==0.34.2
psycopg[binary]==3.2.6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;main.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;osfrom&lt;/span&gt; &lt;span class="n"&gt;contextlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asynccontextmanagerimport&lt;/span&gt; &lt;span class="n"&gt;psycopgfrom&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HTTPExceptionfrom&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FieldDATABASE_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;psycopg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connect_timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nd"&gt;@asynccontextmanagerasync&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lifespan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;            CREATE TABLE IF NOT EXISTS properties (                id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,                title TEXT NOT NULL,                city TEXT NOT NULL,                price INTEGER NOT NULL            )        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;            CREATE TABLE IF NOT EXISTS inquiries (                id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,                property_id INTEGER NOT NULL REFERENCES properties(id),                customer_name TEXT NOT NULL,                email TEXT NOT NULL,                message TEXT NOT NULL,                created_at TIMESTAMPTZ NOT NULL DEFAULT now()            )        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is teaching code, not a production-ready customer-data platform. It omits authentication, authorization, rate limiting, full email validation and a proper migration workflow. Use fictitious customer information only.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.12-slim&lt;/span&gt;

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; requirements.txt .&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; main.py .&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;useradd &lt;span class="nt"&gt;--uid&lt;/span&gt; 10001 &lt;span class="nt"&gt;--create-home&lt;/span&gt; appuser
&lt;span class="k"&gt;USER&lt;/span&gt;&lt;span class="s"&gt; 10001&lt;/span&gt;

&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 8000&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why Docker? Kubernetes deploys container images. It does not directly deploy your Python source folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 Reference frontend — React
&lt;/h3&gt;

&lt;p&gt;For students who already have a working React frontend, retain the existing code and adapt its API calls to &lt;code&gt;/api/properties&lt;/code&gt; and &lt;code&gt;/api/inquiries&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For a new reference frontend:&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;cd&lt;/span&gt; ~/real-estate-company/lab-reference
npm create vite@latest frontend &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--template&lt;/span&gt; react
&lt;span class="nb"&gt;cd &lt;/span&gt;frontend
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;src/App.jsx&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setProperties&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setSelected&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setEmail&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setResult&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/properties&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;API unavailable&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;setProperties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;setSelected&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Unable to load properties&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/inquiries&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="na"&gt;property_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="na"&gt;customer_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nx"&gt;message&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Request failed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nf"&gt;setResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Inquiry saved! Reference #&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nf"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;setResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Unable to save inquiry&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;maxWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;40px auto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;fontFamily&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Arial&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;JumpToTech Real Estate&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Explore properties and request more information.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;grid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;article&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1px solid #ddd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;city&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;strong&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;$&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;strong&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;article&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Contact an agent&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;submit&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;grid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;select&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;selected&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setSelected&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;option&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;option&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;select&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Your name"&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt; &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Email"&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;textarea&lt;/span&gt; &lt;span class="na"&gt;placeholder&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Your question"&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="na"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Send inquiry&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;main&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;nginx.conf&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;root&lt;/span&gt; &lt;span class="n"&gt;/usr/share/nginx/html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;index&lt;/span&gt; &lt;span class="s"&gt;index.html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;try_files&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="n"&gt;/index.html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;node:22-alpine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;build&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm ci
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm run build

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; nginxinc/nginx-unprivileged:stable-alpine&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; nginx.conf /etc/nginx/conf.d/default.conf&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=build /app/dist /usr/share/nginx/html&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 8080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why use &lt;code&gt;/api&lt;/code&gt;? The browser can access the frontend and backend through the same ALB hostname. The Ingress sends &lt;code&gt;/api/*&lt;/code&gt; requests to the backend, avoiding the need for browser-side access to a private ClusterIP.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Phase 3 — Build images and push to Amazon ECR
&lt;/h2&gt;

&lt;p&gt;First define your AWS environment.&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;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_REGION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;us-east-1
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_ACCOUNT_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;aws sts get-caller-identity &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--query&lt;/span&gt; Account &lt;span class="nt"&gt;--output&lt;/span&gt; text&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;EKS_CLUSTER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_EKS_CLUSTER"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NAMESPACE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"real-estate-lab"&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;FRONTEND_REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"real-estate-frontend"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;BACKEND_REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"real-estate-backend"&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;IMAGE_TAG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"lab-v1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;YOUR_EKS_CLUSTER&lt;/code&gt; with the actual cluster name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create ECR repositories
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr describe-repositories &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repository-names&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1 &lt;span class="o"&gt;||&lt;/span&gt;
aws ecr create-repository &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repository-name&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat for the backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr describe-repositories &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repository-names&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1 &lt;span class="o"&gt;||&lt;/span&gt;
aws ecr create-repository &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repository-name&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Authenticate Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr get-login-password &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; |
docker login &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--username&lt;/span&gt; AWS &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--password-stdin&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_ACCOUNT_ID&lt;/span&gt;&lt;span class="s2"&gt;.dkr.ecr.&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;.amazonaws.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build and push from the reference implementation:&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;cd&lt;/span&gt; ~/real-estate-company/lab-reference

docker build &lt;span class="nt"&gt;--platform&lt;/span&gt; linux/amd64 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; ./backend

docker tag &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_ACCOUNT_ID&lt;/span&gt;&lt;span class="s2"&gt;.dkr.ecr.&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;.amazonaws.com/&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

docker push &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_ACCOUNT_ID&lt;/span&gt;&lt;span class="s2"&gt;.dkr.ecr.&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;.amazonaws.com/&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;--platform&lt;/span&gt; linux/amd64 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; ./frontend

docker tag &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_ACCOUNT_ID&lt;/span&gt;&lt;span class="s2"&gt;.dkr.ecr.&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;.amazonaws.com/&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

docker push &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_ACCOUNT_ID&lt;/span&gt;&lt;span class="s2"&gt;.dkr.ecr.&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;.amazonaws.com/&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE_TAG&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands assume x86-64 EKS nodes. If your EKS nodes are ARM64, use &lt;code&gt;linux/arm64&lt;/code&gt; instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr list-images &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repository-name&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$BACKEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

aws ecr list-images &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repository-name&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$FRONTEND_REPO&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Student question: Why does Kubernetes need the ECR image URI rather than the source-code directory?&lt;/p&gt;

&lt;p&gt;Answer: The container runtime pulls a packaged image containing the application and its dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Phase 4 — Amazon RDS PostgreSQL
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why RDS?
&lt;/h3&gt;

&lt;p&gt;In this architecture, RDS manages the database service outside the Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;Kubernetes does not schedule or restart the RDS database process. AWS manages the database instance infrastructure, while your team remains responsible for database configuration, access control, schema, queries and appropriate backup settings.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.1 Inspect networking before provisioning
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws eks describe-cluster &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$EKS_CLUSTER&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'cluster.resourcesVpcConfig'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the VPC ID and subnet IDs.&lt;/p&gt;

&lt;p&gt;For this lab, RDS should be in private subnets reachable from the EKS worker nodes. Do not make PostgreSQL publicly accessible.&lt;/p&gt;

&lt;p&gt;You will need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A DB subnet group covering suitable subnets in at least two Availability Zones.&lt;/li&gt;
&lt;li&gt;An RDS security group.&lt;/li&gt;
&lt;li&gt;A rule allowing TCP 5432 from the EKS node security group, or another narrowly scoped security group used by the workloads.&lt;/li&gt;
&lt;li&gt;A PostgreSQL database and database user.&lt;/li&gt;
&lt;li&gt;A secure way to provide the credentials to the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6.2 Create RDS
&lt;/h3&gt;

&lt;p&gt;For a shared class, the instructor should provision RDS once. Students should not each create expensive AWS infrastructure without checking costs and quotas.&lt;/p&gt;

&lt;p&gt;In the AWS Console:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open RDS → Databases → Create database.&lt;/li&gt;
&lt;li&gt;Select PostgreSQL.&lt;/li&gt;
&lt;li&gt;Choose an appropriately small lab instance, such as &lt;code&gt;db.t4g.micro&lt;/code&gt; where supported and available.&lt;/li&gt;
&lt;li&gt;Set database name to &lt;code&gt;realestate&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use RDS-managed master credentials in AWS Secrets Manager where available.&lt;/li&gt;
&lt;li&gt;Choose the same VPC as EKS.&lt;/li&gt;
&lt;li&gt;Select a private DB subnet group.&lt;/li&gt;
&lt;li&gt;Set Public access to No.&lt;/li&gt;
&lt;li&gt;Attach the restricted RDS security group.&lt;/li&gt;
&lt;li&gt;Configure backups and deletion protection according to the lab's cleanup plan.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not store the master password in Git.&lt;/p&gt;

&lt;p&gt;After RDS becomes available, record the endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;YOUR_RDS_ENDPOINT.rds.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6.3 Create an application database user
&lt;/h3&gt;

&lt;p&gt;Use a database administrator connection from an approved private network location.&lt;/p&gt;

&lt;p&gt;Create a dedicated application user with the permissions required for the lab rather than using the RDS master account in the backend.&lt;/p&gt;

&lt;p&gt;For a simplified classroom environment, an instructor can provision the database and grant the application user ownership of its schema. Production systems should use separate migration and runtime roles with narrower privileges.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.4 Create the Kubernetes Secret
&lt;/h3&gt;

&lt;p&gt;The simplest teaching method is a Kubernetes Secret. In production, prefer AWS Secrets Manager with a supported integration such as the Secrets Store CSI Driver or External Secrets Operator.&lt;/p&gt;

&lt;p&gt;Create the namespace:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create namespace &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NAMESPACE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On your private terminal, read the application password without echoing it:&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;read&lt;/span&gt; &lt;span class="nt"&gt;-rs&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"RDS application password: "&lt;/span&gt; DB_PASSWORD
&lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Construct the connection string using the actual endpoint, database username and URL-encoded password. Special characters in passwords must be percent-encoded in a URI.&lt;/p&gt;

&lt;p&gt;For this lab, a simpler and safer option is to create individual Secret keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create secret generic realestate-db &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NAMESPACE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_RDS_ENDPOINT"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"5432"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"realestate"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"realestate_app"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DB_PASSWORD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then remove the shell variable:&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;unset &lt;/span&gt;DB_PASSWORD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not paste passwords into a shared Zoom chat or commit them to Git.&lt;/p&gt;

&lt;p&gt;For the reference FastAPI application, we will use a small code change to construct the PostgreSQL connection from these environment variables instead of a single URL.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;DATABASE_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;psycopg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;connect_timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;psycopg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;        &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DB_HOST&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;        &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DB_PORT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;5432&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;        &lt;span class="n"&gt;dbname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DB_NAME&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;        &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DB_USER&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;        &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DB_PASSWORD&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;        &lt;span class="n"&gt;connect_timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;        &lt;span class="n"&gt;sslmode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;require&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rebuild and push the backend image with a new tag, for example &lt;code&gt;lab-v2&lt;/code&gt;, and use that tag in the Deployment below.&lt;/p&gt;

&lt;p&gt;Production note: &lt;code&gt;sslmode=require&lt;/code&gt; encrypts the connection but does not provide full server identity verification. Production should use &lt;code&gt;verify-full&lt;/code&gt; with an appropriate RDS CA bundle.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Phase 5 — Kubernetes Deployments and Services
&lt;/h2&gt;

&lt;p&gt;Create a directory for the new lab manifests:&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;cd&lt;/span&gt; ~/real-estate-company
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; lab-reference/k8s
&lt;span class="nb"&gt;cd &lt;/span&gt;lab-reference/k8s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7.1 Backend Deployment
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;backend.yaml&lt;/code&gt;:&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="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;realestate-backend&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&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;2&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;realestate-backend&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;realestate-backend&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;backend&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;BACKEND_IMAGE_URI&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;8000&lt;/span&gt;
          &lt;span class="na"&gt;envFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretRef&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;realestate-db&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;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;100m&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;128Mi&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="s"&gt;512Mi&lt;/span&gt;
          &lt;span class="na"&gt;startupProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/healthz&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;8000&lt;/span&gt;
            &lt;span class="na"&gt;failureThreshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
          &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/readyz&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;8000&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
          &lt;span class="na"&gt;livenessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/healthz&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;8000&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;
&lt;span class="nn"&gt;---&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;backend-service&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&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;ClusterIP&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;realestate-backend&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;80&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;8000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;BACKEND_IMAGE_URI&lt;/code&gt; with the full ECR image URI, including its tag.&lt;/p&gt;

&lt;p&gt;Why two replicas? We want to demonstrate how a Deployment maintains multiple backend Pods and how a Service routes requests to healthy endpoints.&lt;/p&gt;

&lt;p&gt;Why separate readiness and liveness? If RDS is unavailable, readiness should fail so the Pod stops receiving traffic. Liveness should not depend on RDS, or a temporary database outage could cause unnecessary container restarts.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Frontend Deployment
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;frontend.yaml&lt;/code&gt;:&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="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;realestate-frontend&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&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;2&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;realestate-frontend&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;realestate-frontend&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;frontend&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;FRONTEND_IMAGE_URI&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;8080&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;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;50m&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;64Mi&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="s"&gt;256Mi&lt;/span&gt;
          &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&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;8080&lt;/span&gt;
          &lt;span class="na"&gt;livenessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&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;8080&lt;/span&gt;
&lt;span class="nn"&gt;---&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;frontend-service&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&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;ClusterIP&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;realestate-frontend&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;80&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;8080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;FRONTEND_IMAGE_URI&lt;/code&gt; with the full ECR URI.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.3 Apply and verify
&lt;/h3&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; backend.yaml
kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; frontend.yaml

kubectl rollout status deployment/realestate-backend &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;180s

kubectl rollout status deployment/realestate-frontend &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;180s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&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;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get replicasets &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;-o&lt;/span&gt; wide
kubectl get services &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get endpointslices &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected result: Two frontend Pods and two backend Pods should be Ready, provided the images can be pulled and the backend can reach RDS.&lt;/p&gt;

&lt;p&gt;If backend Pods are not Ready, investigate before moving on:&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 &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &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;realestate-backend

kubectl logs deployment/realestate-backend &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7.4 Test the backend without ALB
&lt;/h3&gt;

&lt;p&gt;Use port forwarding from a machine with kubectl access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab svc/backend-service 8081:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a second terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-i&lt;/span&gt; http://localhost:8081/healthz
curl &lt;span class="nt"&gt;-i&lt;/span&gt; http://localhost:8081/readyz
curl &lt;span class="nt"&gt;-i&lt;/span&gt; http://localhost:8081/api/properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a sample inquiry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:8081/api/inquiries &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "property_id": 1,
    "customer_name": "Test Student",
    "email": "student@example.com",
    "message": "I would like a property tour."
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:8081/api/inquiries/count
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Student checkpoint: Explain the complete path from the HTTP request through Service, Backend Pod and RDS PostgreSQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Phase 6 — AWS ALB Ingress
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why Ingress?
&lt;/h3&gt;

&lt;p&gt;Our ClusterIP Services are reachable only through Kubernetes networking. Customers need an external HTTP entry point.&lt;/p&gt;

&lt;p&gt;AWS Load Balancer Controller can create and manage an Application Load Balancer from a Kubernetes Ingress.&lt;/p&gt;

&lt;p&gt;Before proceeding, verify that the AWS Load Balancer Controller is installed, has appropriate IAM permissions and that the VPC subnets are correctly tagged for load balancer discovery.&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 deployment aws-load-balancer-controller &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system

kubectl get ingressclass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the controller is missing, do not assume that creating an Ingress will automatically provision an ALB. The instructor must first install the controller using the supported AWS installation procedure and IAM configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.1 Create the Ingress
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;ingress.yaml&lt;/code&gt;:&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="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/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;Ingress&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;realestate-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/scheme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;internet-facing&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ip&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/healthcheck-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/listen-ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[{"HTTP":80}]'&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;ingressClassName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alb&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/api&lt;/span&gt;
            &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
            &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;service&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;backend-service&lt;/span&gt;
                &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
            &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
            &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;service&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;frontend-service&lt;/span&gt;
                &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply:&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; ingress.yaml
kubectl get ingress &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl describe ingress realestate-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ADDRESS&lt;/code&gt; field should eventually contain an ALB hostname if provisioning succeeds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important production distinction
&lt;/h3&gt;

&lt;p&gt;This is an HTTP-only classroom configuration. Do not send real customer information through it. For a real application, configure HTTPS using ACM, an HTTPS listener, appropriate redirect rules and an approved DNS name.&lt;/p&gt;

&lt;p&gt;The single ALB routes &lt;code&gt;/api&lt;/code&gt; to Backend and &lt;code&gt;/&lt;/code&gt; to Frontend. The frontend uses relative &lt;code&gt;/api&lt;/code&gt; requests, so browser requests reach the same ALB hostname.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.2 Verify
&lt;/h3&gt;

&lt;p&gt;Once the ALB hostname is assigned:&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;export &lt;/span&gt;&lt;span class="nv"&gt;ALB_DNS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;kubectl get ingress realestate-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.status.loadBalancer.ingress[0].hostname}'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$ALB_DNS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

curl &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"http://&lt;/span&gt;&lt;span class="nv"&gt;$ALB_DNS&lt;/span&gt;&lt;span class="s2"&gt;/"&lt;/span&gt;
curl &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"http://&lt;/span&gt;&lt;span class="nv"&gt;$ALB_DNS&lt;/span&gt;&lt;span class="s2"&gt;/api/properties"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;502&lt;/code&gt;, &lt;code&gt;503&lt;/code&gt; or &lt;code&gt;504&lt;/code&gt;, do not immediately restart the Pods. Inspect the ALB target groups, backend health, Service endpoints, application logs and database connectivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Phase 7 — PostgreSQL StatefulSet with EBS
&lt;/h2&gt;

&lt;p&gt;This phase is a separate experiment from the RDS database.&lt;/p&gt;

&lt;p&gt;Our main Real Estate Company uses RDS. Now we will deploy another PostgreSQL instance inside Kubernetes to understand StatefulSet, PVC, PV, StorageClass and the EBS CSI driver.&lt;/p&gt;

&lt;h3&gt;
  
  
  9.1 Understand the storage path
&lt;/h3&gt;

&lt;p&gt;StatefulSet&lt;/p&gt;

&lt;p&gt;Creates and manages postgres-0&lt;/p&gt;

&lt;p&gt;Pod&lt;/p&gt;

&lt;p&gt;Runs the PostgreSQL database software&lt;/p&gt;

&lt;p&gt;PVC&lt;/p&gt;

&lt;p&gt;Requests 5 GiB of persistent storage&lt;/p&gt;

&lt;p&gt;StorageClass&lt;/p&gt;

&lt;p&gt;Selects the EBS storage provisioner&lt;/p&gt;

&lt;p&gt;EBS CSI Driver&lt;/p&gt;

&lt;p&gt;Coordinates EBS volume provisioning and attachment&lt;/p&gt;

&lt;p&gt;PV / EBS Volume&lt;/p&gt;

&lt;p&gt;Stores PostgreSQL data files&lt;/p&gt;

&lt;h3&gt;
  
  
  9.2 Check EBS CSI and StorageClasses
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;For a standard EKS installation with the EBS CSI driver, the CSI provisioner is typically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ebs.csi.aws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For EKS Auto Mode, the provisioner is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ebs.csi.eks.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the driver and StorageClass that actually match your cluster.&lt;/p&gt;

&lt;p&gt;If EBS CSI is missing, the instructor must install the appropriate EKS add-on and configure its AWS IAM permissions. The CSI controller needs permissions to provision and manage EBS volumes. Merely creating a PVC will not grant those permissions.&lt;/p&gt;

&lt;p&gt;For standard EKS with the standard EBS CSI driver, create &lt;code&gt;storageclass.yaml&lt;/code&gt;:&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="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;storage.k8s.io/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;StorageClass&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;realestate-gp3&lt;/span&gt;
&lt;span class="na"&gt;provisioner&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ebs.csi.aws.com&lt;/span&gt;
&lt;span class="na"&gt;parameters&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;gp3&lt;/span&gt;
&lt;span class="na"&gt;reclaimPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Delete&lt;/span&gt;
&lt;span class="na"&gt;volumeBindingMode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;WaitForFirstConsumer&lt;/span&gt;
&lt;span class="na"&gt;allowVolumeExpansion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For EKS Auto Mode, use its supported provisioner instead and review the applicable configuration before creating the class.&lt;/p&gt;

&lt;p&gt;Apply:&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; storageclass.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why &lt;code&gt;WaitForFirstConsumer&lt;/code&gt;? EBS volumes are Availability Zone-specific. Kubernetes should consider the Pod's placement before provisioning the volume.&lt;/p&gt;

&lt;p&gt;Why &lt;code&gt;reclaimPolicy: Delete&lt;/code&gt;? This is a disposable classroom lab. Deleting the PVC may lead to deletion of its dynamically provisioned EBS volume. Do not use this configuration for valuable data without understanding its consequences.&lt;/p&gt;

&lt;h3&gt;
  
  
  9.3 Create the PostgreSQL credentials
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;read&lt;/span&gt; &lt;span class="nt"&gt;-rs&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"Lab PostgreSQL password: "&lt;/span&gt; PG_PASSWORD
&lt;span class="nb"&gt;echo

&lt;/span&gt;kubectl create secret generic postgres-lab-secret &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;POSTGRES_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;labuser &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PG_PASSWORD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;POSTGRES_DB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;labdb

&lt;span class="nb"&gt;unset &lt;/span&gt;PG_PASSWORD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9.4 Create PostgreSQL StatefulSet
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;postgres-statefulset.yaml&lt;/code&gt;:&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="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;postgres-headless&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&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;clusterIP&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;None&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;postgres-lab&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres&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;5432&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;5432&lt;/span&gt;
&lt;span class="nn"&gt;---&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;StatefulSet&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;postgres&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;real-estate-lab&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;serviceName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres-headless&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;postgres-lab&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;postgres-lab&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;securityContext&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;fsGroup&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;999&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;postgres&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;postgres:16&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;5432&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;postgres&lt;/span&gt;
          &lt;span class="na"&gt;envFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretRef&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;postgres-lab-secret&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;PGDATA&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/lib/postgresql/data/pgdata&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;postgres-data&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/lib/postgresql/data&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;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;100m&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;256Mi&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="s"&gt;1Gi&lt;/span&gt;
          &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;exec&lt;/span&gt;&lt;span class="pi"&gt;:&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="s"&gt;/bin/sh&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;-c&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"&lt;/span&gt;
            &lt;span class="na"&gt;initialDelaySeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
  &lt;span class="na"&gt;volumeClaimTemplates&lt;/span&gt;&lt;span class="pi"&gt;:&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres-data&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;accessModes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;ReadWriteOnce&lt;/span&gt;
        &lt;span class="na"&gt;storageClassName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;realestate-gp3&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;storage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5Gi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why one replica? Creating three PostgreSQL Pods does not automatically configure PostgreSQL replication. We are demonstrating persistence and stable identity, not building a highly available database cluster.&lt;/p&gt;

&lt;p&gt;Apply:&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; postgres-statefulset.yaml

kubectl get statefulset &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &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;postgres-lab
kubectl get pvc &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get pv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait until &lt;code&gt;postgres-0&lt;/code&gt; is Running/Ready and the PVC is Bound.&lt;/p&gt;

&lt;h3&gt;
  
  
  9.5 Create test data
&lt;/h3&gt;

&lt;p&gt;Open PostgreSQL:&lt;br&gt;
&lt;/p&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; postgres-0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  psql &lt;span class="nt"&gt;-U&lt;/span&gt; labuser &lt;span class="nt"&gt;-d&lt;/span&gt; labdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside &lt;code&gt;psql&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;property_notes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;property_name&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;note&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;property_notes&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;property_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;note&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Chicago Condo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Customer requested a tour'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;property_notes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\q
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  9.6 Delete the PostgreSQL Pod
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete pod postgres-0 &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl rollout status statefulset/postgres &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;300s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the data 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 &lt;span class="nb"&gt;exec &lt;/span&gt;postgres-0 &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  psql &lt;span class="nt"&gt;-U&lt;/span&gt; labuser &lt;span class="nt"&gt;-d&lt;/span&gt; labdb &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"SELECT * FROM property_notes;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected: The saved record remains because PostgreSQL is using its persistent volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  Student explanation
&lt;/h3&gt;

&lt;p&gt;The StatefulSet recreated &lt;code&gt;postgres-0&lt;/code&gt; with its stable identity. The PVC remained associated with the StatefulSet ordinal, and Kubernetes remounted the existing persistent storage.&lt;/p&gt;

&lt;p&gt;If the underlying EBS volume is deleted, corrupted or unavailable, StatefulSet alone cannot recover the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Phase 8 — DaemonSet and centralized logging
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is DaemonSet responsible for?
&lt;/h3&gt;

&lt;p&gt;A DaemonSet controller ensures that an eligible worker node runs a Pod for a particular node-level workload.&lt;/p&gt;

&lt;p&gt;Typical examples include log collectors, monitoring agents and some networking components.&lt;/p&gt;

&lt;p&gt;A DaemonSet does not replace kubelet, and it does not automatically centralize logs. We need a log collector and a destination.&lt;/p&gt;

&lt;p&gt;For this project:&lt;/p&gt;

&lt;p&gt;Fluent Bit DaemonSet → Amazon CloudWatch Logs&lt;/p&gt;

&lt;h3&gt;
  
  
  10.1 Understand the architecture
&lt;/h3&gt;

&lt;p&gt;Worker Node 1&lt;/p&gt;

&lt;p&gt;Application Pods&lt;/p&gt;

&lt;p&gt;Fluent Bit Pod&lt;/p&gt;

&lt;p&gt;Worker Node 2&lt;/p&gt;

&lt;p&gt;Application Pods&lt;/p&gt;

&lt;p&gt;Fluent Bit Pod&lt;/p&gt;

&lt;p&gt;Amazon CloudWatch Logs&lt;/p&gt;

&lt;p&gt;Centralized application and container logs&lt;/p&gt;

&lt;h3&gt;
  
  
  10.2 Verify IAM permissions
&lt;/h3&gt;

&lt;p&gt;The Fluent Bit workload needs permission to create log streams and publish log events.&lt;/p&gt;

&lt;p&gt;For standard EKS, prefer a dedicated IAM role for the collector using EKS Pod Identity or IRSA, according to your cluster configuration. Do not give every application Pod broad CloudWatch permissions.&lt;/p&gt;

&lt;p&gt;A minimum illustrative policy for an instructor-created CloudWatch log group is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"logs:CreateLogStream"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"logs:PutLogEvents"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"logs:DescribeLogStreams"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:logs:us-east-1:ACCOUNT_ID:log-group:/jumptotech/real-estate:*"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;ACCOUNT_ID&lt;/code&gt; with the actual AWS account ID. The instructor must configure the trust relationship and attach this policy to the collector's dedicated role.&lt;/p&gt;

&lt;p&gt;Create the log group:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws logs create-log-group &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--log-group-name&lt;/span&gt; /jumptotech/real-estate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the log group already exists, AWS returns an already-exists error; that does not mean logging is broken.&lt;/p&gt;

&lt;p&gt;Set a short retention period for the lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws logs put-retention-policy &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--log-group-name&lt;/span&gt; /jumptotech/real-estate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--retention-in-days&lt;/span&gt; 7 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  10.3 Install Fluent Bit with Helm
&lt;/h3&gt;

&lt;p&gt;For a real centralized-logging lab, use the maintained Fluent Bit Helm chart rather than writing an incomplete logging DaemonSet from scratch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm repo add fluent https://fluent.github.io/helm-charts
helm repo update

helm show values fluent/fluent-bit &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; fluent-default-values.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Helm chart must be configured for your EKS runtime log paths, CloudWatch output and IAM integration. Do not assume that the default values automatically send logs to CloudWatch.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;fluent-values.yaml&lt;/code&gt;:&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="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DaemonSet&lt;/span&gt;

&lt;span class="na"&gt;serviceAccount&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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;fluent-bit-realestate&lt;/span&gt;

&lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;[SERVICE]&lt;/span&gt;
        &lt;span class="s"&gt;Flush         5&lt;/span&gt;
        &lt;span class="s"&gt;Daemon        Off&lt;/span&gt;
        &lt;span class="s"&gt;Log_Level     info&lt;/span&gt;
        &lt;span class="s"&gt;Parsers_File  /fluent-bit/etc/parsers.conf&lt;/span&gt;
        &lt;span class="s"&gt;HTTP_Server   On&lt;/span&gt;
        &lt;span class="s"&gt;HTTP_Listen   0.0.0.0&lt;/span&gt;
        &lt;span class="s"&gt;HTTP_Port     2020&lt;/span&gt;

  &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;[INPUT]&lt;/span&gt;
        &lt;span class="s"&gt;Name              tail&lt;/span&gt;
        &lt;span class="s"&gt;Path              /var/log/containers/*real-estate-lab*.log&lt;/span&gt;
        &lt;span class="s"&gt;Tag               kube.*&lt;/span&gt;
        &lt;span class="s"&gt;Mem_Buf_Limit     5MB&lt;/span&gt;
        &lt;span class="s"&gt;Skip_Long_Lines   On&lt;/span&gt;
        &lt;span class="s"&gt;Refresh_Interval  10&lt;/span&gt;
        &lt;span class="s"&gt;DB                /var/log/flb_realestate.db&lt;/span&gt;

  &lt;span class="na"&gt;filters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;[FILTER]&lt;/span&gt;
        &lt;span class="s"&gt;Name   kubernetes&lt;/span&gt;
        &lt;span class="s"&gt;Match  kube.*&lt;/span&gt;
        &lt;span class="s"&gt;Kube_Tag_Prefix kube.var.log.containers.&lt;/span&gt;
        &lt;span class="s"&gt;Merge_Log On&lt;/span&gt;
        &lt;span class="s"&gt;Keep_Log Off&lt;/span&gt;

  &lt;span class="na"&gt;outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;[OUTPUT]&lt;/span&gt;
        &lt;span class="s"&gt;Name cloudwatch_logs&lt;/span&gt;
        &lt;span class="s"&gt;Match kube.*&lt;/span&gt;
        &lt;span class="s"&gt;region us-east-1&lt;/span&gt;
        &lt;span class="s"&gt;log_group_name /jumptotech/real-estate&lt;/span&gt;
        &lt;span class="s"&gt;log_stream_prefix fluentbit-&lt;/span&gt;
        &lt;span class="s"&gt;auto_create_group false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install only after the Fluent Bit ServiceAccount has been connected to the appropriate AWS IAM role. With EKS Pod Identity, this requires a Pod Identity association for the ServiceAccount; with IRSA, the ServiceAccount needs the role annotation and a valid OIDC trust policy.&lt;/p&gt;

&lt;p&gt;The chart's default hostPath mounts must also be verified against your node runtime. The above values are a reference configuration to be validated, not a guarantee that every EKS node image exposes identical log paths.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm upgrade &lt;span class="nt"&gt;--install&lt;/span&gt; realestate-logs &lt;span class="se"&gt;\&lt;/span&gt;
  fluent/fluent-bit &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; logging &lt;span class="nt"&gt;--create-namespace&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-f&lt;/span&gt; fluent-values.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&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 daemonsets &lt;span class="nt"&gt;-n&lt;/span&gt; logging
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; logging &lt;span class="nt"&gt;-o&lt;/span&gt; wide
kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; logging &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-l&lt;/span&gt; app.kubernetes.io/name&lt;span class="o"&gt;=&lt;/span&gt;fluent-bit &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  10.4 Verify centralized logs
&lt;/h3&gt;

&lt;p&gt;Generate some backend traffic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"http://&lt;/span&gt;&lt;span class="nv"&gt;$ALB_DNS&lt;/span&gt;&lt;span class="s2"&gt;/api/properties"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then inspect CloudWatch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws logs describe-log-streams &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--log-group-name&lt;/span&gt; /jumptotech/real-estate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read recent logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws logs &lt;span class="nb"&gt;tail&lt;/span&gt; /jumptotech/real-estate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--since&lt;/span&gt; 10m &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AWS_REGION&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no logs appear, inspect the Fluent Bit Pod logs, IAM permissions, log paths, filter configuration and output plugin errors.&lt;/p&gt;

&lt;p&gt;Student question: Why do we use DaemonSet rather than a Deployment with three replicas for a node-level log collector?&lt;/p&gt;

&lt;p&gt;Answer: A DaemonSet ties desired Pod placement to eligible nodes. A Deployment controls replica count but does not guarantee one collector on every node.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Phase 9 — Terraform and infrastructure ownership
&lt;/h2&gt;

&lt;p&gt;Terraform is an infrastructure-as-code tool. It can provision the AWS infrastructure that Kubernetes applications depend on.&lt;/p&gt;

&lt;p&gt;For this lab, divide ownership as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Resource&lt;/th&gt;
&lt;th&gt;Managed by&lt;/th&gt;
&lt;th&gt;Responsible team&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VPC, subnets, security groups&lt;/td&gt;
&lt;td&gt;Terraform / AWS&lt;/td&gt;
&lt;td&gt;Cloud / DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EKS cluster and node groups&lt;/td&gt;
&lt;td&gt;Terraform / AWS&lt;/td&gt;
&lt;td&gt;Platform / DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ECR repositories&lt;/td&gt;
&lt;td&gt;Terraform / AWS&lt;/td&gt;
&lt;td&gt;DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RDS instance and subnet group&lt;/td&gt;
&lt;td&gt;Terraform / AWS&lt;/td&gt;
&lt;td&gt;Cloud / DBA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS IAM roles and policies&lt;/td&gt;
&lt;td&gt;Terraform / AWS&lt;/td&gt;
&lt;td&gt;Cloud Security / DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend and backend code&lt;/td&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;td&gt;Application developers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployments and Services&lt;/td&gt;
&lt;td&gt;Kubernetes manifests / Helm&lt;/td&gt;
&lt;td&gt;DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL StatefulSet and PVC&lt;/td&gt;
&lt;td&gt;Kubernetes&lt;/td&gt;
&lt;td&gt;DevOps / DBA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EBS volumes&lt;/td&gt;
&lt;td&gt;EBS CSI Driver / AWS&lt;/td&gt;
&lt;td&gt;Kubernetes storage integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fluent Bit&lt;/td&gt;
&lt;td&gt;Helm / DaemonSet&lt;/td&gt;
&lt;td&gt;Platform / SRE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database schema and migrations&lt;/td&gt;
&lt;td&gt;SQL migration tooling&lt;/td&gt;
&lt;td&gt;Backend / DBA&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Terraform example: RDS security group
&lt;/h3&gt;

&lt;p&gt;This example demonstrates how to restrict PostgreSQL access to the EKS worker-node security group.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;terraform/rds-security.tf&lt;/code&gt; in a separate Terraform project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"vpc_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"eks_node_security_group_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_security_group"&lt;/span&gt; &lt;span class="s2"&gt;"rds"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name_prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"realestate-rds-"&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"RDS access from EKS worker nodes"&lt;/span&gt;
  &lt;span class="nx"&gt;vpc_id&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vpc_id&lt;/span&gt;

  &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Project&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"JumpToTech-RealEstate"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc_security_group_ingress_rule"&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;security_group_id&lt;/span&gt;            &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_security_group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;referenced_security_group_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eks_node_security_group_id&lt;/span&gt;
  &lt;span class="nx"&gt;ip_protocol&lt;/span&gt;                  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tcp"&lt;/span&gt;
  &lt;span class="nx"&gt;from_port&lt;/span&gt;                    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5432&lt;/span&gt;
  &lt;span class="nx"&gt;to_port&lt;/span&gt;                      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5432&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc_security_group_egress_rule"&lt;/span&gt; &lt;span class="s2"&gt;"rds_egress"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;security_group_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_security_group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;cidr_ipv4&lt;/span&gt;         &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
  &lt;span class="nx"&gt;ip_protocol&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"-1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is only one component of the RDS Terraform configuration, not a complete standalone infrastructure deployment. The VPC, provider, DB subnet group, RDS instance, credential management and Terraform backend still need to be configured.&lt;/p&gt;

&lt;p&gt;Important: Students must never run &lt;code&gt;terraform apply&lt;/code&gt; against an existing shared EKS infrastructure project without understanding its state and proposed changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Phase 10 — Production troubleshooting exercises
&lt;/h2&gt;

&lt;p&gt;Each student must investigate these scenarios independently and explain the findings.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Symptoms&lt;/th&gt;
&lt;th&gt;First checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ImagePullBackOff&lt;/td&gt;
&lt;td&gt;Pod cannot start&lt;/td&gt;
&lt;td&gt;Image URI, ECR tag, pull permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CrashLoopBackOff&lt;/td&gt;
&lt;td&gt;Container repeatedly exits&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;kubectl logs --previous&lt;/code&gt;, events&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend not Ready&lt;/td&gt;
&lt;td&gt;Readiness probe fails&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/readyz&lt;/code&gt;, RDS connectivity, credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service unavailable&lt;/td&gt;
&lt;td&gt;No backend endpoints&lt;/td&gt;
&lt;td&gt;Selectors, Pod labels, EndpointSlices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ALB 502&lt;/td&gt;
&lt;td&gt;ALB cannot get valid backend response&lt;/td&gt;
&lt;td&gt;Target health, ports, app process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ALB 503&lt;/td&gt;
&lt;td&gt;No available targets or other service issue&lt;/td&gt;
&lt;td&gt;Target groups, endpoints, health&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ALB 504&lt;/td&gt;
&lt;td&gt;Backend response timeout&lt;/td&gt;
&lt;td&gt;Application latency, networking, RDS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PVC Pending&lt;/td&gt;
&lt;td&gt;PostgreSQL cannot obtain storage&lt;/td&gt;
&lt;td&gt;StorageClass, CSI driver, IAM, scheduling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL Pod Pending&lt;/td&gt;
&lt;td&gt;Pod cannot schedule&lt;/td&gt;
&lt;td&gt;Node capacity, AZ constraints, volume events&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fluent Bit no logs&lt;/td&gt;
&lt;td&gt;CloudWatch log group empty&lt;/td&gt;
&lt;td&gt;IAM, input path, collector logs, output errors&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Troubleshooting commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get all &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab

kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;-o&lt;/span&gt; wide

kubectl describe deployment realestate-backend &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab

kubectl logs deployment/realestate-backend &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;100

kubectl get svc &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab

kubectl get endpointslices &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab

kubectl get events &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--sort-by&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;.lastTimestamp

kubectl get pvc &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab

kubectl describe pvc postgres-data-postgres-0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab

kubectl get daemonsets &lt;span class="nt"&gt;-A&lt;/span&gt;

kubectl get ingress &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Simulated production incident
&lt;/h3&gt;

&lt;p&gt;Your instructor will introduce a problem.&lt;/p&gt;

&lt;p&gt;Incident: Customers can open the Real Estate Company website, but submitting an inquiry fails.&lt;/p&gt;

&lt;p&gt;Students must:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify whether the frontend is available.&lt;/li&gt;
&lt;li&gt;Check the backend HTTP response.&lt;/li&gt;
&lt;li&gt;Inspect backend Pod readiness.&lt;/li&gt;
&lt;li&gt;Check Service selectors and EndpointSlices.&lt;/li&gt;
&lt;li&gt;Examine application logs.&lt;/li&gt;
&lt;li&gt;Test PostgreSQL connectivity.&lt;/li&gt;
&lt;li&gt;Identify the root cause.&lt;/li&gt;
&lt;li&gt;Propose a safe correction.&lt;/li&gt;
&lt;li&gt;Verify that inquiries can be saved again.&lt;/li&gt;
&lt;li&gt;Write a short incident report.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not delete a namespace or restart all workloads as your first troubleshooting action.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Final student assessment
&lt;/h2&gt;

&lt;p&gt;Student completion checklist&lt;/p&gt;

&lt;p&gt;0/12 complete&lt;/p&gt;

&lt;p&gt;Frontend and backend container images pushed to ECR&lt;/p&gt;

&lt;p&gt;Frontend and backend Deployments running&lt;/p&gt;

&lt;p&gt;ClusterIP Services and EndpointSlices verified&lt;/p&gt;

&lt;p&gt;ALB routes frontend and backend traffic&lt;/p&gt;

&lt;p&gt;RDS PostgreSQL connected to Backend&lt;/p&gt;

&lt;p&gt;Customer inquiry saved and retrieved&lt;/p&gt;

&lt;p&gt;PostgreSQL StatefulSet created&lt;/p&gt;

&lt;p&gt;PVC Bound to an EBS-backed PV&lt;/p&gt;

&lt;p&gt;PostgreSQL data survives Pod replacement&lt;/p&gt;

&lt;p&gt;Fluent Bit DaemonSet deployed&lt;/p&gt;

&lt;p&gt;CloudWatch receives application logs&lt;/p&gt;

&lt;p&gt;One incident investigated and documented&lt;/p&gt;

&lt;h3&gt;
  
  
  Interview questions
&lt;/h3&gt;

&lt;p&gt;Students should be able to answer these questions in English without reading notes.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the difference between Deployment and StatefulSet?&lt;/li&gt;
&lt;li&gt;Why does the frontend use a Deployment?&lt;/li&gt;
&lt;li&gt;Why do we use ClusterIP Services?&lt;/li&gt;
&lt;li&gt;What is the difference between Amazon RDS and PostgreSQL in a StatefulSet?&lt;/li&gt;
&lt;li&gt;What happens if the PostgreSQL Pod is deleted?&lt;/li&gt;
&lt;li&gt;What is the difference between PV, PVC and StorageClass?&lt;/li&gt;
&lt;li&gt;What does the EBS CSI Driver do?&lt;/li&gt;
&lt;li&gt;Why is a DaemonSet suitable for a log collector?&lt;/li&gt;
&lt;li&gt;What is the difference between a DaemonSet controller and kubelet?&lt;/li&gt;
&lt;li&gt;How do you troubleshoot a backend Pod that is Running but not Ready?&lt;/li&gt;
&lt;li&gt;What is the purpose of AWS IAM in this architecture?&lt;/li&gt;
&lt;li&gt;How does a customer HTTP request travel from ALB to PostgreSQL?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  14. Cleanup — prevent unnecessary AWS charges
&lt;/h2&gt;

&lt;p&gt;Do not delete resources from a shared or production cluster. Confirm the namespace and ownership before cleanup.&lt;/p&gt;

&lt;p&gt;First inspect:&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 all &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get pvc &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get ingress &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove the ALB Ingress and verify that the AWS Load Balancer Controller has deleted the corresponding ALB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete ingress realestate-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uninstall Fluent Bit if it was installed specifically for this lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm uninstall realestate-logs &lt;span class="nt"&gt;-n&lt;/span&gt; logging
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove the StatefulSet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete statefulset postgres &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The StatefulSet's PVC is generally retained when the StatefulSet is deleted. Inspect the PVC and PV before deleting storage:&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 pvc &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
kubectl get pv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the PostgreSQL data is disposable and the PVC belongs to this lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete pvc postgres-data-postgres-0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the lab's &lt;code&gt;Delete&lt;/code&gt; reclaim policy, this can cause the backing EBS volume to be deleted. Verify the actual EBS resource state in AWS.&lt;/p&gt;

&lt;p&gt;After verifying that all resources in the namespace belong to this lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete namespace real-estate-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove the lab-specific RDS instance, snapshots, CloudWatch log group, ECR images, IAM associations and other AWS resources only after verifying their ownership and backup requirements. Deleting the Kubernetes namespace does not automatically delete Amazon RDS.&lt;/p&gt;

&lt;p&gt;Do not delete the EKS cluster if other students or projects use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  15. What students must submit
&lt;/h2&gt;

&lt;p&gt;Each student must submit a GitHub repository link and a short lab report containing evidence of the deployment, networking, database persistence, logging and troubleshooting.&lt;/p&gt;

&lt;p&gt;The report should explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why the frontend and backend use Deployments.&lt;/li&gt;
&lt;li&gt;Why RDS is separate from Kubernetes.&lt;/li&gt;
&lt;li&gt;How StatefulSet, PVC, PV, StorageClass and EBS CSI work together.&lt;/li&gt;
&lt;li&gt;Why the log collector uses a DaemonSet.&lt;/li&gt;
&lt;li&gt;Which Kubernetes controllers are responsible for maintaining the desired state.&lt;/li&gt;
&lt;li&gt;What failed during troubleshooting and how the student verified recovery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Students must not commit passwords, &lt;code&gt;.env&lt;/code&gt; secrets, kubeconfig credentials or AWS access keys.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final teaching outcome
&lt;/h3&gt;

&lt;p&gt;By the end of this project, you should be able to explain the architecture of a multi-tier application on AWS EKS and demonstrate how its components work together.&lt;/p&gt;

&lt;p&gt;The goal is not simply to create Pods. The goal is to understand application deployment, networking, database persistence, AWS permissions, observability and production troubleshooting.&lt;/p&gt;

&lt;p&gt;Instructor implementation note: The application and Kubernetes examples above form a reference lab, but several infrastructure prerequisites are environment-specific: EKS IAM configuration, ALB controller installation, RDS networking and credentials, EBS CSI installation, and Fluent Bit AWS permissions. These must be validated against the actual student cluster before calling the deployment fully operational.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>THRIVE MARKET SRE – TECHNICAL INTERVIEW PREP, questions and answers for Aisel for the next step</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Mon, 02 Nov 2026 22:08:46 +0000</pubDate>
      <link>https://dev.to/jumptotech/thrive-market-sre-technical-interview-prep-questions-and-answers-for-aisel-for-the-next-step-16df</link>
      <guid>https://dev.to/jumptotech/thrive-market-sre-technical-interview-prep-questions-and-answers-for-aisel-for-the-next-step-16df</guid>
      <description>&lt;p&gt;PART 1. WHAT YOU KNOW ABOUT THRIVE (use this in your answers)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Company is 10+ years old, everything runs on AWS.&lt;/li&gt;
&lt;li&gt;Core app is PHP, mostly APIs for mobile apps, plus smaller APIs.&lt;/li&gt;
&lt;li&gt;They moved from a Puppet-based system to Kubernetes on EKS.&lt;/li&gt;
&lt;li&gt;CI is GitHub Actions, CD is Argo CD.&lt;/li&gt;
&lt;li&gt;Still have legacy systems in different AWS accounts. They want to move them into the main prod account (caches, ALBs, services).&lt;/li&gt;
&lt;li&gt;Biggest priorities: cost, legacy migration, Kubernetes work.&lt;/li&gt;
&lt;li&gt;Most incidents are app-related: DB slowness or cache issues make PHP-FPM workers fill up, Nginx upstream queues grow, error rate goes up.&lt;/li&gt;
&lt;li&gt;One past infra issue: CPU steal on Kubernetes nodes.&lt;/li&gt;
&lt;li&gt;They care about early signals, SLOs, and error rate. They are starting to use AI for monitoring.&lt;/li&gt;
&lt;li&gt;They scale on PHP-FPM busy workers, not CPU, because CPU is a late signal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use these words in your answers: early signals, user impact, step by step, reduce cost, reduce risk, root cause.&lt;/p&gt;

&lt;p&gt;PART 2. KEEP YOUR STORY CONSISTENT&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current/last company: FitTech (Senior SRE, Jan 2024 – now). Update the resume.&lt;/li&gt;
&lt;li&gt;Home Depot: DevOps Engineer, 2022–2023.&lt;/li&gt;
&lt;li&gt;XPO Logistics: Cloud/DevOps Engineer, 2020–2021.&lt;/li&gt;
&lt;li&gt;Cost savings: 28% everywhere.&lt;/li&gt;
&lt;li&gt;Be ready to explain the 28%: rightsizing EC2 and EKS nodes, tuning pod requests, deleting unused EBS/snapshots/ALBs, shutting down dev/test at night, Terraform defaults, cost alerts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 3. KUBERNETES&lt;/p&gt;

&lt;p&gt;Troubleshooting order (say it out loud like this):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;kubectl get pods -n ns – check status.&lt;/li&gt;
&lt;li&gt;kubectl describe pod – read Events at the bottom.&lt;/li&gt;
&lt;li&gt;kubectl logs pod, and kubectl logs pod --previous if it crashed.&lt;/li&gt;
&lt;li&gt;kubectl get svc, kubectl get endpoints – does the Service selector match pod labels?&lt;/li&gt;
&lt;li&gt;Check Ingress / ALB target health.&lt;/li&gt;
&lt;li&gt;Check what changed in Git / Argo CD. If urgent, roll back first.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Common pod states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pending: not enough CPU/memory on nodes, node selector or taint problem, PVC not bound.&lt;/li&gt;
&lt;li&gt;ImagePullBackOff: wrong image name/tag, no ECR permission.&lt;/li&gt;
&lt;li&gt;CrashLoopBackOff: app starts and crashes. Check logs, env vars, secrets, config.&lt;/li&gt;
&lt;li&gt;OOMKilled: memory limit too low or memory leak.&lt;/li&gt;
&lt;li&gt;Running but not Ready: readiness probe failing, so no traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Probes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Readiness: is the pod ready to get traffic? If it fails, pod is removed from Service.&lt;/li&gt;
&lt;li&gt;Liveness: is the app stuck? If it fails, container restarts.&lt;/li&gt;
&lt;li&gt;Startup: for slow-starting apps, protects from liveness killing it too early.&lt;/li&gt;
&lt;li&gt;Tip: liveness should NOT check the database. If DB is slow, all pods restart and make it worse.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Requests and limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requests: what the scheduler reserves. Used for placement and cost.&lt;/li&gt;
&lt;li&gt;Limits: the max. Over memory limit = OOMKilled. Over CPU limit = throttled.&lt;/li&gt;
&lt;li&gt;Requests too high = wasted money. Too low = noisy neighbors and evictions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scaling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HPA: scales pods. Default on CPU/memory, but can use custom metrics.&lt;/li&gt;
&lt;li&gt;Custom metrics: Prometheus Adapter, or KEDA (easier, scales on Prometheus queries).&lt;/li&gt;
&lt;li&gt;Cluster Autoscaler or Karpenter: adds/removes nodes. Karpenter is faster and picks cheaper instance types.&lt;/li&gt;
&lt;li&gt;PDB (PodDisruptionBudget): keeps a minimum number of pods during node drains and upgrades.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deployments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rolling update: maxSurge and maxUnavailable control speed.&lt;/li&gt;
&lt;li&gt;Blue/green: two versions, switch traffic at once, easy rollback.&lt;/li&gt;
&lt;li&gt;Canary: small % of traffic first (Argo Rollouts can do this).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Networking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service types: ClusterIP (internal), NodePort, LoadBalancer.&lt;/li&gt;
&lt;li&gt;Ingress with AWS Load Balancer Controller creates ALBs. Use IngressGroup to share one ALB across many services. This saves money (good for their consolidation).&lt;/li&gt;
&lt;li&gt;DNS problems: check CoreDNS pods.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RBAC for access, namespaces per team.&lt;/li&gt;
&lt;li&gt;IRSA (IAM Roles for Service Accounts) or EKS Pod Identity, so pods get AWS access without static keys.&lt;/li&gt;
&lt;li&gt;Network Policies to limit pod-to-pod traffic.&lt;/li&gt;
&lt;li&gt;Secrets: AWS Secrets Manager with External Secrets Operator.&lt;/li&gt;
&lt;li&gt;Image scanning in CI (Trivy) and ECR scanning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 4. PHP-FPM AND NGINX (very important for Thrive)&lt;/p&gt;

&lt;p&gt;How it breaks:&lt;br&gt;
DB or cache gets slow → PHP-FPM workers wait → all workers busy → requests wait in listen queue → Nginx upstream timeouts → 502/504 errors → users feel it.&lt;/p&gt;

&lt;p&gt;What to monitor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PHP-FPM: active processes, idle processes, max children reached, listen queue, slow requests.&lt;/li&gt;
&lt;li&gt;Nginx: upstream response time, 5xx rate, active connections.&lt;/li&gt;
&lt;li&gt;Tool: php-fpm status page + php-fpm exporter for Prometheus.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How to scale:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scale on busy worker % (for example 70–80%) or listen queue, not CPU.&lt;/li&gt;
&lt;li&gt;Use KEDA or HPA with Prometheus custom metrics.&lt;/li&gt;
&lt;li&gt;Warning: if DB is the root cause, more PHP pods = more DB connections = worse. Use connection limits, pooling (RDS Proxy for MySQL/Postgres), and check DB latency first.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pm.max_children: max workers per pod. Size it by memory: pod memory / memory per worker.&lt;/li&gt;
&lt;li&gt;request_terminate_timeout and Nginx timeouts: so stuck requests don't hold workers forever.&lt;/li&gt;
&lt;li&gt;Timeouts to DB and cache in the app, so one slow dependency doesn't take everything down.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 5. OBSERVABILITY AND SLOs&lt;/p&gt;

&lt;p&gt;Four golden signals: latency, traffic, errors, saturation.&lt;/p&gt;

&lt;p&gt;SLI, SLO, error budget:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SLI: what you measure. Example: % of requests that succeed in under 300 ms.&lt;/li&gt;
&lt;li&gt;SLO: the target. Example: 99.9% over 30 days.&lt;/li&gt;
&lt;li&gt;Error budget: 0.1% allowed failures. If used up, slow down releases and fix reliability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Burn rate alerts (impress them with this):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Burn rate = how fast you use the error budget.&lt;/li&gt;
&lt;li&gt;Fast burn: for example 14x over 1 hour → page right away.&lt;/li&gt;
&lt;li&gt;Slow burn: for example 2–3x over 6 hours → ticket or warning.&lt;/li&gt;
&lt;li&gt;Better than fixed thresholds: fewer false alerts, catches real problems early.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Leading vs lagging signals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leading (early): PHP-FPM queue growing, cache hit rate dropping, DB latency going up, connection count rising.&lt;/li&gt;
&lt;li&gt;Lagging (late): CPU, error rate, users complaining.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alerting rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Page only on user impact (errors, latency, SLO burn).&lt;/li&gt;
&lt;li&gt;Everything else goes to dashboards or warnings.&lt;/li&gt;
&lt;li&gt;Every alert must be actionable and have a runbook.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Monitoring a web app + cache + RDS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App: request rate, 5xx rate, p95/p99 latency, pod restarts.&lt;/li&gt;
&lt;li&gt;Cache (ElastiCache Redis): hit rate, evictions, memory, connections, latency.&lt;/li&gt;
&lt;li&gt;RDS: CPU, FreeableMemory, FreeStorageSpace, DatabaseConnections, Read/Write latency, IOPS, DiskQueueDepth, ReplicaLag. Turn on Performance Insights for slow queries. RDS events to SNS.&lt;/li&gt;
&lt;li&gt;ALB: UnHealthyHostCount, HTTPCode_ELB_5XX, TargetResponseTime.&lt;/li&gt;
&lt;li&gt;Nodes: CPU steal time (their past issue).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CPU steal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Means the hypervisor is giving CPU time to other VMs.&lt;/li&gt;
&lt;li&gt;Common on burstable instances (t3) when credits run out.&lt;/li&gt;
&lt;li&gt;Fix: use non-burstable types (m5/m6i/m7i), or check t3 unlimited, and monitor node_cpu_seconds_total{mode="steal"}.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI in monitoring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anomaly detection (Datadog Watchdog, CloudWatch anomaly detection) catches unusual patterns.&lt;/li&gt;
&lt;li&gt;AI helps summarize incidents and logs, but humans still decide.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 6. AWS&lt;/p&gt;

&lt;p&gt;Multi-account consolidation (their big project):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inventory what runs in each account (services, caches, ALBs, DBs, costs).&lt;/li&gt;
&lt;li&gt;Plan the order: low-risk services first.&lt;/li&gt;
&lt;li&gt;Networking: VPC peering or Transit Gateway so accounts can talk during migration.&lt;/li&gt;
&lt;li&gt;Move service into the main EKS cluster with Terraform + Argo CD.&lt;/li&gt;
&lt;li&gt;Share ALBs with IngressGroup, combine caches where safe.&lt;/li&gt;
&lt;li&gt;Shift traffic slowly with Route 53 weighted records.&lt;/li&gt;
&lt;li&gt;Monitor, then turn off the old resources.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cost optimization list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rightsize EC2 and EKS nodes, tune pod requests.&lt;/li&gt;
&lt;li&gt;Karpenter for better node packing and cheaper instances.&lt;/li&gt;
&lt;li&gt;Spot instances for stateless workloads and dev/test.&lt;/li&gt;
&lt;li&gt;Savings Plans / Reserved Instances for steady prod usage.&lt;/li&gt;
&lt;li&gt;Graviton (ARM) instances: about 20% cheaper.&lt;/li&gt;
&lt;li&gt;Delete unused EBS volumes, snapshots, old ALBs, unattached Elastic IPs.&lt;/li&gt;
&lt;li&gt;Move gp2 to gp3 volumes (cheaper).&lt;/li&gt;
&lt;li&gt;NAT Gateway data costs: use VPC endpoints for S3 and ECR.&lt;/li&gt;
&lt;li&gt;S3 lifecycle policies.&lt;/li&gt;
&lt;li&gt;Shut down dev/test at night and weekends.&lt;/li&gt;
&lt;li&gt;Visibility: Cost Explorer, tags, Kubecost for cost per service/namespace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RDS basics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-AZ for high availability (automatic failover).&lt;/li&gt;
&lt;li&gt;Read replicas for read scaling.&lt;/li&gt;
&lt;li&gt;Automated backups and snapshots.&lt;/li&gt;
&lt;li&gt;Private subnets, security groups, least privilege.&lt;/li&gt;
&lt;li&gt;RDS Proxy for connection pooling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 7. TERRAFORM&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remote state in S3 with DynamoDB locking.&lt;/li&gt;
&lt;li&gt;Modules to reuse code.&lt;/li&gt;
&lt;li&gt;terraform plan before apply, review in pull request.&lt;/li&gt;
&lt;li&gt;Run in CI (GitHub Actions) with plan output in the PR.&lt;/li&gt;
&lt;li&gt;terraform import to bring legacy resources into code (useful for their legacy accounts).&lt;/li&gt;
&lt;li&gt;Drift: when someone changes things by hand. Detect with scheduled plan.&lt;/li&gt;
&lt;li&gt;Never put secrets in code. Use Secrets Manager.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 8. CI/CD&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Actions: build, test, scan image, push to ECR, update Helm values or image tag in Git.&lt;/li&gt;
&lt;li&gt;Argo CD: watches Git and syncs to cluster (GitOps). Git is the source of truth.&lt;/li&gt;
&lt;li&gt;Rollback: revert the Git commit, or Argo CD rollback.&lt;/li&gt;
&lt;li&gt;Use OIDC from GitHub Actions to AWS, no long-lived keys.&lt;/li&gt;
&lt;li&gt;Safe deploys: small changes, canary or rolling, health checks, automatic rollback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 9. INCIDENT RESPONSE&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Detect (alert).&lt;/li&gt;
&lt;li&gt;Assess impact: how many users, which service.&lt;/li&gt;
&lt;li&gt;Communicate: incident channel, status updates.&lt;/li&gt;
&lt;li&gt;Mitigate first: rollback, scale, restart, failover. Fix users first, find root cause later.&lt;/li&gt;
&lt;li&gt;Find root cause.&lt;/li&gt;
&lt;li&gt;Blameless postmortem: timeline, root cause, action items.&lt;/li&gt;
&lt;li&gt;Follow up on action items.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key words: MTTR, blameless, mitigation first, action items.&lt;/p&gt;

&lt;p&gt;PART 10. PRACTICE SCENARIOS (they may ask live)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Error rate suddenly goes up. What do you do?&lt;br&gt;
Check what changed (deploys in Argo CD). Check dashboards: is it one service or all? Check PHP-FPM workers, Nginx upstream, cache hit rate, RDS latency and connections. If a recent deploy, roll back. Then root cause.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Latency is high but CPU is low.&lt;br&gt;
Workers are waiting on something: DB, cache, or external API. Check RDS slow queries and Performance Insights, cache hit rate, PHP-FPM listen queue. CPU is low because workers are waiting, not working.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pods keep restarting.&lt;br&gt;
describe pod: OOMKilled or liveness failure? Logs with --previous. If OOM, raise memory or fix leak. If liveness, check if probe is too strict or checks the DB.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A node is NotReady.&lt;br&gt;
kubectl describe node, check kubelet, disk pressure, memory pressure. Cordon and drain if needed. Karpenter or ASG replaces it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RDS connections are at max.&lt;br&gt;
Find which app opens too many connections. Lower pm.max_children or pod count, add RDS Proxy, check for connection leaks. Short-term: kill idle connections carefully.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cache goes down.&lt;br&gt;
All traffic hits the DB, DB slows, PHP workers fill up. Protect the DB: rate limit, timeouts, ElastiCache Multi-AZ with replicas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reduce AWS cost by 20% in 3 months.&lt;br&gt;
Get visibility first (Cost Explorer, Kubecost, tags). Quick wins: unused resources, gp3, dev/test schedules. Then rightsize, Karpenter, Spot for stateless, Savings Plans, Graviton. Track monthly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Migrate a legacy service from another account to EKS.&lt;br&gt;
See Part 6 steps. Containerize, add probes and monitoring, deploy with Argo CD, shift traffic with Route 53 weights, keep rollback ready.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PART 11. LINUX BASICS (quick review)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;top / htop: CPU and memory.&lt;/li&gt;
&lt;li&gt;df -h: disk space. du -sh: folder size.&lt;/li&gt;
&lt;li&gt;free -m: memory.&lt;/li&gt;
&lt;li&gt;ss -tulpn or netstat: open ports.&lt;/li&gt;
&lt;li&gt;curl -v: test HTTP.&lt;/li&gt;
&lt;li&gt;dig / nslookup: DNS.&lt;/li&gt;
&lt;li&gt;journalctl -u service: service logs.&lt;/li&gt;
&lt;li&gt;ps aux | grep php-fpm: processes.&lt;/li&gt;
&lt;li&gt;Load average vs number of CPUs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PART 12. QUESTIONS TO ASK (tech interview)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Are you scaling PHP-FPM with KEDA or HPA custom metrics?&lt;/li&gt;
&lt;li&gt;Do you use burn-rate alerts on your SLOs today?&lt;/li&gt;
&lt;li&gt;What is the next legacy account or service to migrate?&lt;/li&gt;
&lt;li&gt;Are you using Karpenter or Cluster Autoscaler, and any Spot?&lt;/li&gt;
&lt;li&gt;What would success look like in the first 90 days?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PART 13. TIPS FOR THE DAY&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you don't know something, say: "I haven't used that directly, but here is how I would approach it." Then explain your thinking.&lt;/li&gt;
&lt;li&gt;Think out loud in troubleshooting questions. They want to see your process.&lt;/li&gt;
&lt;li&gt;Always say: mitigate first, then root cause.&lt;/li&gt;
&lt;li&gt;Connect answers to their problems: PHP-FPM, cost, migration, early signals.&lt;/li&gt;
&lt;li&gt;Keep answers short, then give one real example.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;THRIVE MARKET SRE – QUESTIONS AND ANSWERS&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT YOURSELF&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hi, my name is Aisel. I'm a Site Reliability Engineer with over 6 years of experience in AWS, Kubernetes, and production support.&lt;/p&gt;

&lt;p&gt;In my current role at FitTech, I manage production workloads on Amazon EKS. I build CI/CD pipelines with Jenkins and GitHub Actions, deploy with Helm and Argo CD, and manage AWS infrastructure with Terraform. I use Prometheus, Grafana, Datadog, and CloudWatch for monitoring, and I take part in incident response and root cause analysis. I also helped reduce our cloud costs by 28%.&lt;/p&gt;

&lt;p&gt;Before that, I was a DevOps Engineer at Home Depot, supporting a Kubernetes microservices platform, and at XPO Logistics, building AWS infrastructure with Terraform.&lt;/p&gt;

&lt;p&gt;I enjoy troubleshooting, finding root causes, and automating work so problems don't come back. This role is a great match because it focuses on Kubernetes migration, cost, and reliability, which is exactly what I've been doing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WHAT ARE YOUR DAY-TO-DAY RESPONSIBILITIES?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My day usually starts with checking dashboards and alerts in Datadog and Grafana to make sure production is healthy. Then I review any issues from the night before.&lt;/p&gt;

&lt;p&gt;During the day I work on a mix of things: supporting deployments with Argo CD, fixing or improving CI/CD pipelines in GitHub Actions and Jenkins, writing Terraform for new infrastructure, and helping developers troubleshoot problems in Kubernetes.&lt;/p&gt;

&lt;p&gt;I also work on improvement projects, like cost optimization, better alerting, and automation with Bash and Python.&lt;/p&gt;

&lt;p&gt;When I'm on call, I respond to incidents, restore service, and then do root cause analysis and write the postmortem.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A PROJECT YOU'RE PROUD OF (COST OPTIMIZATION)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At FitTech, our AWS bill was growing every month, and I was asked to reduce it.&lt;/p&gt;

&lt;p&gt;First, I looked at the data in AWS Cost Explorer, and at real CPU and memory usage in CloudWatch and Datadog. I found three main problems: oversized EC2 instances and EKS nodes, unused resources like old EBS volumes, snapshots, and load balancers, and dev and test environments running 24/7.&lt;/p&gt;

&lt;p&gt;Then I fixed them step by step. I rightsized instances and EKS node groups, tuned CPU and memory requests for pods, wrote Python and Bash scripts to find and clean unused resources, and scheduled dev and test to shut down at night and on weekends. I moved EBS volumes from gp2 to gp3. I also put the right sizes into Terraform, so new resources were created correctly, and set up cost alerts.&lt;/p&gt;

&lt;p&gt;The result was a 28% reduction in monthly cloud cost, with no impact on performance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT ANOTHER PROJECT (MONITORING / SLOs)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At FitTech, our alerting was noisy. I had added many alerts on CPU, memory, and restarts, and on-call engineers were getting alert fatigue.&lt;/p&gt;

&lt;p&gt;I reviewed all the alerts with the team and removed or tuned the noisy ones. Then we moved to SLI and SLO based alerting, focused on what users feel: error rate and latency. We used burn-rate alerts, so we got paged when the error budget was being used too fast. CPU and memory moved to dashboards for troubleshooting.&lt;/p&gt;

&lt;p&gt;The result was far fewer alerts, almost every page was a real issue, and our MTTR went down because the team trusted the alerts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A PROJECT (KUBERNETES RELIABILITY AT HOME DEPOT)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At Home Depot, many incidents happened during releases because pods received traffic before the app was ready, or stayed running when the app was stuck.&lt;/p&gt;

&lt;p&gt;I collected data from past incidents and proposed adding readiness and liveness probes. I tested it on one service first, showed the results, and then worked with developers to roll it out to other services. I also set up the ALB Ingress Controller and supported rolling and blue/green deployments.&lt;/p&gt;

&lt;p&gt;The result was fewer failed deployments and safer releases.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT AN INCIDENT YOU HANDLED&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At FitTech, one afternoon we got alerts that the error rate and latency on one of our main APIs were going up fast. Users were getting timeouts.&lt;/p&gt;

&lt;p&gt;First, I joined the incident channel and checked what changed. There was no recent deployment. In the dashboards, CPU on the pods looked normal, but latency was high, which told me the app was waiting on something. I checked the database and saw DatabaseConnections on RDS was almost at the max.&lt;/p&gt;

&lt;p&gt;To mitigate, we scaled down a background worker service that was opening too many connections, and the errors dropped within a few minutes.&lt;/p&gt;

&lt;p&gt;For root cause, we found a new batch job had been released earlier that day. It opened a new DB connection for every task and didn't close them. The developers fixed the connection handling, and we added connection pooling.&lt;/p&gt;

&lt;p&gt;After the postmortem, I added alerts on DB connections and latency as early warning signals, and we added connection limits for that service. We didn't have that problem again.&lt;/p&gt;

&lt;p&gt;What I learned: CPU can look fine while users are suffering, so watch dependencies like the database, and always mitigate first, then find the root cause.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A TIME YOU COLLABORATED WITH DEVELOPERS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At FitTech, a development team was having frequent deployment failures, and they felt it was an infrastructure problem.&lt;/p&gt;

&lt;p&gt;Instead of arguing about whose fault it was, I set up a meeting and we looked at the data together: Argo CD history, pod events, and logs. We found that most failures were from missing config values and wrong resource limits.&lt;/p&gt;

&lt;p&gt;We worked together on a fix. I added validation steps in the GitHub Actions pipeline to check Helm values before deploy, and they updated their resource settings. I also wrote a short runbook for them.&lt;/p&gt;

&lt;p&gt;Deployment failures dropped a lot, and the relationship between our teams got much better. I learned that good collaboration starts with shared data, not blame.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A TIME YOU DISAGREED WITH YOUR MANAGER&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At FitTech, my manager wanted to deploy a big change to production all at once to save time. I was worried because it touched many services, and rollback would be hard.&lt;/p&gt;

&lt;p&gt;I talked to him one on one and explained the risk. I suggested deploying in smaller parts, starting with one low-risk service, using Argo CD for fast rollback. It only added about a day.&lt;/p&gt;

&lt;p&gt;He agreed. In the first small deploy, we found a config problem and fixed it in minutes with no customer impact. After that, smaller step-by-step deploys became our normal process.&lt;/p&gt;

&lt;p&gt;I learned to disagree with data and a clear solution, and to respect the final decision.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A FAILURE OR MISTAKE&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At FitTech, I added many alerts with low thresholds, thinking more alerts would catch more problems. It created too much noise, and the team started getting alert fatigue.&lt;/p&gt;

&lt;p&gt;I owned it, reviewed the alerts with the team, removed the noisy ones, added time windows, and moved to SLO-based alerting on user impact.&lt;/p&gt;

&lt;p&gt;I learned that more alerts don't mean better monitoring. Every alert must be actionable.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A TIME YOU TOOK INITIATIVE&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At Home Depot, my team's plan was only to support deployments. But I noticed many incidents were caused by missing health checks.&lt;/p&gt;

&lt;p&gt;It wasn't in our plan, but I collected incident data, proposed readiness and liveness probes, tested on one service, showed the results, and then rolled it out with developers. It reduced failed deployments and made releases safer.&lt;/p&gt;

&lt;p&gt;I learned: when I see a problem, I collect data, start small, show results, and then get the team on board.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TELL ME ABOUT A TIME YOU HELPED A JUNIOR ENGINEER&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At Home Depot, a junior engineer deployed a service to Kubernetes and it wasn't working. I sat with him and we went step by step: get pods showed CrashLoopBackOff, logs showed a missing environment variable because of a typo in the secret name. After fixing it, the app still wasn't reachable, and we found the Service selector didn't match the pod labels.&lt;/p&gt;

&lt;p&gt;I didn't just fix it for him. I guided him, and then asked him to write a short runbook. Other new engineers started using it too.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HOW DO YOU HANDLE PRESSURE DURING AN OUTAGE?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I stay calm and focus on facts. First, I check impact and what changed. I communicate clearly in the incident channel, even if it's just "still investigating." I focus on restoring service first, then root cause later. Having good runbooks and dashboards also helps a lot under pressure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HOW DO YOU PRIORITIZE WHEN MANY THINGS HAPPEN AT ONCE?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Production incidents and user impact always come first. Then I look at risk and urgency: security issues and things that could cause an outage next. Then planned project work. If priorities are not clear, I talk to my manager and the team so we agree on what's most important.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HOW DO YOU KEEP LEARNING?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I learn by doing: I set up small labs to test new tools like Karpenter and KEDA. I read AWS and Kubernetes documentation and blogs, and learn from postmortems at other companies. I also use AI tools to help me learn faster and write scripts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WHAT ARE YOUR STRENGTHS?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'm very good at troubleshooting. I stay calm, follow the data, and find the root cause. I also like automation, so I fix problems in a way that prevents them from coming back.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WHAT IS YOUR WEAKNESS?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Earlier in my career, I sometimes tried to fix everything myself instead of asking for help quickly. I learned that during incidents, asking early and sharing information saves time. Now I communicate early and involve the right people quickly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HOW DO YOU USE AI IN YOUR WORK?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I use AI coding assistants to help write Bash and Python scripts, Terraform, and GitHub Actions workflows faster. I also use them to help explain errors and logs during troubleshooting. But I always review and test the output before using it in production.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WHY THRIVE MARKET?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I like Thrive Market's mission of making healthy and sustainable products more accessible. And technically, this role matches my experience very well: migrating legacy systems to Kubernetes, AWS cost optimization, and improving reliability with better signals and SLOs. I'd love to help the team with those projects.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WHY ARE YOU LOOKING FOR A NEW JOB?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;(Choose the one that's true.)&lt;br&gt;
If the contract ended: My contract ended, and I'm looking for a long-term role where I can grow with a strong team.&lt;br&gt;
If still working: My contract is ending soon, and I'm looking for a long-term role where I can grow with a strong team.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SALARY EXPECTATIONS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Based on the role and my experience, I'm targeting a base salary of $145,000 to $160,000. I'm flexible depending on the full compensation package.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WHERE DO YOU SEE YOURSELF IN 3 TO 5 YEARS?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I want to grow into a senior or lead SRE role, where I help design reliable systems, guide other engineers, and drive bigger projects like platform improvements and cost strategy.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;DO YOU HAVE ON-CALL EXPERIENCE?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes. At FitTech I'm part of the on-call rotation. I respond to alerts, restore service, communicate in the incident channel, and then help with root cause analysis and postmortems. I also work to reduce noisy alerts so on-call is sustainable for the team.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;QUESTIONS TO ASK THEM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What would success look like in the first 90 days?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What is the next legacy system or account you plan to migrate?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are you using KEDA or HPA with custom metrics to scale PHP-FPM?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you use burn-rate alerts on your SLOs?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How is on-call organized, and how big is the team?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CLOSING&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thank you for your time today. I'm really excited about this role. The Kubernetes migration, cost work, and reliability improvements are exactly what I enjoy and have done before. I believe I can help the team move faster and make the systems more reliable and cost-efficient. What are the next steps?&lt;/p&gt;

&lt;p&gt;Tip: practice each answer out loud 2 or 3 times. Don't memorize word by word, just remember the main steps of each story. If you want, I can quiz you one question at a time.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>kubernetes</category>
      <category>sre</category>
    </item>
    <item>
      <title>interview questions and answers based on real interview for Aizada</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Mon, 02 Nov 2026 22:03:29 +0000</pubDate>
      <link>https://dev.to/jumptotech/interview-questions-and-answers-based-on-real-interview-for-aizada-44ic</link>
      <guid>https://dev.to/jumptotech/interview-questions-and-answers-based-on-real-interview-for-aizada-44ic</guid>
      <description>&lt;p&gt;TELL ME ABOUT YOURSELF&lt;/p&gt;

&lt;p&gt;Hi, thank you for having me. I am a DevOps engineer focused on AWS, Kubernetes and automation. My education is in finance, so I understand budgets, cost and business value. Later I moved into technology because I love solving problems and automating things.&lt;/p&gt;

&lt;p&gt;In my work I build and support cloud infrastructure for development teams. I use Terraform to build reusable modules, so teams can create VPCs, EKS clusters, RDS and S3 in a standard and secure way. For delivery, I build CI/CD pipelines with GitHub Actions and Jenkins, and I use Helm and Argo CD for GitOps on EKS. I add security scanning in pipelines. For monitoring I use Prometheus, Grafana, CloudWatch and Datadog. I join production incidents, find root cause and fix it so it does not repeat.&lt;/p&gt;

&lt;p&gt;I have AWS Solutions Architect Associate and Terraform Associate certifications. I am excited about SOA because you are moving to Salesforce, building platform engineering and quality engineering, and focusing on safe delivery and reliability. That is exactly the work I enjoy.&lt;/p&gt;

&lt;p&gt;DAY TO DAY RESPONSIBILITIES&lt;/p&gt;

&lt;p&gt;Morning I check dashboards in Grafana and Datadog, alerts from the night, failed pipelines and open incidents.&lt;br&gt;
Standup with the team.&lt;br&gt;
Work on Jira tickets, like new environments, databases, S3 buckets or access requests. I do all of it with Terraform, never by hand in the console.&lt;br&gt;
Build and improve CI/CD pipelines, help developers when builds or deployments fail.&lt;br&gt;
Kubernetes work, update Helm charts, manage Argo CD apps, tune CPU and memory, HPA, RBAC, EKS upgrades.&lt;br&gt;
Security work, fix scan findings, rotate secrets, review IAM permissions.&lt;br&gt;
Add dashboards and alerts for new services, clean noisy alerts.&lt;br&gt;
Review Terraform and pipeline pull requests from teammates.&lt;br&gt;
On call and incidents, then root cause analysis.&lt;br&gt;
Write runbooks and documentation so developers can self serve.&lt;/p&gt;

&lt;p&gt;Short version: half my time is building and automating, half is supporting developers and keeping production healthy.&lt;/p&gt;

&lt;p&gt;MAIN PROJECT STORY&lt;/p&gt;

&lt;p&gt;I worked on a platform with more than 100 microservices running on Amazon EKS.&lt;/p&gt;

&lt;p&gt;Problem: teams deployed in different ways, some with Jenkins scripts, some with kubectl by hand. Deployments took 40 to 45 minutes, failed often, and it was hard to know what version was in production.&lt;/p&gt;

&lt;p&gt;What I did: I built EKS clusters with Terraform modules, VPC, node groups, IAM roles and add ons. I created a standard Helm chart template for all services. I set up Argo CD for GitOps, so merge to Git means automatic deploy. I improved pipelines with Docker layer caching, multi stage builds, dependency caching and parallel tests. I added Trivy image scanning and SonarQube. I set up HPA autoscaling, RBAC, and secrets in AWS Secrets Manager. I set up Prometheus, Grafana and alerts.&lt;/p&gt;

&lt;p&gt;Result: deployments went from about 40 minutes to about 12 minutes, around 70 percent faster. Fewer failed deployments, rollback became one git revert, and teams could deploy without waiting for DevOps.&lt;/p&gt;

&lt;p&gt;My part versus others: I owned the platform and the delivery path. Developers owned their code, Dockerfiles and their Helm values. QA owned testing. Security reviewed scan results and policies.&lt;/p&gt;

&lt;p&gt;TECHNICAL QUESTIONS WITH SHORT ANSWERS&lt;/p&gt;

&lt;p&gt;AWS&lt;/p&gt;

&lt;p&gt;Q: How do you design a highly available app on AWS?&lt;br&gt;
A: VPC with public and private subnets in at least two or three availability zones. ALB in public subnets, apps in private subnets on EKS or EC2 with auto scaling, RDS Multi AZ, NAT gateway for outbound, Route 53 for DNS, backups and CloudWatch alarms.&lt;/p&gt;

&lt;p&gt;Q: Difference between security group and NACL?&lt;br&gt;
A: Security group is on the instance level and is stateful, return traffic is allowed automatically. NACL is on the subnet level and is stateless, you must allow both directions. Security groups have only allow rules, NACL has allow and deny.&lt;/p&gt;

&lt;p&gt;Q: Public subnet versus private subnet?&lt;br&gt;
A: Public subnet has a route to the internet gateway. Private subnet has no direct internet access, it goes out through a NAT gateway.&lt;/p&gt;

&lt;p&gt;Q: How do you give an app in EKS access to S3 safely?&lt;br&gt;
A: IRSA or EKS Pod Identity. The pod gets an IAM role with least privilege, no access keys in code.&lt;/p&gt;

&lt;p&gt;Q: How do you reduce AWS cost?&lt;br&gt;
A: Right size instances, auto scaling, savings plans or reserved instances, spot for non critical workloads, delete unused resources, S3 lifecycle rules, and tags to see cost by team. Show reports with Cost Explorer.&lt;/p&gt;

&lt;p&gt;TERRAFORM&lt;/p&gt;

&lt;p&gt;Q: What is Terraform state and where do you keep it?&lt;br&gt;
A: State is the file that maps Terraform code to real resources. I keep it in S3 with encryption and versioning, and DynamoDB or S3 native locking so two people cannot change it at the same time.&lt;/p&gt;

&lt;p&gt;Q: How do you structure Terraform for many environments?&lt;br&gt;
A: Reusable modules for VPC, EKS, RDS, S3. Separate folders or workspaces for dev, stage and prod, each with its own state and variables. Modules are versioned in Git.&lt;/p&gt;

&lt;p&gt;Q: What happens if someone changes a resource by hand in the console?&lt;br&gt;
A: That is drift. terraform plan shows it. I either import the change into code or apply to bring it back. To prevent it, limit console write access and run plan regularly in a pipeline.&lt;/p&gt;

&lt;p&gt;Q: How do you run Terraform in CI/CD?&lt;br&gt;
A: On pull request, run fmt, validate, tflint, Checkov or tfsec, and plan, and post the plan in the PR. After approval and merge, run apply. Prod needs manual approval.&lt;/p&gt;

&lt;p&gt;Q: terraform import, taint, and lifecycle?&lt;br&gt;
A: Import brings an existing resource into state. Taint, now replace flag, forces recreate. Lifecycle lets me use prevent_destroy, create_before_destroy and ignore_changes.&lt;/p&gt;

&lt;p&gt;KUBERNETES&lt;/p&gt;

&lt;p&gt;Q: Explain Deployment, Service, Ingress.&lt;br&gt;
A: Deployment manages pods and rolling updates. Service gives a stable IP and DNS for pods. Ingress routes outside HTTP traffic to services, on EKS usually with the AWS Load Balancer Controller.&lt;/p&gt;

&lt;p&gt;Q: Pod is in CrashLoopBackOff, what do you do?&lt;br&gt;
A: kubectl describe pod to see events, kubectl logs and logs with previous flag. Common causes are wrong config or secret, app error, failed health probe, or OOMKilled because of low memory limit.&lt;/p&gt;

&lt;p&gt;Q: Pod is Pending?&lt;br&gt;
A: Usually not enough CPU or memory on nodes, node selector or taints do not match, or PVC not bound. Check describe pod events, then add nodes or fix requests.&lt;/p&gt;

&lt;p&gt;Q: Requests versus limits?&lt;br&gt;
A: Request is what the scheduler reserves. Limit is the maximum. If memory goes over the limit, the pod is OOMKilled. CPU over the limit is throttled.&lt;/p&gt;

&lt;p&gt;Q: How does HPA work?&lt;br&gt;
A: It watches metrics like CPU or memory from metrics server, or custom metrics, and adds or removes pods to keep the target. For nodes, Cluster Autoscaler or Karpenter adds nodes.&lt;/p&gt;

&lt;p&gt;Q: Liveness versus readiness probe?&lt;br&gt;
A: Readiness says if the pod can get traffic. Liveness says if the pod is stuck and should restart.&lt;/p&gt;

&lt;p&gt;Q: How do you manage secrets in Kubernetes?&lt;br&gt;
A: Not plain in Git. I use AWS Secrets Manager with External Secrets Operator or Secrets Store CSI driver, and RBAC to limit who can read them.&lt;/p&gt;

&lt;p&gt;Q: How do you upgrade EKS?&lt;br&gt;
A: Read release notes and check deprecated APIs, upgrade in dev first, upgrade control plane, then add ons, then node groups with rolling replacement. Use PodDisruptionBudgets so apps stay up.&lt;/p&gt;

&lt;p&gt;CI/CD AND GITOPS&lt;/p&gt;

&lt;p&gt;Q: Describe a good pipeline.&lt;br&gt;
A: Build, unit tests, code scan, dependency scan, build Docker image, image scan, push to ECR, update Helm values in Git, Argo CD deploys to dev, then integration and smoke tests, approval, then stage and prod.&lt;/p&gt;

&lt;p&gt;Q: Blue green versus canary?&lt;br&gt;
A: Blue green runs two full environments and switches all traffic at once, easy rollback. Canary sends a small percent of traffic to the new version first, like 10 percent, watches metrics, then increases. I can do canary with Argo Rollouts.&lt;/p&gt;

&lt;p&gt;Q: What is GitOps?&lt;br&gt;
A: Git is the single source of truth. Argo CD watches the repo and syncs the cluster to match Git. Every change has history and rollback is a git revert.&lt;/p&gt;

&lt;p&gt;Q: How do you roll back a bad deployment?&lt;br&gt;
A: With Argo CD, revert the commit or roll back to the previous synced version. With Helm, helm rollback. With canary, stop and abort the rollout.&lt;/p&gt;

&lt;p&gt;Q: How do you keep secrets safe in GitHub Actions?&lt;br&gt;
A: GitHub secrets or better, OIDC to assume an AWS role, so no long term AWS keys are stored at all.&lt;/p&gt;

&lt;p&gt;Q: Have you used Azure DevOps?&lt;br&gt;
A: My main experience is GitHub Actions and Jenkins. Azure DevOps pipelines use the same ideas, YAML stages, jobs, approvals and service connections, so I can pick it up quickly.&lt;/p&gt;

&lt;p&gt;SECURITY AND DEVSECOPS&lt;/p&gt;

&lt;p&gt;Q: What is SAST, DAST and SCA?&lt;br&gt;
A: SAST scans source code, like SonarQube. DAST tests the running app from outside, like OWASP ZAP. SCA scans third party libraries for known vulnerabilities, like Snyk or Dependabot.&lt;/p&gt;

&lt;p&gt;Q: How do you add security to pipelines without slowing teams?&lt;br&gt;
A: Run fast scans on every PR, deeper scans nightly. Block only critical and high issues, report the rest. Give developers clear results in the PR.&lt;/p&gt;

&lt;p&gt;Q: How do you handle IAM?&lt;br&gt;
A: Least privilege, roles not users, SSO with MFA, no root usage, regular access review, and CloudTrail for audit.&lt;/p&gt;

&lt;p&gt;Q: SSO and federation?&lt;br&gt;
A: Users log in once with an identity provider like Okta or Azure AD, and AWS or apps trust it through SAML or OIDC. In AWS I use IAM Identity Center connected to the identity provider.&lt;/p&gt;

&lt;p&gt;OBSERVABILITY AND SRE&lt;/p&gt;

&lt;p&gt;Q: Metrics, logs and traces?&lt;br&gt;
A: Metrics show numbers over time like CPU and error rate. Logs show detailed events. Traces show one request across many services. Together they help find problems fast.&lt;/p&gt;

&lt;p&gt;Q: What is SLI, SLO, SLA?&lt;br&gt;
A: SLI is the measurement, like percent of successful requests. SLO is our internal target, like 99.9 percent. SLA is the promise to customers with consequences. Error budget is how much failure we allow, if we use it up we slow down releases and fix reliability.&lt;/p&gt;

&lt;p&gt;Q: How do you avoid alert fatigue?&lt;br&gt;
A: Alert on symptoms users feel, like error rate and latency, not every CPU spike. Every alert must have an action and a runbook. Route by severity in PagerDuty or Opsgenie.&lt;/p&gt;

&lt;p&gt;Q: What are golden signals?&lt;br&gt;
A: Latency, traffic, errors and saturation.&lt;/p&gt;

&lt;p&gt;Q: New Relic or Splunk experience?&lt;br&gt;
A: I used Datadog, Prometheus and Grafana. New Relic is the same idea, APM, metrics, logs and alerts, so I can learn it fast.&lt;/p&gt;

&lt;p&gt;Q: What is AIOps and how do you use AI?&lt;br&gt;
A: AIOps uses machine learning to find anomalies, group related alerts and predict problems, like Datadog Watchdog or New Relic AI. Personally I use AI tools like Copilot and Claude to write Terraform and scripts faster, explain errors and summarize logs. I always review the output before using it.&lt;/p&gt;

&lt;p&gt;SCRIPTING&lt;/p&gt;

&lt;p&gt;Q: What do you automate with Bash or Python?&lt;br&gt;
A: Cleanup of old images and snapshots, health checks, log parsing, reports for cost or unused resources, small tools with boto3 for AWS tasks.&lt;/p&gt;

&lt;p&gt;Q: Example Python with boto3?&lt;br&gt;
A: A script that lists EC2 instances without an owner tag or stopped for more than 30 days and sends a report, so we can clean up and save cost.&lt;/p&gt;

&lt;p&gt;SALESFORCE&lt;/p&gt;

&lt;p&gt;Q: How would you support DevOps for Salesforce?&lt;br&gt;
A: Keep Salesforce metadata in Git, use Salesforce CLI in GitHub Actions to validate and deploy to sandboxes, run Apex tests, then deploy to production with approval. Tools like Copado or Gearset also exist. I am honest that my Salesforce experience is limited, but the CI/CD ideas are the same.&lt;/p&gt;

&lt;p&gt;SCENARIO AND TROUBLESHOOTING QUESTIONS&lt;/p&gt;

&lt;p&gt;Q: Website is slow in production, what do you do?&lt;br&gt;
A: Check dashboards first, latency, error rate, CPU, memory. Check what changed recently, a deployment or config. Look at traces to find the slow service or database query. Check RDS performance and connections. If a recent deployment caused it, roll back first, then investigate.&lt;/p&gt;

&lt;p&gt;Q: Deployment worked in dev but fails in prod?&lt;br&gt;
A: Compare config, secrets, IAM permissions, resource limits, network rules and data. Usually it is a missing secret, permission or different environment variable.&lt;/p&gt;

&lt;p&gt;Q: A node in EKS is NotReady?&lt;br&gt;
A: Describe the node, check disk pressure, memory pressure, kubelet logs, network plugin. Cordon and drain it, and let the node group replace it.&lt;/p&gt;

&lt;p&gt;Q: Traffic spike during exam registration, how do you prepare?&lt;br&gt;
A: Load test before, set HPA and cluster autoscaling, scale RDS or use read replicas, add caching and CDN with CloudFront, set alerts, and have the team ready on call that day.&lt;/p&gt;

&lt;p&gt;Q: Someone deleted a production resource by mistake?&lt;br&gt;
A: Restore from backup or snapshot, recreate with Terraform. Then prevent it with prevent_destroy, limited access, and reviews.&lt;/p&gt;

&lt;p&gt;Q: How do you do disaster recovery?&lt;br&gt;
A: Define RTO and RPO with business. Backups with AWS Backup, cross region copies, infrastructure as code so we can rebuild fast, and test the restore regularly.&lt;/p&gt;

&lt;p&gt;BEHAVIORAL QUESTIONS&lt;/p&gt;

&lt;p&gt;Q: Tell me about a production incident you handled.&lt;br&gt;
A: An app started returning errors after a deployment. I joined the call, saw the error rate in Grafana, and found a new release used a wrong secret name. We rolled back with Argo CD in a few minutes. After, I added a check in the pipeline and wrote root cause analysis so it would not happen again.&lt;/p&gt;

&lt;p&gt;Q: Tell me about a time you disagreed with a teammate.&lt;br&gt;
A: A developer wanted direct kubectl access in prod to fix things fast. I explained the risk, and we agreed on GitOps plus a break glass process for emergencies. We both got what we needed, speed and safety.&lt;/p&gt;

&lt;p&gt;Q: How do you mentor junior engineers?&lt;br&gt;
A: Pair work, give small real tasks, code reviews with explanation, and good documentation. I let them own something so they grow confidence.&lt;/p&gt;

&lt;p&gt;Q: Tell me about a tool or process you introduced.&lt;br&gt;
A: Argo CD and GitOps. I started with a pilot team, showed results, wrote guides, did demos, and helped teams move one by one. Most teams moved within a few months.&lt;/p&gt;

&lt;p&gt;Q: How do you handle many priorities?&lt;br&gt;
A: Production issues first, then things blocking other teams, then planned work. I talk with my manager when priorities conflict.&lt;/p&gt;

&lt;p&gt;Q: Why are you leaving or why this role?&lt;br&gt;
A: I want a senior role with more ownership, platform engineering and mentoring, and a mission I care about. SOA is a strong organization in Chicago and the Salesforce migration is a great challenge.&lt;/p&gt;

&lt;p&gt;GAPS AND HOW TO ANSWER HONESTLY&lt;/p&gt;

&lt;p&gt;Azure and Azure DevOps: main experience is AWS, but the concepts are the same, I can learn fast.&lt;br&gt;
New Relic and Splunk: used Datadog and Prometheus, same ideas.&lt;br&gt;
PagerDuty and Opsgenie: say what you used for alerting and on call, same process.&lt;br&gt;
HashiCorp Vault: used AWS Secrets Manager, same purpose.&lt;br&gt;
Okta or Azure AD: understand SSO and federation with SAML and OIDC.&lt;br&gt;
Salesforce: limited, but understand CI/CD for it.&lt;br&gt;
Never say I do not know only. Say I have not used that exact tool, but I used this similar one, and here is how I would approach it.&lt;/p&gt;

&lt;p&gt;QUESTIONS TO ASK THEM&lt;/p&gt;

&lt;p&gt;What does success look like in the first 90 days?&lt;br&gt;
Is your main cloud AWS, Azure, or both?&lt;br&gt;
Do you use GitHub Actions or Azure DevOps today?&lt;br&gt;
How do you deploy Salesforce changes now?&lt;br&gt;
Are you running Kubernetes today, or mostly VMs?&lt;br&gt;
Do you have SLOs and on call set up, and which tools?&lt;br&gt;
How does DevOps work with the cybersecurity and quality engineering teams?&lt;br&gt;
How are you using AI tools today?&lt;br&gt;
What is the biggest pain point right now?&lt;br&gt;
What are the next steps in the process?&lt;/p&gt;

&lt;p&gt;Good luck, you are well prepared.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>career</category>
      <category>devops</category>
      <category>interview</category>
    </item>
    <item>
      <title>interview questions and answers based on real interview for Jibek</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Mon, 02 Nov 2026 21:59:48 +0000</pubDate>
      <link>https://dev.to/jumptotech/interview-questions-and-answers-based-on-real-interview-for-jibek-kff</link>
      <guid>https://dev.to/jumptotech/interview-questions-and-answers-based-on-real-interview-for-jibek-kff</guid>
      <description>&lt;p&gt;TELL ME ABOUT YOURSELF&lt;/p&gt;

&lt;p&gt;My name is Zhibek. I am a DevOps Engineer with more than 5 years of experience in AWS cloud. I started at Yelp in 2021, where I worked 4 years on high traffic consumer apps. I built AWS infrastructure, ran Kubernetes on EKS, and improved our CI CD pipelines with GitHub Actions. With blue green deployments and automatic rollback, I made deployments 35 percent faster. I also mentored junior engineers and wrote runbooks for the team. Now I work at Zulily, where I build Terraform for dev, staging and production, run EKS with autoscaling, and build secure pipelines with approval steps. I have AWS Solutions Architect Associate and CKAD certifications. Now I am ready for the next step, to lead a team as a player coach, and that is why this role at Herc Rentals is very interesting for me.&lt;/p&gt;

&lt;p&gt;DAY TO DAY RESPONSIBILITIES&lt;/p&gt;

&lt;p&gt;My day starts with checking CloudWatch dashboards and alerts to see if anything broke at night. Then we have a standup with the team. Most of the day I work on Terraform changes, like new environments, network changes or new services. I review pull requests from other engineers. I help developers when their pipeline fails or their app does not scale well on EKS. I fix production issues when they happen and do root cause analysis after. I also update documents and runbooks so the team knows how to handle things. Sometimes I meet with security or app teams to plan new projects.&lt;/p&gt;

&lt;p&gt;TELL ME ABOUT YOUR PROJECT&lt;/p&gt;

&lt;p&gt;At Zulily the team needed a private database that is easy to repeat in all environments. I wrote Terraform modules for Amazon DocumentDB, put it in private subnets, and used security groups and IAM so only approved apps on EKS can connect. I added it to GitHub Actions with plan, review and approval before production. I set CloudWatch alarms for CPU, connections and storage. The result was the same setup in dev, staging and production, no public access, and new environments now are built much faster.&lt;/p&gt;

&lt;p&gt;Second project if they ask, at Yelp. Deployments were slow and risky. I optimized GitHub Actions with caching and parallel jobs, added blue green deployments, and added automatic rollback if health checks fail. Deployments became 35 percent faster and we had fewer failed releases.&lt;/p&gt;

&lt;p&gt;TECHNICAL QUESTIONS AND SHORT ANSWERS&lt;/p&gt;

&lt;p&gt;What is Terraform state and why remote state&lt;br&gt;
State is a file where Terraform keeps what it created. I keep it in S3 so the whole team uses the same state, and DynamoDB locks it so two people cannot change at the same time.&lt;/p&gt;

&lt;p&gt;How do you structure Terraform for many environments&lt;br&gt;
I use reusable modules and separate folders or workspaces for dev, staging and production, with different variable files. Same code, different values.&lt;/p&gt;

&lt;p&gt;What is Terraform drift and how do you handle it&lt;br&gt;
Drift is when someone changes things by hand in the console. I run terraform plan regularly to find it, and then fix it in code, not by hand.&lt;/p&gt;

&lt;p&gt;Terraform vs CloudFormation vs Bicep&lt;br&gt;
CloudFormation is only AWS, Bicep is only Azure, Terraform works on many clouds. For a multi cloud company like Herc, Terraform is the best choice for one standard.&lt;/p&gt;

&lt;p&gt;What is a landing zone&lt;br&gt;
It is a ready secure base for cloud accounts, with account structure, network, IAM, logging and guardrails. In AWS it is Control Tower and Organizations. New teams get a safe account fast.&lt;/p&gt;

&lt;p&gt;How does Kubernetes autoscaling work&lt;br&gt;
HPA adds more pods when CPU or memory is high. Cluster Autoscaler adds more nodes when pods cannot fit. Together they handle traffic changes.&lt;/p&gt;

&lt;p&gt;A pod keeps crashing, what do you do&lt;br&gt;
I run kubectl describe pod and kubectl logs. Common reasons are wrong config, missing secret, out of memory, or failing health checks. Then I fix and redeploy.&lt;/p&gt;

&lt;p&gt;What is Helm&lt;br&gt;
Helm is a package manager for Kubernetes. It uses templates and values files so we deploy the same app to many environments in a standard way.&lt;/p&gt;

&lt;p&gt;Blue green vs canary&lt;br&gt;
Blue green has two full environments and you switch all traffic at once, easy rollback. Canary sends small traffic first to the new version, then more if it is healthy.&lt;/p&gt;

&lt;p&gt;How do you design a CI CD pipeline&lt;br&gt;
Build, unit tests, security scan, terraform plan, approval for production, deploy, health check, and automatic rollback if it fails.&lt;/p&gt;

&lt;p&gt;How do you keep secrets safe in pipelines&lt;br&gt;
Never put secrets in code. Use AWS Secrets Manager or Parameter Store, and GitHub OIDC to get short time AWS credentials instead of long keys.&lt;/p&gt;

&lt;p&gt;Explain VPC design&lt;br&gt;
Public subnets for load balancers, private subnets for apps and databases, NAT gateway for outbound internet, security groups to control traffic, many availability zones for high availability.&lt;/p&gt;

&lt;p&gt;Security group vs NACL&lt;br&gt;
Security group works on instance level and is stateful. NACL works on subnet level and is stateless, so you need rules both ways.&lt;/p&gt;

&lt;p&gt;What is hybrid connectivity&lt;br&gt;
Connecting on premise data center to the cloud with Site to Site VPN or Direct Connect in AWS, ExpressRoute in Azure, FastConnect in OCI. Transit Gateway helps connect many VPCs.&lt;/p&gt;

&lt;p&gt;What is IAM least privilege&lt;br&gt;
Give only the permissions needed, nothing more. Use roles, not users with long keys, and review permissions often.&lt;/p&gt;

&lt;p&gt;How do you do disaster recovery&lt;br&gt;
First know RTO and RPO, how fast to recover and how much data you can lose. Then backups, multi AZ, cross region copies, and test the recovery regularly, not only on paper.&lt;/p&gt;

&lt;p&gt;How do you reduce cloud cost&lt;br&gt;
Right size instances, autoscaling, Savings Plans or Reserved Instances, spot for non critical work, delete unused resources, tagging for each team, and monthly cost reports to leadership.&lt;/p&gt;

&lt;p&gt;How do you handle a production outage&lt;br&gt;
First stop the impact, maybe rollback. Communicate to stakeholders. Find root cause with logs and metrics. After that write a postmortem with no blame and fix so it does not happen again.&lt;/p&gt;

&lt;p&gt;Do you have Azure or OCI experience&lt;br&gt;
Be honest. My deep experience is AWS, but the concepts are the same. VPC is VNet, IAM is Entra ID and RBAC, EKS is AKS or OKE. Terraform works on all of them, so I can learn fast. I already started learning Azure basics.&lt;/p&gt;

&lt;p&gt;How do you use AI in your work&lt;br&gt;
I use Claude AI to help draft pipelines, review Terraform and write documentation. I always review and test before using it. I think AI can help the team move faster when used carefully.&lt;/p&gt;

&lt;p&gt;MANAGER QUESTIONS&lt;/p&gt;

&lt;p&gt;How do you handle a low performer&lt;br&gt;
Talk early in one on one, understand the reason, set clear goals with time, give support, and follow up. If no change, work with HR.&lt;/p&gt;

&lt;p&gt;How do you prioritize when everything is urgent&lt;br&gt;
Production issues and security first, then business priorities agreed with leadership. I make the work visible so everyone sees the tradeoffs.&lt;/p&gt;

&lt;p&gt;How do you manage contractors&lt;br&gt;
Clear scope, same standards and code review as full time, and documentation so knowledge stays in the company.&lt;/p&gt;

&lt;p&gt;Two engineers disagree on a design, what do you do&lt;br&gt;
Let both explain, compare by facts like cost, risk and simplicity, maybe do a small test, then decide and move forward together.&lt;/p&gt;

&lt;p&gt;What will you do in first 90 days&lt;br&gt;
First 30 days listen and learn the team, systems and pain points. Next 30 days find quick wins like standards and runbooks. Last 30 days make a roadmap with leadership.&lt;/p&gt;

&lt;p&gt;How do you measure team success&lt;br&gt;
Deployment frequency, failed changes, time to recover, uptime, cloud cost, and team happiness.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>career</category>
      <category>devops</category>
      <category>interview</category>
    </item>
    <item>
      <title>2-2 The Midnight Payment Processing Incident — Kubernetes, PostgreSQL, Terraform, CI/CD, Grafana and PagerDuty</title>
      <dc:creator>Aisalkyn Aidarova</dc:creator>
      <pubDate>Fri, 30 Oct 2026 02:04:16 +0000</pubDate>
      <link>https://dev.to/jumptotech/2-2-the-midnight-payment-processing-incident-kubernetes-postgresql-terraform-cicd-grafana-33a5</link>
      <guid>https://dev.to/jumptotech/2-2-the-midnight-payment-processing-incident-kubernetes-postgresql-terraform-cicd-grafana-33a5</guid>
      <description>&lt;p&gt;Student hands-on guide · 3 classes × 3 hours · AWS EKS training environment&lt;/p&gt;

&lt;h3&gt;
  
  
  Your mission
&lt;/h3&gt;

&lt;p&gt;You are a DevOps/SRE engineer supporting a banking payment-processing platform. At midnight, PagerDuty notifies the primary on-call engineer that payment transactions are failing.&lt;/p&gt;

&lt;p&gt;You open Grafana and see increasing HTTP 503 errors. But when you inspect Kubernetes, the application Pods are all &lt;code&gt;Running&lt;/code&gt; and &lt;code&gt;Ready&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;How can the application be healthy according to Kubernetes while customers cannot complete payments?&lt;/p&gt;

&lt;p&gt;You will investigate the application, its PostgreSQL database, Kubernetes networking, deployment history, monitoring, and the infrastructure changes that could have caused the incident.&lt;/p&gt;

&lt;p&gt;This is a realistic fictional production case study, supported by a real, runnable training lab. You must not claim that it is an actual incident at a named bank.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Incident ticket
&lt;/h2&gt;

&lt;p&gt;INC-2026-1047&lt;/p&gt;

&lt;p&gt;SEV-1 · Scenario&lt;/p&gt;

&lt;p&gt;Payment Processing API — Elevated 5xx Error Rate&lt;/p&gt;

&lt;p&gt;PagerDuty · Payments Production · 12:05 AM&lt;/p&gt;

&lt;p&gt;Reported impact: Payment submissions failing across the customer-facing banking application.&lt;/p&gt;

&lt;p&gt;Monitoring: HTTP 503 responses increasing, payment success rate declining, API Pods still Ready.&lt;/p&gt;

&lt;p&gt;Initial hypothesis: Application dependency failure, database connectivity, or recent infrastructure change.&lt;/p&gt;

&lt;p&gt;Assigned: Primary On-Call SRE&lt;/p&gt;

&lt;p&gt;Escalation: Incident Commander, Backend Engineering, DBA, Cloud Platform, Release Engineering, Security.&lt;/p&gt;

&lt;p&gt;In the hypothetical production architecture, the application runs on AWS EKS across three Availability Zones and connects to Amazon RDS PostgreSQL. Terraform manages security groups and networking; GitHub Actions handles application and infrastructure pipelines.&lt;/p&gt;

&lt;p&gt;For the actual student lab, we use two Payment API replicas and PostgreSQL inside Kubernetes to keep costs and resource requirements low.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Production architecture and team responsibilities
&lt;/h2&gt;

&lt;p&gt;Reference production architecture. The classroom lab replaces RDS and AWS security-group failure with an in-cluster database and NetworkPolicy.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Team&lt;/th&gt;
&lt;th&gt;Responsibility during incident&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Primary On-Call SRE&lt;/td&gt;
&lt;td&gt;Acknowledge alert, assess impact, investigate, mitigate and communicate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Incident Commander&lt;/td&gt;
&lt;td&gt;Coordinate teams, severity, updates and escalation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend/Application Team&lt;/td&gt;
&lt;td&gt;Investigate application errors, connection pooling, configuration and code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database Administrator&lt;/td&gt;
&lt;td&gt;Check database availability, active connections, locks, CPU, I/O and query performance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud/Platform Team&lt;/td&gt;
&lt;td&gt;Investigate EKS, VPC, security groups, routing and network policies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Release/CI/CD Team&lt;/td&gt;
&lt;td&gt;Check recent releases, GitHub Actions workflows and Terraform changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Security Team&lt;/td&gt;
&lt;td&gt;Review and approve necessary access-rule changes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A primary on-call engineer may initially perform several of these functions, especially on a small team. Do not wait for a meeting before checking the impact and following your incident-response runbook.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. What you will build
&lt;/h2&gt;

&lt;p&gt;The lab creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace &lt;code&gt;payments-incident-lab&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;PostgreSQL database with a &lt;code&gt;simulated_payments&lt;/code&gt; table&lt;/li&gt;
&lt;li&gt;Python Payment API with two replicas&lt;/li&gt;
&lt;li&gt;Kubernetes Services and health probes&lt;/li&gt;
&lt;li&gt;Prometheus metrics for requests, errors and latency&lt;/li&gt;
&lt;li&gt;A controlled database connectivity incident&lt;/li&gt;
&lt;li&gt;Recovery and verification procedures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lab uses synthetic payments only. It does not charge cards or connect to real payment processors.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Requirements
&lt;/h2&gt;

&lt;p&gt;You need a training EKS cluster, working &lt;code&gt;kubectl&lt;/code&gt;, Docker with permission to push images to a registry, and enough capacity for three small Pods in addition to monitoring.&lt;/p&gt;

&lt;p&gt;For the NetworkPolicy incident, the cluster must have NetworkPolicy enforcement enabled. Installing a NetworkPolicy resource without an enforcing CNI will not necessarily block traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  First, verify your environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl config current-context
kubectl get nodes &lt;span class="nt"&gt;-o&lt;/span&gt; wide
kubectl get namespaces
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; monitoring
kubectl get storageclass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not perform this exercise in a real production namespace.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part A — Create all application and Kubernetes files
&lt;/h1&gt;

&lt;p&gt;Create the project folders:&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;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; payment-incident-lab/&lt;span class="o"&gt;{&lt;/span&gt;app,k8s,scripts,grafana,terraform&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;payment-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 1 — &lt;code&gt;app/requirements.txt&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flask==3.1.1
psycopg[binary]==3.2.9
prometheus-client==0.22.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 2 — &lt;code&gt;app/app.py&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is the application students will troubleshoot. Notice that &lt;code&gt;/readyz&lt;/code&gt; checks the application process, but deliberately does not check database connectivity. This allows Pods to remain Ready while payment requests fail.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                    &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT 1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                    &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetchone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;            &lt;span class="n"&gt;REQ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/db-check&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;200&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;jsonify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;reachable&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;database connectivity failed: %s&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                &lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            &lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="n"&gt;DB_ERRORS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;            &lt;span class="n"&gt;REQ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/db-check&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;503&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;jsonify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;database_unavailable&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/payments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;payment&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;DURATION&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/payments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;silent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;        &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Idempotency-Key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;        &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;            &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;            &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt;            &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount_cents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount_cents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;            &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount_cents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;100000&lt;/span&gt;        &lt;span class="p"&gt;):&lt;/span&gt;            &lt;span class="n"&gt;REQ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/payments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;400&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;jsonify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;                &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Idempotency-Key and integer &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;                      &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount_cents 1..100000 required&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;            &lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                    &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;                        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;                        INSERT INTO simulated_payments                        (idempotency_key, amount_cents)                        VALUES (%s, %s)                        ON CONFLICT (idempotency_key)                        DO NOTHING                        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount_cents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;                    &lt;span class="p"&gt;)&lt;/span&gt;                    &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;                        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;                        SELECT id, amount_cents, status                        FROM simulated_payments                        WHERE idempotency_key = %s                        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,),&lt;/span&gt;                    &lt;span class="p"&gt;)&lt;/span&gt;                    &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetchone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 3 — &lt;code&gt;app/Dockerfile&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.12-slim&lt;/span&gt;

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; requirements.txt .&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; app.py .&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;useradd &lt;span class="nt"&gt;--uid&lt;/span&gt; 10001 &lt;span class="nt"&gt;--create-home&lt;/span&gt; appuser

&lt;span class="k"&gt;USER&lt;/span&gt;&lt;span class="s"&gt; 10001&lt;/span&gt;

&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 8080&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["python", "app.py"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 4 — &lt;code&gt;k8s/00-namespace.yaml&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&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;Namespace&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;payments-incident-lab&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 5 — &lt;code&gt;k8s/01-postgres.yaml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This database is disposable. Its storage uses &lt;code&gt;emptyDir&lt;/code&gt;, so deleting or replacing the database Pod can destroy its data.&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="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;Secret&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;postgres-auth&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;Opaque&lt;/span&gt;
&lt;span class="na"&gt;stringData&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;classroom-only-not-production&lt;/span&gt;
&lt;span class="nn"&gt;---&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;ConfigMap&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;postgres-init&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&lt;/span&gt;
&lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;001-init.sql&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;CREATE TABLE IF NOT EXISTS simulated_payments (&lt;/span&gt;
      &lt;span class="s"&gt;id BIGSERIAL PRIMARY KEY,&lt;/span&gt;
      &lt;span class="s"&gt;idempotency_key TEXT NOT NULL UNIQUE,&lt;/span&gt;
      &lt;span class="s"&gt;amount_cents INTEGER NOT NULL&lt;/span&gt;
        &lt;span class="s"&gt;CHECK (amount_cents &amp;gt; 0),&lt;/span&gt;
      &lt;span class="s"&gt;status TEXT NOT NULL&lt;/span&gt;
        &lt;span class="s"&gt;DEFAULT 'simulated_approved',&lt;/span&gt;
      &lt;span class="s"&gt;created_at TIMESTAMPTZ NOT NULL DEFAULT now()&lt;/span&gt;
    &lt;span class="s"&gt;);&lt;/span&gt;
&lt;span class="s"&gt;---&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;lab-postgres&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;strategy&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;Recreate&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;lab-postgres&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;lab-postgres&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;postgres&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;postgres:16&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;5432&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;POSTGRES_DB&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments&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;POSTGRES_USER&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;labuser&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;POSTGRES_PASSWORD&lt;/span&gt;
              &lt;span class="na"&gt;valueFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;secretKeyRef&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;postgres-auth&lt;/span&gt;
                  &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_PASSWORD&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;init&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;/docker-entrypoint-initdb.d&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;data&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/lib/postgresql/data&lt;/span&gt;
          &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;exec&lt;/span&gt;&lt;span class="pi"&gt;:&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="s"&gt;sh&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;-c&lt;/span&gt;
                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pg_isready -U labuser -d payments&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&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;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;50m&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;128Mi&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="s"&gt;512Mi&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;init&lt;/span&gt;
          &lt;span class="na"&gt;configMap&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;postgres-init&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;data&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="nn"&gt;---&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;lab-postgres&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;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;lab-postgres&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres&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;5432&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;5432&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 6 — &lt;code&gt;k8s/02-payment-api.yaml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;REPLACE_WITH_YOUR_IMAGE&lt;/code&gt; with the container image you build.&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="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;payment-api&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;2&lt;/span&gt;
  &lt;span class="na"&gt;strategy&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;RollingUpdate&lt;/span&gt;
    &lt;span class="na"&gt;rollingUpdate&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;maxSurge&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;maxUnavailable&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&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;payment-api&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;payment-api&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;payment-api&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;REPLACE_WITH_YOUR_IMAGE&lt;/span&gt;
          &lt;span class="na"&gt;imagePullPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Always&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http&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;8080&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;DB_HOST&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lab-postgres&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;DB_NAME&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments&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;DB_USER&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;labuser&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;DB_PASSWORD&lt;/span&gt;
              &lt;span class="na"&gt;valueFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;secretKeyRef&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;postgres-auth&lt;/span&gt;
                  &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_PASSWORD&lt;/span&gt;
          &lt;span class="na"&gt;readinessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/readyz&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
          &lt;span class="na"&gt;livenessProbe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;httpGet&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/healthz&lt;/span&gt;
              &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http&lt;/span&gt;
            &lt;span class="na"&gt;periodSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&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;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;50m&lt;/span&gt;
              &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;64Mi&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="s"&gt;256Mi&lt;/span&gt;
&lt;span class="nn"&gt;---&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;payment-api&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;payment-api&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;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;payment-api&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http&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;8080&lt;/span&gt;
      &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 7 — &lt;code&gt;k8s/03-networkpolicy-outage.yaml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is the controlled failure. It blocks new incoming connections to the PostgreSQL Pod from the API.&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="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/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;NetworkPolicy&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;block-postgres-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;podSelector&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;lab-postgres&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important: This only works when your cluster enforces Kubernetes NetworkPolicy. On EKS, check the Amazon VPC CNI NetworkPolicy configuration before running this exercise.&lt;/p&gt;

&lt;h2&gt;
  
  
  File 8 — &lt;code&gt;k8s/04-servicemonitor-optional.yaml&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring.coreos.com/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;ServiceMonitor&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;payment-api&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring&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;release&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring&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;namespaceSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchNames&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;payments-incident-lab&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;payment-api&lt;/span&gt;
  &lt;span class="na"&gt;endpoints&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="s"&gt;http&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/metrics&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;15s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;release: monitoring&lt;/code&gt; label must match the selector of your Prometheus installation. This file requires the Prometheus Operator ServiceMonitor CRD.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part B — Build, deploy and verify
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Step 1. Build and push the Docker image
&lt;/h2&gt;

&lt;p&gt;Run from inside &lt;code&gt;payment-incident-lab&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Replace the Docker Hub username with yours.&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;export &lt;/span&gt;&lt;span class="nv"&gt;IMAGE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'YOUR_DOCKERHUB_USERNAME/jumptotech-payment-api:v1'&lt;/span&gt;

docker buildx build &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--platform&lt;/span&gt; linux/amd64 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--push&lt;/span&gt; ./app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your EKS worker nodes are ARM64, use &lt;code&gt;linux/arm64&lt;/code&gt; instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2. Deploy PostgreSQL
&lt;/h2&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; k8s/00-namespace.yaml

kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; k8s/01-postgres.yaml

kubectl rollout status deployment/lab-postgres &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;180s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&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;-n&lt;/span&gt; payments-incident-lab
kubectl get svc &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The PostgreSQL Pod should show &lt;code&gt;1/1 Running&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3. Deploy Payment API
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s2"&gt;"s|REPLACE_WITH_YOUR_IMAGE|&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE&lt;/span&gt;&lt;span class="s2"&gt;|"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  k8s/02-payment-api.yaml | kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; -

kubectl rollout status deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;180s

kubectl get deployments &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="nt"&gt;-o&lt;/span&gt; wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected baseline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME           READY   UP-TO-DATE   AVAILABLE
lab-postgres   1/1     1            1
payment-api    2/2     2            2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4. Verify the database table
&lt;/h2&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;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  deployment/lab-postgres &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  psql &lt;span class="nt"&gt;-U&lt;/span&gt; labuser &lt;span class="nt"&gt;-d&lt;/span&gt; payments &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'\dt'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the &lt;code&gt;simulated_payments&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;Check the number of synthetic payments:&lt;br&gt;
&lt;/p&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;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  deployment/lab-postgres &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  psql &lt;span class="nt"&gt;-U&lt;/span&gt; labuser &lt;span class="nt"&gt;-d&lt;/span&gt; payments &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'SELECT COUNT(*) FROM simulated_payments;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5. Test the application
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;scripts/02-smoke-test.sh&lt;/code&gt;:&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="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;NS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;payments-incident-lab

kubectl run &lt;span class="s2"&gt;"smoke-&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;curlimages/curl:8.11.1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--restart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Never &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--command&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'
    echo "READINESS:"
    curl -sS -i --max-time 10 \
      http://payment-api:8080/readyz

    echo
    echo "DB CHECK:"
    curl -sS -i --max-time 10 \
      http://payment-api:8080/api/db-check

    echo
    echo "SYNTHETIC PAYMENT:"
    curl -sS -i --max-time 10 \
      -X POST \
      http://payment-api:8080/api/payments \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: classroom-$(date +%s)" \
      -d "{\"amount_cents\":1250}"
'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scripts/02-smoke-test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected results:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Expected HTTP status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/readyz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/api/db-check&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/api/payments&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The temporary curl Pod may display an attach warning after completing its request. Focus on the actual HTTP response.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part C — Configure Grafana and Prometheus
&lt;/h1&gt;

&lt;p&gt;First verify the monitoring components:&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;-n&lt;/span&gt; monitoring

kubectl get crd servicemonitors.monitoring.coreos.com

kubectl get prometheus &lt;span class="nt"&gt;-n&lt;/span&gt; monitoring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the ServiceMonitor selectors:&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 prometheus &lt;span class="nt"&gt;-n&lt;/span&gt; monitoring &lt;span class="nt"&gt;-o&lt;/span&gt; yaml &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-A12&lt;/span&gt; serviceMonitorSelector
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the ServiceMonitor label matches your Prometheus 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; k8s/04-servicemonitor-optional.yaml

kubectl get servicemonitor &lt;span class="nt"&gt;-n&lt;/span&gt; monitoring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Grafana, select your Prometheus data source and create the following panels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Panel 1 — Payment API request rate by HTTP status
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nf"&gt;sum&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nb"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payment_http_requests_total&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5m&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This distinguishes successful requests from HTTP 400, 409 and 503 responses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Panel 2 — HTTP 5xx error rate
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nb"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payment_http_requests_total&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=~&lt;/span&gt;&lt;span class="s2"&gt;"5.."&lt;/span&gt;&lt;span class="p"&gt;}[&lt;/span&gt;&lt;span class="mi"&gt;5m&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;or&lt;/span&gt; &lt;span class="nb"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Panel 3 — Database errors over five minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nb"&gt;increase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payment_db_errors_total&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5m&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;or&lt;/span&gt; &lt;span class="nb"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Panel 4 — Available replicas
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="n"&gt;kube_deployment_status_replicas_available&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"payments-incident-lab"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;  &lt;span class="na"&gt;deployment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"payment-api"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Panel 5 — Desired replicas
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="n"&gt;kube_deployment_spec_replicas&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"payments-incident-lab"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;  &lt;span class="na"&gt;deployment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"payment-api"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Panel 6 — Pod readiness
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nf"&gt;sum&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;kube_pod_status_ready&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"payments-incident-lab"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;    &lt;span class="na"&gt;pod&lt;/span&gt;&lt;span class="o"&gt;=~&lt;/span&gt;&lt;span class="s2"&gt;"payment-api-.*"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Panel 7 — Payment request p95 latency
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight prometheus"&gt;&lt;code&gt;&lt;span class="nb"&gt;histogram_quantile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nf"&gt;sum&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;le&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nb"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;payment_http_request_duration_seconds_bucket&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;        &lt;span class="na"&gt;endpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/api/payments"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;      &lt;span class="p"&gt;}[&lt;/span&gt;&lt;span class="mi"&gt;5m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate test traffic before expecting request metrics to appear. Check that Prometheus is actually scraping the Payment API target. The metrics may remain absent if the ServiceMonitor selector is incorrect.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key learning point
&lt;/h3&gt;

&lt;p&gt;A dashboard can show:&lt;/p&gt;

&lt;p&gt;Available Pods&lt;/p&gt;

&lt;h1&gt;
  
  
  2 / 2
&lt;/h1&gt;

&lt;p&gt;Kubernetes sees healthy processes&lt;/p&gt;

&lt;p&gt;Payment API&lt;/p&gt;

&lt;h1&gt;
  
  
  503
&lt;/h1&gt;

&lt;p&gt;Database-dependent requests fail&lt;/p&gt;

&lt;p&gt;This is not contradictory. Kubernetes readiness and application business functionality are different signals.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part D — Create the incident
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Class 2: Midnight outage simulation
&lt;/h2&gt;

&lt;p&gt;Your instructor announces:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is 12:05 AM. PagerDuty has triggered a critical alert. Customers cannot complete payment transactions. Grafana shows elevated HTTP 503 errors, but all Payment API Pods appear healthy. You are the primary on-call engineer. Investigate the incident and identify the failing dependency.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 1. Confirm the healthy baseline
&lt;/h3&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;-n&lt;/span&gt; payments-incident-lab

bash scripts/02-smoke-test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not continue until the database check and payment request return HTTP 200.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2. Introduce the controlled failure
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;scripts/03-inject-outage.sh&lt;/code&gt;:&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="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; k8s/03-networkpolicy-outage.yaml

kubectl get networkpolicy &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'\nRun the smoke test and investigate.\n'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scripts/03-inject-outage.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scripts/02-smoke-test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When NetworkPolicy enforcement is active, expected behavior is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Payment API Pods&lt;/td&gt;
&lt;td&gt;Running, Ready&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL Pod&lt;/td&gt;
&lt;td&gt;Running, Ready&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API readiness endpoint&lt;/td&gt;
&lt;td&gt;HTTP 200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database connectivity endpoint&lt;/td&gt;
&lt;td&gt;HTTP 503&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Synthetic payment request&lt;/td&gt;
&lt;td&gt;HTTP 503&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application logs&lt;/td&gt;
&lt;td&gt;Database connectivity errors&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If requests still succeed, verify that NetworkPolicy enforcement is enabled. Do not assume the incident is active simply because &lt;code&gt;kubectl apply&lt;/code&gt; succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3. Investigate the incident
&lt;/h2&gt;

&lt;p&gt;Start with the Kubernetes resources:&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;-n&lt;/span&gt; payments-incident-lab &lt;span class="nt"&gt;-o&lt;/span&gt; wide

kubectl get deployments &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl get svc &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl get endpointslices &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the API Deployment:&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 deployment payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the API Pods:&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 pods &lt;span class="se"&gt;\&lt;/span&gt;
  &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;payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect application 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 deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;100 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--max-log-requests&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for errors indicating the application cannot communicate with PostgreSQL.&lt;/p&gt;

&lt;p&gt;Inspect the database:&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="se"&gt;\&lt;/span&gt;
  &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;lab-postgres &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl logs deployment/lab-postgres &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the NetworkPolicies:&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 networkpolicy &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl describe networkpolicy block-postgres-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl get networkpolicy &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl rollout &lt;span class="nb"&gt;history &lt;/span&gt;deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl rollout status deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important: In this particular incident, the API Deployment may have had no recent rollout at all. The problem is a networking configuration change, not necessarily a new container version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Student investigation script
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;scripts/04-investigate.sh&lt;/code&gt;:&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="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;NS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;payments-incident-lab

kubectl get pods,deploy,svc,endpointslices &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

kubectl describe deployment payment-api &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

kubectl logs deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;60 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--max-log-requests&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10

kubectl get networkpolicy &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; yaml

kubectl rollout &lt;span class="nb"&gt;history &lt;/span&gt;deployment/payment-api &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scripts/04-investigate.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Root-cause analysis
&lt;/h3&gt;

&lt;p&gt;In this lab, the NetworkPolicy selects the PostgreSQL Pod and allows no incoming traffic. The application can still start and answer &lt;code&gt;/readyz&lt;/code&gt;, but new PostgreSQL connections fail.&lt;/p&gt;

&lt;p&gt;The root cause is therefore database connectivity blocked by Kubernetes NetworkPolicy, not a crashed application Pod.&lt;/p&gt;

&lt;p&gt;A blind &lt;code&gt;kubectl rollout undo&lt;/code&gt; of the Payment API is not an appropriate fix because the network policy would remain in effect.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part E — Restore service
&lt;/h1&gt;

&lt;p&gt;After identifying the policy and following the classroom change procedure, remove the offending rule.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete networkpolicy block-postgres-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check that the application is still available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl rollout status deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;120s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the payment tests again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scripts/02-smoke-test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the database contains the successful synthetic payments:&lt;br&gt;
&lt;/p&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;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  deployment/lab-postgres &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  psql &lt;span class="nt"&gt;-U&lt;/span&gt; labuser &lt;span class="nt"&gt;-d&lt;/span&gt; payments &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'SELECT id, amount_cents, status, created_at
      FROM simulated_payments
      ORDER BY id DESC
      LIMIT 10;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;scripts/05-recover.sh&lt;/code&gt;:&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="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

kubectl delete networkpolicy block-postgres-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ignore-not-found&lt;/span&gt;

kubectl rollout status deployment/payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;120s

bash scripts/02-smoke-test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash scripts/05-recover.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recovery is verified when new database checks and synthetic payment requests succeed. In a real payment system, the application and database teams would also need to verify transaction integrity, retries and reconciliation.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part F — Terraform and AWS RDS investigation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Why Terraform matters
&lt;/h2&gt;

&lt;p&gt;In a production environment, PostgreSQL may run on Amazon RDS rather than inside Kubernetes.&lt;/p&gt;

&lt;p&gt;Suppose a GitHub Actions workflow applies a Terraform change that accidentally removes the security-group rule allowing the EKS application to reach RDS on TCP port 5432.&lt;/p&gt;

&lt;p&gt;The symptoms could resemble our lab: Kubernetes Pods are Ready, but application requests fail because database connections cannot be established.&lt;/p&gt;

&lt;p&gt;The two failure mechanisms are different:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Classroom lab&lt;/th&gt;
&lt;th&gt;Production reference scenario&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes NetworkPolicy blocks PostgreSQL ingress&lt;/td&gt;
&lt;td&gt;AWS security group blocks EKS-to-RDS traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PostgreSQL runs inside EKS&lt;/td&gt;
&lt;td&gt;PostgreSQL runs on Amazon RDS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fix the Kubernetes NetworkPolicy&lt;/td&gt;
&lt;td&gt;Restore the correct AWS security-group rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Investigate &lt;code&gt;kubectl get networkpolicy&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Investigate AWS VPC, security groups, CloudTrail and Terraform changes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  File 9 — &lt;code&gt;terraform/EXAMPLE_ONLY.tf&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;This is a teaching example. Do not run &lt;code&gt;terraform apply&lt;/code&gt; on this file against an existing AWS environment. The correct security group and identity must first be established.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"rds_security_group_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"approved_eks_application_security_group_id"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc_security_group_ingress_rule"&lt;/span&gt; &lt;span class="s2"&gt;"postgres_from_eks"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;security_group_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rds_security_group_id&lt;/span&gt;

  &lt;span class="nx"&gt;referenced_security_group_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;approved_eks_application_security_group_id&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;ip_protocol&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tcp"&lt;/span&gt;

  &lt;span class="nx"&gt;from_port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5432&lt;/span&gt;
  &lt;span class="nx"&gt;to_port&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5432&lt;/span&gt;

  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Approved EKS application traffic to PostgreSQL"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Terraform investigation commands
&lt;/h3&gt;

&lt;p&gt;For an actual managed Terraform project, first identify the correct repository, workspace, state and pipeline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform version

terraform workspace show

terraform state list

terraform plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review the plan and the last GitHub Actions run. Determine whether a rule was removed, replaced, or changed.&lt;/p&gt;

&lt;p&gt;Do not assume that the latest Terraform deployment caused the incident merely because it happened recently. Correlate the change timestamp with application errors, RDS connection failures, AWS configuration history and network evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD investigation
&lt;/h2&gt;

&lt;p&gt;Students should be able to explain this workflow:&lt;/p&gt;

&lt;p&gt;Developer creates pull request&lt;/p&gt;

&lt;p&gt;GitHub Actions: test, build, security checks&lt;/p&gt;

&lt;p&gt;Terraform fmt, validate, plan and review&lt;/p&gt;

&lt;p&gt;Approved infrastructure change&lt;/p&gt;

&lt;p&gt;Application deployment and post-deploy tests&lt;/p&gt;

&lt;p&gt;Prometheus / Grafana validation and alerting&lt;/p&gt;

&lt;p&gt;An important production lesson: a pipeline can finish successfully while the system is broken. Successful execution of &lt;code&gt;terraform apply&lt;/code&gt; only proves Terraform applied the requested changes; it does not prove payment processing still works.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part G — Three-class teaching schedule
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Class&lt;/th&gt;
&lt;th&gt;Duration&lt;/th&gt;
&lt;th&gt;Activities&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Class 1&lt;/td&gt;
&lt;td&gt;3 hours&lt;/td&gt;
&lt;td&gt;Architecture, team roles, Docker, PostgreSQL, EKS Deployment, Services, API testing, Grafana&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class 2&lt;/td&gt;
&lt;td&gt;3 hours&lt;/td&gt;
&lt;td&gt;PagerDuty ticket, incident injection, logs, database investigation, NetworkPolicy, Terraform and CI/CD analysis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Class 3&lt;/td&gt;
&lt;td&gt;3 hours&lt;/td&gt;
&lt;td&gt;Recovery, verification, incident report, prevention, mock interview and follow-up questions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Class 1 — Build the platform
&lt;/h2&gt;

&lt;p&gt;Students must finish with a working Payment API, two healthy replicas, PostgreSQL connectivity, successful synthetic payments and visible metrics.&lt;/p&gt;

&lt;p&gt;Instructor questions: What is the difference between a Deployment and a Service? Why do we use a Secret? What does a readiness probe check? How does the API connect to PostgreSQL? Why might database availability differ from Pod readiness?&lt;/p&gt;

&lt;h2&gt;
  
  
  Class 2 — Investigate the outage
&lt;/h2&gt;

&lt;p&gt;Do not immediately tell students the root cause. Present the incident ticket and ask them to gather evidence.&lt;/p&gt;

&lt;p&gt;Students should identify that the Pods are Ready, the database Pod is running, the API reports database connectivity errors, and a NetworkPolicy is blocking the connection.&lt;/p&gt;

&lt;p&gt;Instructor questions: Is this an application crash? Why are there no container restarts? Why does the HTTP 503 error appear? Why would restarting the Pods not fix the problem? What evidence would connect this to a Terraform change in AWS?&lt;/p&gt;

&lt;h2&gt;
  
  
  Class 3 — Recover and explain
&lt;/h2&gt;

&lt;p&gt;Students must explain the root cause, restore connectivity, validate synthetic payments, review Grafana, and present an incident report.&lt;/p&gt;

&lt;p&gt;They should distinguish between mitigation (restoring service), root cause (identifying the failing rule), and prevention (adding change controls and connectivity tests).&lt;/p&gt;

&lt;h1&gt;
  
  
  Part H — Interview preparation
&lt;/h1&gt;

&lt;p&gt;These are the questions students should practice aloud, with technically accurate answers.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Your Pods are Running and Ready, but customers receive HTTP 503. What do you investigate?
&lt;/h3&gt;

&lt;p&gt;Sample answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I would first assess the customer impact using Grafana or another monitoring tool. I would check the HTTP 5xx error rate, latency, and affected endpoints. Then I would inspect the Kubernetes Deployments, Pods, Services and application logs. Since the Pods are Ready, I would not assume Kubernetes itself is healthy end to end. I would investigate downstream dependencies such as the database, networking, authentication and external APIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. How can all Pods be Ready while payment processing is failing?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Kubernetes readiness only checks what the configured readiness probe verifies. If the probe checks only the application process, the Pod can remain Ready even when the database is unreachable. That's why I would also monitor transaction success rates and perform synthetic end-to-end checks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. What would you check first to determine whether the database is the problem?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would examine the application logs for connection timeouts, authentication failures, connection-pool exhaustion and query errors. Then I would check database health and connectivity. I would also review database metrics such as CPU, memory, connections, I/O and wait events.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4. How would you prove that a Terraform change caused the outage?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would correlate the incident start time with the Terraform pipeline execution. Then I would review the Terraform plan, the applied changes and AWS configuration history. If the change removed a required RDS security-group rule, I would verify that the affected application could no longer reach the database. I would use that evidence to establish causation rather than relying only on timing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  5. Would you immediately run &lt;code&gt;kubectl rollout undo&lt;/code&gt;?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Not automatically. I would first determine whether the application deployment caused the failure. If the root cause is a network rule or database configuration, rolling back the application might not help. I would follow the incident runbook and select the safest mitigation supported by the evidence.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  6. What is the difference between HTTP 502, 503 and 504?
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Common example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;502 Bad Gateway&lt;/td&gt;
&lt;td&gt;Gateway received an invalid response from an upstream server&lt;/td&gt;
&lt;td&gt;Reverse proxy cannot obtain a valid upstream response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;503 Service Unavailable&lt;/td&gt;
&lt;td&gt;Service cannot currently handle the request&lt;/td&gt;
&lt;td&gt;Payment API deliberately returns 503 when database is unavailable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;504 Gateway Timeout&lt;/td&gt;
&lt;td&gt;Gateway did not receive an upstream response in time&lt;/td&gt;
&lt;td&gt;ALB or proxy times out waiting for an application response&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A database timeout does not automatically mean the customer receives 504. In this lab, the application catches the error and explicitly returns 503.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Who would you involve in a SEV-1 incident?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would follow the company's incident-response procedure. Depending on the impact, I would involve the incident commander, application engineers, database team, platform engineers and release team. I would communicate the symptoms, current impact, evidence collected, and mitigation plan so the teams could work in parallel.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  8. How would you investigate a delayed failure after a successful release?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would compare the release timestamp with the first customer errors and infrastructure changes. I would investigate whether the failure was triggered by connection-pool exhaustion, database load, expired credentials, a scheduled job, network changes or traffic growth. I would also check whether the application had existing connections that continued working temporarily before new connections started failing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  9. What database metrics would you inspect?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would review CPU utilization, available memory, connection counts, disk I/O, read and write latency, active sessions, slow queries, locks and wait events. I would use those metrics to distinguish between database overload, slow queries, connection exhaustion and network connectivity failures.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  10. What is a database connection pool?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A connection pool maintains reusable database connections so an application doesn't need to establish a new connection for every request. If the pool is exhausted or connections become invalid, requests may wait, time out or fail. I would check active connections, pool utilization, wait time and timeout settings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  11. How would you restore service without creating additional risk?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would first identify the failing dependency and the last known good configuration. I would coordinate the mitigation through the incident process, restore only the necessary access, and verify recovery using application requests, database checks, monitoring and synthetic transactions. I would avoid broad security-group changes or unnecessary restarts.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  12. What would you do after recovery?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;I would confirm that error rates and payment success metrics returned to baseline. Then I would document the incident timeline, impact, root cause, mitigation and prevention actions. I would recommend post-deployment database connectivity checks, better dependency monitoring, Terraform plan review and appropriate change approvals.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Part I — Student incident report
&lt;/h1&gt;

&lt;p&gt;Every student must complete this report after Class 3.&lt;/p&gt;

&lt;p&gt;Incident report template&lt;/p&gt;

&lt;p&gt;Incident ID: INC-2026-1047&lt;/p&gt;

&lt;p&gt;Severity: SEV-1 (training scenario)&lt;/p&gt;

&lt;p&gt;Affected service: Payment Processing API&lt;/p&gt;

&lt;p&gt;Detection: PagerDuty / Grafana&lt;/p&gt;

&lt;p&gt;Start time: Record actual lab injection time&lt;/p&gt;

&lt;p&gt;Recovery time: Record actual successful verification time&lt;/p&gt;

&lt;p&gt;Customer impact: Synthetic payment requests failed in the lab; production customer impact is hypothetical&lt;/p&gt;

&lt;p&gt;Observed symptoms: API Pods Ready, database-dependent requests returned HTTP 503&lt;/p&gt;

&lt;p&gt;Root cause: PostgreSQL ingress blocked by Kubernetes NetworkPolicy&lt;/p&gt;

&lt;p&gt;Mitigation: Removed the offending policy in the isolated lab&lt;/p&gt;

&lt;p&gt;Verification: Database checks and synthetic payments returned HTTP 200&lt;/p&gt;

&lt;p&gt;Prevention: Network change reviews, dependency checks, monitoring, and automated connectivity tests&lt;/p&gt;

&lt;p&gt;Evidence: Attach command outputs, relevant logs, Grafana screenshots and the exact configuration change.&lt;/p&gt;

&lt;h2&gt;
  
  
  File 10 — &lt;code&gt;scripts/01-check.sh&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

kubectl get nodes
kubectl get ns
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; monitoring

kubectl get pods,deploy,svc &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab

kubectl get networkpolicy &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; payments-incident-lab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  File 11 — &lt;code&gt;scripts/06-cleanup.sh&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Use only after the classes are finished. This deletes the entire training namespace and its synthetic database.&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="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nb"&gt;read&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s1"&gt;'Delete ENTIRE payments-incident-lab namespace? Type DELETE: '&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  answer

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$answer&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"DELETE"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;kubectl delete namespace payments-incident-lab
&lt;span class="k"&gt;else
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Canceled."&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To clean up the optional ServiceMonitor separately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl delete servicemonitor payment-api &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-n&lt;/span&gt; monitoring &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ignore-not-found&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final student challenge
&lt;/h2&gt;

&lt;p&gt;Your instructor will ask:&lt;/p&gt;

&lt;p&gt;"It is 12:05 AM. Your Payment API has two healthy Pods, PostgreSQL is Running, and your application deployment has not changed. However, payment requests are returning HTTP 503. What are your first actions, how do you identify the root cause, who do you involve, and how do you restore service safely?"&lt;/p&gt;

&lt;p&gt;You must be able to explain the investigation in your own words, demonstrate the relevant commands, identify the exact failed dependency, and verify the recovery.&lt;/p&gt;

&lt;p&gt;Your goal is not to memorize commands. Your goal is to think and communicate like a DevOps/SRE engineer responding to a production incident.&lt;/p&gt;

&lt;p&gt;JumpToTech DevOps Engineering · Practical Incident Response Training&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
