<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Batuhan Bulut on Medium]]></title>
        <description><![CDATA[Stories by Batuhan Bulut on Medium]]></description>
        <link>https://medium.com/@bulutbatuhan?source=rss-107bcaf7b00e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rrABb_dcuQ_SeQmjxGfdSw.jpeg</url>
            <title>Stories by Batuhan Bulut on Medium</title>
            <link>https://medium.com/@bulutbatuhan?source=rss-107bcaf7b00e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:30:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bulutbatuhan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running CI/CD on Hyper-V? Say No More.]]></title>
            <link>https://aws.plainenglish.io/ci-cd-on-hyper-v-with-github-actions-4f3fc482844d?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f3fc482844d</guid>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Sun, 31 May 2026 18:02:16 GMT</pubDate>
            <atom:updated>2026-05-31T18:02:16.534Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Continuous Delivery is a software development discipline where you build software in such a way that the software can be released to production at any time.” — <a href="https://martinfowler.com/bliki/ContinuousDelivery.html">Martin Fowler</a></blockquote><p>In modern software development, CI/CD is no longer something we can ignore. Not only in professional environments, <strong>but also in our own homelab setups</strong>.</p><p>However, almost all tutorials and guides online focus mainly on Linux-based workflows, or they assume that you already have access to a cloud provider such as <strong>AWS</strong> or <strong>Azure</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o0Vjjd9AHBz7Q0Os" /><figcaption>Photo by <a href="https://unsplash.com/@wocintechchat?utm_source=medium&amp;utm_medium=referral">Christina @ wocintechchat.com M</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this guide, we will walk through how to deploy a Linux virtual machine on Hyper-V using a CI/CD workflow, just for fun!</p><p>Plus I will explain every step to understand how automation works outside of <em>traditional</em> cloud environments.</p><blockquote>You can check out the repository from here: <a href="https://github.com/batuhan-bulut/powershell-vm-hyperv">https://github.com/batuhan-bulut/powershell-vm-hyperv</a></blockquote><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>How we can achieve this?</h3><p>I prepared a <strong>PowerShell script</strong> to launch an Ubuntu instance.</p><p>The script accepts several arguments, allowing you to customize the VM based on your needs, <strong>such as CPU, RAM, storage size, network switch, and more.</strong></p><p>For run that script, we will use <em>CI/CD</em> step for governance and scalability. But it can be also <strong>run in local without</strong> <em>CI/CD</em>.</p><h4>Important Parameters</h4><blockquote>(you can find full list in <a href="https://github.com/batuhan-bulut/powershell-vm-hyperv/blob/main/README.md">README.md</a>):</blockquote><pre>VMName: The name of the Hyper-V Virtual Machine to be created. Default: &quot;Ubuntu26-VM&quot;<br>WorkDir: The directory where downloads, disk images, and temp files are stored. Default: &quot;C:\HyperV-Ubuntu&quot;<br>UbuntuVersion: The version of Ubuntu to download. Default: &quot;26.04&quot;<br>Username: The default admin username to create in the VM. Default: &quot;ubuntu&quot;<br>Password: The password for the default admin user. Only used with -AllowPasswordAuth.<br>SshPublicKey: Optional SSH public key (e.g. &quot;ssh-rsa AAAAB3N...&quot;) to add to authorized_keys for the user.<br>MemorySize: The startup memory size for the VM. Default: 2GB<br>DiskSize: Optional OS disk size for the dynamic VHDX. Use PowerShell size literals such as 32GB or 64GB. If omitted, the Ubuntu cloud image size is used.<br>CpuCount: The number of virtual processors for the VM. Default: 2<br>SwitchName: The name of the Hyper-V virtual switch to connect the VM to. If unspecified, it automatically<br>    detects the &quot;Default Switch&quot; or the first available internal/external switch.</pre><h4>Requirements</h4><ul><li>A Windows machine with Hyper-V enabled</li><li>GitHub, GitLab, or another <em>CI/CD</em> provider</li><li>Runner installed on the Windows machine</li></ul><h3>What does the PowerShell script do?</h3><p>The PowerShell script is designed to be flexible and <strong>CI/CD-friendly</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wQ5uSBWN0wPV-zdQ" /><figcaption>Photo by <a href="https://unsplash.com/@sunriseking?utm_source=medium&amp;utm_medium=referral">Sunrise King</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>It accepts parameters, <strong>allowing you to customize</strong> the virtual machine configuration before the deployment starts.</p><p>At a high level, the script performs the following steps:</p><ul><li>Checks whether Hyper-V is available and PowerShell is running with <strong>Administrator</strong> privileges.</li><li>Detects a Hyper-V virtual switch automatically if one is not provided. It first looks for the Default Switch, then falls back to the first available switch.</li><li>Downloads the selected Ubuntu Server cloud image<strong> from the official Ubuntu cloud image release</strong> URL <em>(If not exists)</em>.</li><li>Converts the Ubuntu .img file into a dynamic Hyper-V .vhdx disk using <strong>QEMU.</strong></li><li>Generates the cloud-init configuration that will be executed during the VM’s first boot.</li><li>Creates the <strong>Hyper-V virtual machine</strong> with the requested CPU, memory, storage, and network configuration.</li><li><strong>Displays the VM’s IP address</strong> after the deployment is completed.</li></ul><h3>CI / CD Steps</h3><blockquote>I will continue to explain in Github but steps are quite similar for other platforms.</blockquote><p>To run this in your environment either you need to push the code to your environment.</p><p>If you’re using Github, <strong>you can directly fork it to your account.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44QqDHTSZzvoGmIGQvBBHA.png" /><figcaption>How to fork</figcaption></figure><h4>How do we execute the code automatically?</h4><p>To automate the execution, we will use GitHub Actions runners.</p><p>A runner is an application that waits for <strong>workflow/jobs</strong> and executes the steps defined in our pipeline/action list.</p><p>In our case, the runner will execute the <strong>PowerShell script automatically and create the Ubuntu virtual machine on Hyper-V</strong>.</p><p>We need to <strong>install a Github Runner</strong> to our Windows instance associate with forked repository. For this step, you can follow <strong>official documentation</strong> of GitHub:</p><p><a href="https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/add-runners">How to add self-hosted Runners | Github</a></p><p>After we successfully installed the runner, <strong>we should see our runner under our repository. We will use the tags to select this runner in next steps.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FoNJQwDcA7_uBvVIZkX8fg.png" /></figure><h4>Configure the Script</h4><p>We can split the configuration to 2 part</p><ul><li><strong>Runner</strong> environment variable (<em>if you’re using a plaintext password</em>)</li><li><strong>PowerShell</strong> Script Arguments (<em>to configure VM itself</em>)</li></ul><p><strong>Runner environment variable</strong></p><p>We can pass the <strong>our VM password via Environment variables securely</strong>. To do that we can navigate Settings &gt; Secrets and variables &gt; Actions &gt; Repository secrets</p><p>Add a new secret named UBUNTU_VM_PASSWORD and define the <strong>password as value.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ejbM5EvkvCLW2X-4z6Jeg.png" /></figure><p><strong>PowerShell Script Arguments</strong></p><p>To change arguments kindly navigate .github/workflows/create-ubuntu-vm.yml file.</p><p>In the file, we have a command to execute the <strong>Powershell script itself.</strong> Modify it to match with your expectations. On my example, machine will created with <em>32 GB Storage</em> and “<em>TestUbuntu26</em>” name. other settings (<em>such as CPU, RAM, etc</em>) are will be selected as default values.</p><p>Also on the runs-on part we’re <strong>choosing which GitHub runner</strong> we should use. We should make sure at least one of values matching with out GitHub Runner.</p><pre>jobs:<br>  create-ubuntu:<br>    runs-on: [self-hosted, Windows]<br><br>    steps:<br>      - name: Checkout repository<br>        uses: actions/checkout@v4<br><br>      - name: Run PowerShell script<br>        shell: powershell<br>        env:<br>          UBUNTU_VM_PASSWORD: ${{ secrets.UBUNTU_VM_PASSWORD }}<br>        run: |<br>          .\Create-Ubuntu-HyperV.ps1 `<br>            -VMName &quot;TestUbuntu26&quot; `<br>            -DiskSize 32GB `<br>            -AllowPasswordAuth `<br>            -NonInteractive</pre><p>After you made the changes merge your branch with main branch (<em>or directly push to </em><em>main</em>).</p><p>You will observe that your pipeline is running, and you can<strong> follow via logs.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cs1k_sJA3i-QjywD0ZfrXQ.png" /><figcaption>Pipeline Logs</figcaption></figure><h3>Pipeline Results</h3><p>When it’s completed we can observe that it shows the IP address of the VM for the ssh connection. Now <strong>I can connect</strong> via ssh to my newly created Ubuntu instance.</p><pre>Starting VM &#39;TestUbuntu26&#39;...<br>VM &#39;TestUbuntu26&#39; started successfully!<br><br>==================================================<br>  Deployment complete!<br>  1. Open Hyper-V Manager to connect to the console.<br>  2. Credential details:<br>     - Username: ubuntu<br>     - Password authentication enabled for the supplied password.<br>  3. Wait for cloud-init to install Hyper-V KVP support on first boot.<br>==================================================<br>Waiting for VM IP address... elapsed 00:00<br>Waiting for VM IP address... elapsed 00:15<br>...<br>...<br>Waiting for VM IP address... elapsed 04:24<br>VM IP Addresses for SSH after 04:39: 172.17.134.97</pre><p>Also we can see the instance itself on Hyper-v</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUD3BRsvr4VsFiR0-suxhQ.png" /></figure><p>To connect the instance I’m running ssh ubuntu@172.17.134.97</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*shhOarT0F0xDUSgtrYjDMw.png" /></figure><p>and voila! We connected our Ubuntu VM with ssh!</p><h3>Final Thoughts</h3><p>That’s it! We successfully deployed an Ubuntu virtual machine on Hyper-V using a CI/CD workflow.</p><p>The main idea behind this guide is simple: <strong>automation and CI/CD should not be limited to cloud environments</strong>. With a PowerShell script, a self-hosted runner, and GitHub Actions, we can also automate local infrastructure in a clean and repeatable way.</p><p>For homelab setups, testing, or learning purposes, this can be a very useful approach.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f3fc482844d" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/ci-cd-on-hyper-v-with-github-actions-4f3fc482844d">Running CI/CD on Hyper-V? Say No More.</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubespray: Zero to Hero — How to setup your Kubernetes Cluster]]></title>
            <link>https://aws.plainenglish.io/kubespray-zero-to-hero-how-to-setup-your-kubernetes-cluster-a145e1cd496b?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a145e1cd496b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubespray]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 17:25:48 GMT</pubDate>
            <atom:updated>2026-05-31T18:03:31.423Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubespray: Zero to Hero — How to setup your Kubernetes Cluster</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EVJekhaguxHKlhG5fVT_RQ.jpeg" /></figure><p>Kubespray is great mixture of <strong>Ansible and Kubernetes</strong>. With Kubespray you can create fully customized kubernetes cluster in your Bare metal in minutes.</p><p>What is <strong>Kubespray</strong> does is basically running <strong>Ansible</strong> scripts on your Servers (<em>aka Kubernetes Nodes</em>) for <strong>install &amp; configure</strong> your Kubernetes cluster. Instead of you’re dealing with a lot of commands &amp; errors with kubeadm you just run some playbooks.</p><h3>Before Starting</h3><p>On this article we will create our own Kubernetes cluster with 2 servers (<em>1 master, 1 worker node</em>) with multipass.</p><blockquote>Important Note</blockquote><p>I want to <strong>warn</strong> you, this is only tutorial for “how to use kubespray?” , if you’re looking for kubernetes cluster for your local tests, etc. <strong>There are better options. This article will focus on Kubespray details.</strong></p><p>First of all, we need 2 servers for our nodes, I will use multipass with <strong>Ubuntu v22.04</strong> but you can use other supported OS versions. If you don’t wanna use multipass you can use Kubespray with <strong>AWS, GCE, Azure, OpenStack, vSphere, Equinix Metal</strong>, <strong>Oracle Cloud </strong>(<em>Experimental</em>), or <strong>Bare metal</strong>.</p><p>Since this article cover all basics, <strong>you can still deploy to your environment with same steps.</strong></p><p>If you <strong>already have Virtual Servers</strong> you can directly skip to “<em>Download and Configure Kubespray</em>” step. Just make sure edit the Network / Firewall settings for Kubernetes and local access.</p><blockquote>In example; you don’t need to install multipass if you already have Ubuntu Servers in your VM or AWS EC2, etc</blockquote><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>Requirements</h3><p>We will need few items before start to setup our kubernetes cluster.</p><ul><li><strong>Multipass</strong> <em>for Ubuntu Servers.</em></li><li><strong>Python</strong> <em>for managing virtual environment</em> (<em>alternatively you can also use </em><a href="https://github.com/kubernetes-sigs/kubespray"><em>Dockerized version</em></a><em> but on this you will require Docker on your local</em>).</li><li><strong>ssh-keygen </strong><em>for creating a key &amp; accessing the servers.</em></li><li><strong>kubectl</strong> <em>for interact with our cluster.</em></li><li><strong>4 CPU &amp; 4 GB RAM</strong> for <em>our cluster itself.</em></li><li><strong>git</strong> <em>for downloading Kubespray </em>(<em>optional, you can also download as ZIP</em>)</li><li>Network Requirements Internal <em>for All TCP, UDP, ICMP should be allowed in Kubernetes instances for the traffic between them.</em></li><li>Network Requirements External <em>for SSH port 22 and 6443 port should be allowed from your local to All Kubernetes instance subnet.</em></li></ul><h3>How to Setup Kubernetes Cluster?</h3><h4>Preparing the Kubernetes Nodes</h4><p>First we need to install multipass for our Ubuntu Servers.</p><blockquote>If you don’t have multipass on your environment <a href="https://canonical.com/multipass/install">install it here</a></blockquote><p><strong>It’s important the you execute the commands in the same directory.</strong></p><p>Let’s create a new directory called ssh_key for SSH Keys and navigate inside .</p><p>After installed we <strong>need to create a SSH Key for ansible</strong>. Ansible uses ssh connection to connect your servers &amp; run the playbooks. With this command we can generate our SSH Key: ssh-keygen -C kubespray -f kubespray-ssh-key</p><pre>ssh_key % ssh-keygen -C kubespray -f kubespray-ssh-key<br><br>Generating public/private ed25519 key pair.<br>Enter passphrase for &quot;kubespray-ssh-key2&quot; (empty for no passphrase): <br>Enter same passphrase again: <br>Your identification has been saved in kubespray-ssh-key<br>Your public key has been saved in kubespray-ssh-key.pub<br>The key fingerprint is:<br>SHA256:4FxxlPkqpjseQ96jMJI8cTNl1Yl8sg45DFGzbahUVy8 kubespray<br>The key&#39;s randomart image is:<br>+--[ED25519 256]--+<br>|    .o+.+=++     |<br>|    .. B+o*.     |<br>|    .o*.++E..    |<br>|   . *=+.  ..    |<br>|  . = ++S  .     |<br>| . + = .+ .      |<br>|  = o +oo.       |<br>|   o oo+ .       |<br>|     .+o         |<br>+----[SHA256]-----+</pre><p>After SSH Key generated you will see 2 files (<em>kubespray-ssh-key, kubespray-ssh-key.pub</em>) created under ssh_key folder.</p><p>Now, let’s create a new text file called init.yaml with the text below and paster the context of <em>kubespray-ssh-key.pub. </em>With this move <strong>we will inject our SSH Key to our Ubuntu Servers automatically</strong>.</p><pre>users:<br>  - default<br>  - name: kubespray<br>    sudo: ALL=(ALL) NOPASSWD:ALL<br>    ssh_authorized_keys:<br>    - &lt;CONTEXT OF kubespray-ssh-key.pub here &gt;</pre><p>At the same directory <strong>execute these commands</strong> to create servers for our Kubernetes Cluster.</p><pre>multipass launch 22.04 --name kspray-k8s-master --cpus 2 --memory 2G --disk 20G --cloud-init init.yaml<br>multipass launch 22.04 --name kspray-k8s-worker --cpus 2 --memory 2G --disk 20G --cloud-init init.yaml</pre><p>After that we can confirm our servers are running and we can get the IP with multipass list command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUQf1oUk0Oe3WbL5XYmSpQ.png" /><figcaption>multipass list</figcaption></figure><p>With this <strong>we can confirm servers</strong> are ready for Kubernetes.</p><h4>Downloading Kubespray</h4><p>To downloading Kubespray I will use <strong>git</strong>.</p><blockquote>If you don’t have git you can still download as zip from <a href="https://github.com/kubernetes-sigs/kubespray/tree/release-2.29">here</a></blockquote><p>Let’s create a virtual Python environment to not break the System packages (if python3 throws error, try replacing with python):</p><pre>python3 -m venv venv<br>source venv/bin/activate</pre><p>Execute these commands if you have <strong>git: </strong><em>(alternatively download as ZIP)</em></p><pre>git clone https://github.com/kubernetes-sigs/kubespray.git<br>cd kubespray<br>git checkout release-2.29</pre><p>Next step is <strong>installing dependencies for Ansible</strong> to run the Kubespray playbooks (<em>run this command in </em><em>kubespray folder</em>):</p><pre>pip install -r requirements.txt</pre><p>Right now, we successfully downloaded Kubespray and prepared for execution. Only missing part is configuring the Kubespray.</p><h4>Configuring Kubespray</h4><p><strong>Kubespray</strong> uses folder called inventory for managing resources and storing configurations. To start we can navigate the inside of the inventory folder and duplicate sample folder and rename as you <strong>like</strong> (<em>I renamed as </em><em>k8s-medium</em>)</p><h4><strong>Inside of the folder we have these items:</strong></h4><ul><li>inventory.ini</li><li>(<em>folder</em>) group_vars/all</li><li>(<em>folder</em>) group_vars/k8s_cluster</li></ul><p>With inventory.ini we will add our configurations for our servers such as <em>IP, node labels, roles, etc.</em></p><p>all folder contains settings for Infra level settings such as <em>AWS, Azure settings or configurations for if it’s air-gapped environment ,etc.</em></p><p>k8s_cluster folder contains settings for configuring kubernetes itself like <em>CNI, CSI, Addons, etc.</em></p><p>Let’s edit our inventory.ini file:</p><blockquote>Don’t forget the change the IP’s with your multipass list output.</blockquote><pre>[all]<br>master  ansible_host=192.168.64.9  ip=192.168.64.9  node_labels=&quot;{&#39;kubernetes.io/role&#39;: &#39;master&#39;}&quot;<br>worker1 ansible_host=192.168.64.10 ip=192.168.64.10 node_labels=&quot;{&#39;kubernetes.io/role&#39;: &#39;worker&#39;}&quot;<br><br># ## configure a bastion host if your nodes are not directly reachable<br># [bastion]<br># bastion ansible_host=x.x.x.x ansible_user=some_user<br><br>[kube_control_plane]<br>master<br><br>[etcd]<br>master<br><br>[kube_node]<br>worker1<br><br>[k8s_cluster:children]<br>kube_control_plane<br>kube_node</pre><p>In here this is what we configured:</p><p>[all] section we defined our Nodes with their names. ansible_host parameter is for SSH IP to the machines. ip <strong>parameter is used by Kubernetes for internal traffic</strong>. node_labels for labeling my nodes with their roles for easy understanding.</p><blockquote>In here my ansible_host and ip parameter are having the same IP because <strong>I’m working on my local</strong>.</blockquote><blockquote>If your instances are not in your local, you need to specify ansible_host parameter with the public IP’s of the servers, and make sure you can reach the 22 port of the instance from your local.</blockquote><p>[bastion] section is for <strong>if your nodes cannot accessible directly</strong> and you need to connect some bridge before. It’s commented out on my config.</p><p>[kube_control_plane]section for installing the “<em>Control Plane</em>” (<em>API Server, Scheduler, Controller Manager</em>) to master node.</p><p>[etcd] section for installing the etcd database on the master node.</p><p>[kube_node] section for determining which nodes are worker for run your actual Kubernetes apps. <em>Which is </em><em>worker1 on my end.</em></p><p>After configuring inventory.ini we also needed to c<strong>hange one more setting for accessing the cluster from our local.</strong></p><p>To do that navigate group_vars/k8s_cluster/k8s-cluster.yaml and comment out &amp; set as true this setting : kubeconfig_localhost</p><p>With this it will export the secrets to our local after everything completed.</p><h3>Let’s Create our Kubernetes Cluster</h3><p>Since we completed all previous steps, <strong>we can execute the Kubespray to install our Kubernetes.</strong></p><p>To do that we can execute command below inside of the kubespray folder.</p><pre>ansible-playbook -i inventory/k8s-medium/inventory.ini -u kubespray -b --private-key=../ssh_key/kubespray-ssh-key cluster.yml</pre><p>What this command does are, uses <strong>Ansible</strong> to deploy a <strong>Kubernetes cluster</strong> by logging into remote servers as the user kubespray via a specific <strong>SSH key</strong>, gaining <strong>root privileges</strong>, and executing the installation steps defined in the cluster.yml playbook using the provided <strong>inventory file</strong>.</p><p>When you executed that command <strong>Kubespray</strong> will <strong>start to configure &amp; deploy your cluster to the servers</strong>. It may take <em>10–20 min</em> depending your connection, and you can track the status from the terminal.</p><p>When It’s completed you will see output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9ds4_JYweGkkCAjE9SksQ.png" /><figcaption>Kubespray completed output</figcaption></figure><p>And artifacts are exported under kubespray/inventory/k8s-medium/artifacts/</p><p>We can use this to connect our kubernetes cluster. <strong>To do that </strong>we can edit our kubeconfig for kubectl with this command:</p><pre>export KUBECONFIG=$(pwd)/inventory/k8s-medium/artifacts/admin.conf</pre><p>Execute kubectl get nodes to confirm our cluster are ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oBo4DxQC1BCgG019wSOBFQ.png" /><figcaption>kubectl get nodes output</figcaption></figure><h4><strong>Congrats! We successfully setup a Kubernetes Cluster with 2 Ubuntu Instances.</strong></h4><h4>But what if I need more / less node to my current installation?</h4><p>Kubespray has a solution for that! We can easily add / remove nodes from our clusters.</p><h3>Add new node to Kubernetes cluster with Kubespray</h3><p>Let’s <strong>launch a new server</strong>.</p><pre>multipass launch 22.04 --name kspray-k8s-worker2 --cpus 2 --memory 2G --disk 20G --cloud-init init.yaml</pre><p>After it’s launched get the IP of the new Node with multipass list and add it to inventory.ini file:</p><pre>[all]<br>master ansible_host=192.168.64.9 ip=192.168.64.9 node_labels=&quot;{&#39;kubernetes.io/role&#39;: &#39;master&#39;}&quot;<br>worker1 ansible_host=192.168.64.10 ip=192.168.64.10 node_labels=&quot;{&#39;kubernetes.io/role&#39;: &#39;worker&#39;}&quot;<br>worker2 ansible_host=192.168.64.11 ip=192.168.64.11 node_labels=&quot;{&#39;kubernetes.io/role&#39;: &#39;worker-2&#39;}&quot;<br><br>[kube_control_plane]<br>master<br><br>[etcd]<br>master<br><br>[kube_node]<br>worker1<br>worker2<br><br>[k8s_cluster:children]<br>kube_control_plane<br>kube_node</pre><p>With this, <strong>we configured our new node</strong> as worker2 and add it to kube_node . Instead of running all cluster.yaml again right now we will execute scale.yaml</p><pre>ansible-playbook -i inventory/k8s-medium/inventory.ini -u kubespray -b --private-key=../ssh_key/kubespray-ssh-key scale.yml</pre><p>This command will <strong>scale-up our clusters</strong> with the new node automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPJyr7IHyf_q8CgFABw4BQ.png" /><figcaption>PoC of 3 Nodes</figcaption></figure><h3>Remove node from Kubernetes cluster with Kubespray</h3><p><strong>For removing a node from your cluster </strong>(<em>scaling-down</em>) we can use node-remove.yaml</p><p><strong>First we need to make sure our Node is empty</strong> and ready for <em>unregister</em> from cluster. For that we can execute this command:</p><blockquote>Kubespray will also drain the node for you, but I prefer the drain by myself to control the progress.</blockquote><pre>kubectl drain &lt;node-name&gt; --ignore-daemonsets</pre><p><strong>With that we will move existed pods to new nodes and deny new pods. </strong>--ignore-daemonsets is required parameter for deamonsets, without this flag command will fail if you have DaemonSet in your cluster.</p><p>If you faced with an error about local storage it means one of your pods using Host Storage with emptyDir setting. Make sure it’s safe to remove the data and execute the same command with additional --delete-emptydir-data flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMyUmjPpCoDC1oMOe_i8dQ.png" /></figure><p><strong>After node drained</strong>, we can run Kubespray playbook to deregister the node from the cluster. To do that we need to run remove-node.yml with extra -e &quot;node=worker2&quot; parameter.</p><pre>ansible-playbook -i inventory/k8s-medium/inventory.ini -u kubespray -b --private-key=../ssh_key/kubespray-ssh-key remove-node.yml -e &quot;node=worker2&quot;</pre><p>While it’s playing <strong>it will ask confirmation</strong> from you, type yes .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS11paylXwAp1TUiMTxJ2A.png" /><figcaption>User Interaction</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BiKm4qUwEYGuDJel-E-HCA.png" /><figcaption>Playbook comleted</figcaption></figure><p>After the playbook, you can safely delete the Ubuntu machine with multipass delete worker2</p><h3>Summary &amp; What we learned</h3><p>In this article, we learned <strong>Kubespray </strong><em>(powered by Ansible) </em>orchestra chef for<em> </em>Kubernetes with basics. Also we learned how to Install from scratch, Scale up and scaling down with <strong>Kubespray</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a145e1cd496b" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/kubespray-zero-to-hero-how-to-setup-your-kubernetes-cluster-a145e1cd496b">Kubespray: Zero to Hero — How to setup your Kubernetes Cluster</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Playground: LocalStack]]></title>
            <link>https://aws.plainenglish.io/localstack-aws-340af8aa8c28?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/340af8aa8c28</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[localstack]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Sat, 13 Dec 2025 19:18:42 GMT</pubDate>
            <atom:updated>2026-05-31T18:03:49.433Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9NzoLPYZALLqoEdbc2Y_w.jpeg" /></figure><p>If you are <strong>new to cloud systems, new to DevOps/Platform Engineering roles </strong>or <strong>preparing for AWS certifications</strong>, hands-on practice is important for mastery.</p><p>After we spent enough time with exercises and practises, we need to get an <strong>experience by ourselves</strong>. To do that we can create AWS account but a simple typo or configuration mistake can unfortunately lead to an <strong>unexpectedly high bill</strong>.</p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>What if we have some test environment on our local?</h3><blockquote>Localstack, AWS Engine in our local</blockquote><p><strong>LocalStack </strong>resolves that issue for us. It’s successfully emulate AWS environment for CLI commands and IaC softwares like Terraform, Pulumi.</p><p>With LocalStack we can test;</p><ul><li><em>IaC Terraform</em></li><li><em>IaC Pulumi</em></li><li><em>AWS CLI</em></li><li><em>AWS SDK</em></li></ul><p>With only LocalStack, <strong>we can run our Terraform code or test our AWS SDK without actual AWS Bill.</strong></p><h4>Goal of the guide</h4><p>On this article I will guide for create a S3 bucket for our website contents with Terraform and Pulumi to LocalStack.</p><h3>How to Install LocalStack?</h3><p>Installation is pretty straightforward,</p><p>For Mac users it’s just one command is enough. If brew and docker already installed you can run the localstack <strong>by just running</strong>:</p><pre>brew install localstack/tap/localstack-cli &amp;&amp; localstack start</pre><p><a href="https://docs.localstack.cloud/aws/getting-started/installation/">Alternative Methods for Installation</a></p><p>We can see this output on our terminal:</p><pre><br>     __                     _______ __             __<br>    / /   ____  _________ _/ / ___// /_____ ______/ /__<br>   / /   / __ \/ ___/ __ `/ /\__ \/ __/ __ `/ ___/ //_/<br>  / /___/ /_/ / /__/ /_/ / /___/ / /_/ /_/ / /__/ ,&lt;<br> /_____/\____/\___/\__,_/_//____/\__/\__,_/\___/_/|_|<br><br>- LocalStack CLI: 4.12.0<br>- Profile: default<br>- App: https://app.localstack.cloud<br><br>[17:50:44] starting LocalStack in Docker mode 🐳                                                                                                                                                                                            localstack.py:532<br>2025-12-13T17:50:44.909  INFO --- [  MainThread] l.p.c.b.licensingv2        : Successfully activated cached license 59d4d38cb459:trial from localstack-cli/license.json 🔑✅<br>─────────────────────────────────────────────────────────────────────────────────────────────────────── LocalStack Runtime Log (press CTRL-C to quit) ───────────────────────────────────────────────────────────────────────────────────────────────────────<br><br>LocalStack version: 4.12.1.dev4<br>LocalStack build date: 2025-12-12<br>LocalStack build git hash: cd03fe7d0<br><br>2025-12-13T16:50:47.025  INFO --- [  MainThread] l.p.c.b.licensingv2        : Successfully activated cached license 59d4d38cb459:trial from /etc/localstack/conf.d/license.json 🔑✅<br>2025-12-13T16:50:47.481  INFO --- [  MainThread] l.p.c.extensions.plugins   : loaded 0 extensions</pre><p>And also if you created an account on LocalStack, you can see it’s up and running in your browser.</p><h3>How to use LocalStack?</h3><blockquote>It requires a configuration to use LocalStack instead of AWS</blockquote><p>Installation was easy part, to use LocalStack with AWS CLI or Terraform etc we need to determine the -endpoint to LocalStack everytime.</p><p>Instead of that I preferred to install wrappers for Terraform and Create a profile for AWS CLI:</p><h4>AWS CLI on LocalStack</h4><p>I already have AWS CLI on my local (<a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"><em>download from here if you don’t have it</em></a>), So I created my profile and credentials,</p><pre># Location: ~/.aws/config<br><br>[profile localstack]<br>region=us-east-1<br>output=json<br>endpoint_url = http://localhost:4566<br><br># Location: ~/.aws/credentials<br><br>[localstack]<br>aws_access_key_id=test<br>aws_secret_access_key=test</pre><p>After I configured my profile, I query my S3 buckets to confirm it’s working:</p><p>I ran aws s3 ls command to do that and on LocalStack Terminal I saw this line:</p><pre>2025-12-13T17:02:50.586  INFO --- [et.reactor-2] localstack.request.aws     : AWS s3.ListBuckets =&gt; 200</pre><p>It means I successfully configured. (<a href="https://docs.localstack.cloud/aws/integrations/aws-native-tools/aws-cli/"><em>more details about LocalStack AWSCLI</em></a><em>)</em></p><h4>Terraform on LocalStack</h4><p>For terraform we can configure the endpoints to LocalStack and import AWS_Keys but with every new service you needed to edit the configuration file. Instead of that I prefer to install tflocal which is the same with Terraform, just pre-configured with LocalStack endpoints.</p><pre>pip install terraform-local</pre><h3>Let’s deploy our first application</h3><blockquote>Local Website in LocalStack, a-w-e-s-o-m-e</blockquote><p>To keep it simple, I will only deploy a S3 Bucket with configured of backend for a Website. And I will have 2 file (<em>index.html, 404.html</em>) to serving from S3 bucket.</p><p>All configuration also can be found on <a href="https://github.com/batuhan-bulut/localstack-terraform">GitHub Repo</a></p><p>Jump the <strong>Terraform Apply</strong> part if you already downloaded.</p><h4>Terraform &amp; Website Contents</h4><p>main.tf</p><pre>#main.tf<br><br>resource &quot;aws_s3_bucket&quot; &quot;s3_bucket&quot; {<br>  bucket = &quot;localstack-website-bucket&quot;<br>  tags = {<br>    Environment = &quot;Localstack&quot;<br>    Project     = &quot;Website Hosting&quot;<br>  }<br>}<br><br>resource &quot;aws_s3_bucket_website_configuration&quot; &quot;s3_bucket&quot; {<br>  bucket = aws_s3_bucket.s3_bucket.id<br>  index_document {<br>    suffix = &quot;index.html&quot;<br>  }<br>  error_document {<br>    key = &quot;404.html&quot;<br>  }<br>}<br><br>resource &quot;aws_s3_bucket_acl&quot; &quot;s3_bucket&quot; {<br>  bucket = aws_s3_bucket.s3_bucket.id<br>  acl    = &quot;public-read&quot;<br>}<br><br>resource &quot;aws_s3_object&quot; &quot;object_www&quot; {<br>  depends_on   = [aws_s3_bucket.s3_bucket]<br>  for_each     = fileset(&quot;${path.root}&quot;, &quot;www/*.html&quot;)<br>  bucket       = &quot;localstack-website-bucket&quot;<br>  key          = basename(each.value)<br>  source       = each.value<br>  etag         = filemd5(&quot;${each.value}&quot;)<br>  content_type = &quot;text/html&quot;<br>  acl          = &quot;public-read&quot;<br>}<br><br>resource &quot;aws_s3_bucket_policy&quot; &quot;s3_bucket&quot; {<br>  bucket = aws_s3_bucket.s3_bucket.id<br>  policy = jsonencode({<br>    Version = &quot;2012-10-17&quot;<br>    Statement = [<br>      {<br>        Sid       = &quot;PublicReadGetObject&quot;<br>        Effect    = &quot;Allow&quot;<br>        Principal = &quot;*&quot;<br>        Action    = &quot;s3:GetObject&quot;<br>        Resource = [<br>          aws_s3_bucket.s3_bucket.arn,<br>          &quot;${aws_s3_bucket.s3_bucket.arn}/*&quot;,<br>        ]<br>      },<br>    ]<br>  })<br>}</pre><p>outputs.tf</p><pre>output &quot;website_endpoint&quot; {<br>  value = &quot;https://${aws_s3_bucket.s3_bucket.id}.s3-website.localhost.localstack.cloud:4566&quot;<br>}</pre><p>index.html</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;LocalStack Tutorial&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;main class=&quot;container&quot;&gt;<br>        &lt;h1&gt;🚀 LocalStack Tutorial&lt;/h1&gt;<br>        &lt;p&gt;Run AWS services locally for development and testing.&lt;/p&gt;<br>        &lt;div class=&quot;grid&quot;&gt;<br>            &lt;article&gt;<br>                &lt;h3&gt;🔧 Local Development&lt;/h3&gt;<br>                &lt;p&gt;Run S3, Lambda, DynamoDB locally&lt;/p&gt;<br>            &lt;/article&gt;<br>            &lt;article&gt;<br>                &lt;h3&gt;💰 Cost-Free&lt;/h3&gt;<br>                &lt;p&gt;Test without AWS charges&lt;/p&gt;<br>            &lt;/article&gt;<br>            &lt;article&gt;<br>                &lt;h3&gt;⚡ Fast Testing&lt;/h3&gt;<br>                &lt;p&gt;Rapid development cycles&lt;/p&gt;<br>            &lt;/article&gt;<br>        &lt;/div&gt;<br>        &lt;p&gt;✅ This page is served from LocalStack S3!&lt;/p&gt;<br>    &lt;/main&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>404.html</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;404 - Page Not Found&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;main class=&quot;container&quot; style=&quot;text-align: center;&quot;&gt;<br>        &lt;h1&gt;404&lt;/h1&gt;<br>        &lt;h2&gt;Oops! Page went on vacation 🏖️&lt;/h2&gt;<br>        &lt;p&gt;This page packed its bags and left for a tropical island.&lt;/p&gt;<br>        &lt;p&gt;We&#39;ve sent a search party, but they got distracted by piña coladas.&lt;/p&gt;<br>        &lt;a href=&quot;/&quot; role=&quot;button&quot;&gt;Take me home 🏠&lt;/a&gt;<br>    &lt;/main&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>Terraform Apply</h3><p>When we created files we can run tflocal init to download aws dependencies and tflocal apply to see our Terraform plan. After we type yes it will apply our changes to LocalStack.</p><pre>#tflocal init<br><br>Initializing the backend...<br>Initializing provider plugins...<br>- Finding latest version of hashicorp/aws...<br>- Installing hashicorp/aws v6.26.0...<br>- Installed hashicorp/aws v6.26.0 (signed by HashiCorp)<br>Terraform has created a lock file .terraform.lock.hcl to record the provider<br>selections it made above. Include this file in your version control repository<br>so that Terraform can guarantee to make the same selections by default when<br>you run &quot;terraform init&quot; in the future.<br><br>#################<br># tflocal apply #<br>#################<br>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:<br>  + create<br><br>Terraform will perform the following actions:<br><br>  # aws_s3_bucket.s3_bucket will be created<br>  + resource &quot;aws_s3_bucket&quot; &quot;s3_bucket&quot; {<br>      + acceleration_status         = (known after apply)<br>      + acl                         = (known after apply)<br>      + arn                         = (known after apply)<br>      + bucket                      = &quot;localstack-website-bucket&quot;<br>      + bucket_domain_name          = (known after apply)<br>      + bucket_prefix               = (known after apply)<br>      + bucket_region               = (known after apply)<br>      + bucket_regional_domain_name = (known after apply)<br>      + force_destroy               = false<br>      + hosted_zone_id              = (known after apply)<br>      + id                          = (known after apply)<br>      + object_lock_enabled         = (known after apply)<br>      + policy                      = (known after apply)<br>      + region                      = &quot;us-east-1&quot;<br>      + request_payer               = (known after apply)<br>      + tags                        = {<br>          + &quot;Environment&quot; = &quot;Localstack&quot;<br>          + &quot;Project&quot;     = &quot;Website Hosting&quot;<br>        }<br>      + tags_all                    = {<br>          + &quot;Environment&quot; = &quot;Localstack&quot;<br>          + &quot;Project&quot;     = &quot;Website Hosting&quot;<br>        }<br>      + website_domain              = (known after apply)<br>      + website_endpoint            = (known after apply)<br><br>      + cors_rule (known after apply)<br><br>      + grant (known after apply)<br><br>      + lifecycle_rule (known after apply)<br><br>      + logging (known after apply)<br><br>      + object_lock_configuration (known after apply)<br><br>      + replication_configuration (known after apply)<br><br>      + server_side_encryption_configuration (known after apply)<br><br>      + versioning (known after apply)<br><br>      + website (known after apply)<br>    }<br><br>  # aws_s3_bucket_acl.s3_bucket will be created<br>  + resource &quot;aws_s3_bucket_acl&quot; &quot;s3_bucket&quot; {<br>      + acl    = &quot;public-read&quot;<br>      + bucket = (known after apply)<br>      + id     = (known after apply)<br>      + region = &quot;us-east-1&quot;<br><br>      + access_control_policy (known after apply)<br>    }<br><br>  # aws_s3_bucket_policy.s3_bucket will be created<br>  + resource &quot;aws_s3_bucket_policy&quot; &quot;s3_bucket&quot; {<br>      + bucket = (known after apply)<br>      + id     = (known after apply)<br>      + policy = (known after apply)<br>      + region = &quot;us-east-1&quot;<br>    }<br><br>  # aws_s3_bucket_website_configuration.s3_bucket will be created<br>  + resource &quot;aws_s3_bucket_website_configuration&quot; &quot;s3_bucket&quot; {<br>      + bucket           = (known after apply)<br>      + id               = (known after apply)<br>      + region           = &quot;us-east-1&quot;<br>      + routing_rules    = (known after apply)<br>      + website_domain   = (known after apply)<br>      + website_endpoint = (known after apply)<br><br>      + error_document {<br>          + key = &quot;404.html&quot;<br>        }<br><br>      + index_document {<br>          + suffix = &quot;index.html&quot;<br>        }<br><br>      + routing_rule (known after apply)<br>    }<br><br>Plan: 4 to add, 0 to change, 0 to destroy.<br><br>Changes to Outputs:<br>  + website_endpoint = (known after apply)<br><br>Do you want to perform these actions?<br>  Terraform will perform the actions described above.<br>  Only &#39;yes&#39; will be accepted to approve.<br><br>  Enter a value: yes<br><br>aws_s3_bucket.s3_bucket: Creating...<br>aws_s3_bucket.s3_bucket: Creation complete after 1s [id=localstack-website-bucket]<br>aws_s3_bucket_policy.s3_bucket: Creating...<br>aws_s3_bucket_acl.s3_bucket: Creating...<br>aws_s3_bucket_website_configuration.s3_bucket: Creating...<br>aws_s3_bucket_acl.s3_bucket: Creation complete after 0s [id=localstack-website-bucket,public-read]<br>aws_s3_bucket_policy.s3_bucket: Creation complete after 0s [id=localstack-website-bucket]<br>aws_s3_bucket_website_configuration.s3_bucket: Creation complete after 0s [id=localstack-website-bucket]<br><br>Apply complete! Resources: 4 added, 0 changed, 0 destroyed.<br><br>Outputs:<br><br>website_endpoint = &quot;https://localstack-website-bucket.s3-website.localhost.localstack.cloud:4566&quot;<br></pre><p>After bucket created, we can run aws s3 sync ./website-contents/ s3://localstack-website-bucket to move our index.html and 404.html to S3 bucket.</p><p>And finally we can navigate <a href="https://localstack-website-bucket.s3-website.localhost.localstack.cloud:4566/">https://localstack-website-bucket.s3-website.localhost.localstack.cloud:4566</a> to see our website, served via S3 on LocalStack successfully.</p><h4>Pulumi</h4><p>Alternatively, you can achieve same flow with this Pulumi Code:</p><pre>import * as pulumi from &quot;@pulumi/pulumi&quot;;<br>const aws = require(&quot;@pulumi/aws&quot;);<br><br>export = async () =&gt; {<br>    // Name of the s3 bucket. Must be unique.;<br>    const s3Bucket = new aws.s3.Bucket(&quot;s3_bucket&quot;, {<br>        bucket: &quot;my-localstack-website-bucket-pulumi&quot;,<br>    });<br>    const s3BucketBucketWebsiteConfiguration = new aws.s3.BucketWebsiteConfiguration(&quot;s3_bucket&quot;, {<br>        bucket: s3Bucket.id,<br>        indexDocument: {<br>            suffix: &quot;index.html&quot;,<br>        },<br>        errorDocument: {<br>            key: &quot;404.html&quot;,<br>        },<br>    });<br>    const s3BucketBucketAcl = new aws.s3.BucketAcl(&quot;s3_bucket&quot;, {<br>        bucket: s3Bucket.id,<br>        acl: &quot;public-read&quot;,<br>    });<br>    const s3BucketBucketPolicy = new aws.s3.BucketPolicy(&quot;s3_bucket&quot;, {<br>        bucket: s3Bucket.id,<br>        policy: pulumi.jsonStringify({<br>            Version: &quot;2012-10-17&quot;,<br>            Statement: [{<br>                Sid: &quot;PublicReadGetObject&quot;,<br>                Effect: &quot;Allow&quot;,<br>                Principal: &quot;*&quot;,<br>                Action: &quot;s3:GetObject&quot;,<br>                Resource: [<br>                    s3Bucket.arn,<br>                    pulumi.interpolate`${s3Bucket.arn}/*`,<br>                ],<br>            }],<br>        }),<br>    });<br>    return {<br>        bucketArn: s3Bucket.arn,<br>        bucketName: s3Bucket.id,<br>        domain: &quot;s3-website.localhost.localstack.cloud:4566&quot;,<br>        websiteEndpoint: pulumi.interpolate`https://${s3Bucket.id}.s3-website.localhost.localstack.cloud:4566`,<br>    };<br>}</pre><h3>Final Throughs</h3><p>LocalStack stands out as a platform for any team building/practising on AWS. Primary value is an ability to emulate a wide array of AWS services locally. (<a href="https://docs.localstack.cloud/aws/services/"><em>Full List</em></a>)</p><ul><li><strong>Cost Savings:</strong> Develop and test for hours <em>without a single transaction on your actual AWS bill.</em></li><li><strong>IaC Confidence:</strong> Validate your Terraform, CDK, or CloudFormation templates locally before deployment, significantly reducing the risk of errors in a real AWS environment.</li><li><strong>Advanced Testing:</strong> Utilize its powerful features to perform complex scenarios, such as <strong>Chaos Engineering</strong>, testing your application’s resilience by simulating service outages or network failures.</li></ul><p>In short, LocalStack provides the speed and control of local development with the realism of the actual AWS environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=340af8aa8c28" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/localstack-aws-340af8aa8c28">AWS Playground: LocalStack</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Platform Engineering with Backstage.io | Goodbye tabs!]]></title>
            <link>https://aws.plainenglish.io/platform-engineering-with-backstage-io-a500ffdf08b8?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a500ffdf08b8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[backstage]]></category>
            <category><![CDATA[gitops]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 16:36:45 GMT</pubDate>
            <atom:updated>2026-05-31T18:02:39.236Z</atom:updated>
            <content:encoded><![CDATA[<p>Stop asking “Where do I find…?” and start building an Internal Developer Portal (IDP) to decrease the internal pain in every engineering organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FKtSdt9A1qaZKB0F.png" /></figure><h3>What is Backstage.io?</h3><p>It’s an open-source platform created at Spotify and now a graduated project of the<em> Cloud Native Computing Foundation</em> (<em>CNCF</em>). It’s not just another tool; it’s a platform for building the <em>one</em> tool to rule them all (<em>yes, I’m a LOTR fan</em>) your own <strong>Internal Developer Portal (IDP).</strong></p><p>Think of it as a single, centralized frontend application for your entire engineering ecosystem. It’s a <strong>web application</strong>, hosted by you, that unifies all your infrastructure tooling, services, metrics, and documentation into one page.</p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>Why do we need IDP?</h3><p>While developing a microservices application, <strong>it’s hard to track owners</strong>, <strong>documentation</strong>, <strong>metrics</strong>, etc. multiple teams owning multiple things and it creates too much internal chaos during the engineering phase. Even your <strong>well-documented Confluence Pages or Readme files will be forgotten over time.</strong></p><p>The biggest pain is <strong>onboarding a new employee</strong>. They will have a lot of questions like;</p><p><em>Which repository holds this service?<br>Who owns this API?<br>Where is the documentation for the checkout service?<br>What’s the process for provisioning a new database?<br>Which dashboard shows the production metrics for my team?<br>Where is the link to our staging environment?</em></p><p>And also there will be access/permissions issues for the applications (<em>Confluence for docs, Grafana for metrics, etc..)</em></p><p><strong>With Backstage</strong>, you can collect every necessary information on one page, with drawers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tms7VlZIFNocubLr56vemQ.png" /><figcaption>Example app Screenshot</figcaption></figure><h3>Is Backstage Right for You?</h3><blockquote><em>Backstage is a powerful solution, but it is not a “</em>set it and forget it<em>” tool. </em><strong><em>It is an investment for long-term.</em></strong></blockquote><p><strong>Backstage is likely a great fit if:</strong></p><ul><li>You’re a mid scale engineering organization (<em>~30 developers</em>)</li><li>Developers complain about <em>Where / What / Who </em>kinda questions.</li><li>Onboarding new developers is a time consuming, painful process.</li><li>You are managing / developing a complex microservices architecture.</li><li>You have a platform team that can own and customize the portal.</li></ul><p><strong>Backstage might be overkill if:</strong></p><ul><li>You are a small startup with a single team and a handful of services.</li><li>You have no dedicated resources to maintain an internal platform.</li><li>You don’t have complex architecture</li></ul><p>It’s a long term commitment for b<strong>ig enterprises to simplify the development process</strong>. It will be overkill and time consuming service for small companies. It has own challenges.</p><h3><strong>How to install Backstage ?</strong></h3><p>For installation, there are many ways to install it. Since it’s just an example doc we will follow the simplest one.</p><p>You can simultaneously follow this link: <a href="https://backstage.io/docs/getting-started">Installing Backstage</a></p><p>After you complete the prerequisites on the link, you can run that command on your terminal</p><pre>npx @backstage/create-app@latest</pre><p>It will create and install the necessary components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LDKuh50cTdJUwYE_d5RlFg.png" /></figure><p>After the command completed, navigate the directory (medium-backstage for me) and run yarn start</p><p>It will start the Backstage with default configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8J0fKAJOkrBIi1zxnztFwQ.png" /></figure><h3>Customize Backstage with Plugins</h3><blockquote>Backstage is just an empty canvas. We need to customize it</blockquote><p>With plugins we can expand the power of Backstage. What I’m using and personally recommending plugins are:</p><h4>ArgoCD Plugin</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jNeQOBm5Pd82mM05jjEw8g.png" /><figcaption>ArgoCD Screenshot from roadie.io</figcaption></figure><p>With this plugin I can track my deployment status without leaving the Backstage page and jump the ArgoCD UI with simple click if needed.</p><p><strong>Plugin Link:</strong> <a href="https://roadie.io/backstage/plugins/argo-cd/">https://roadie.io/backstage/plugins/argo-cd</a></p><h4>Prometheus Plugin</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A59NIRs8DcbHn9pO5lBU1Q.png" /><figcaption>Prometheus Screenshot from roadie.io</figcaption></figure><p>See the critical metrics or alerts on the same page, without navigating the Grafana or Prometheus. It’s really useful for quick lookups.</p><p><strong>Plugin Link:</strong> <a href="https://roadie.io/backstage/plugins/prometheus/">https://roadie.io/backstage/plugins/prometheus/</a></p><h3>What is next?</h3><p>With this article we learned the IDP solutions via Backstage and install the Backstage. In next articles I will guide:</p><ul><li>How to configure it for Kubernetes resources</li><li>How to deploy an app from Backstage to Kubernetes</li><li>GitHub Authentication</li><li>Integrate with ArgoCD and Prometheus for GitOps &amp; Monitoring</li><li>Documentation, Service Flow, etc.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a500ffdf08b8" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/platform-engineering-with-backstage-io-a500ffdf08b8">Platform Engineering with Backstage.io | Goodbye tabs!</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart Home DIY: Remote Control Your Air Conditioner with ESP32 (Part 2)]]></title>
            <link>https://bulutbatuhan.medium.com/smart-home-diy-control-air-conditioner-esp32-part-2-3349b9240c3a?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3349b9240c3a</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 18:33:40 GMT</pubDate>
            <atom:updated>2026-05-31T18:03:54.301Z</atom:updated>
            <content:encoded><![CDATA[<p>In our first article, we learned <strong>how to decode IR signals with ESP32</strong>. If you haven’t read it yet, check it out here:</p><p><a href="https://bulutbatuhan.medium.com/smart-home-diy-control-air-conditioner-esp32-dcf545d6a6d4">Smart Home DIY: Remote Control Your Air Conditioner with ESP32 (Part 1)</a></p><blockquote>Now it’s time for the send the IR Commands to the A/C.</blockquote><blockquote>We pretty much same config and libraries we needed at Part 1:</blockquote><h4>Requirements</h4><ul><li>ESP32</li><li>IR Transmitter</li><li>2N2222 Transistor (<em>or any similar NPN Transistor</em>)</li><li>Breadboard</li><li>Jumper Wires</li></ul><h3><strong>Before We Begin</strong></h3><p>It’s important to know which protocol your air conditioner uses. This will ensure that your ESP32 communicates correctly with your A/C unit.</p><p>If you’re unsure about the protocol, check out <a href="#"><strong>Part 1 of this series</strong></a> where we decoded IR signals with ESP32.</p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><p>Since we now know which protocol our A/C uses, we can easily program the ESP32 using the <a href="https://github.com/crankyoldgit/IRremoteESP8266/tree/master"><strong>IRremoteESP8266</strong></a> library.</p><blockquote>In this article, I’ll be using the <a href="https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h"><strong>Coolix</strong></a> protocol as an example, but you can continue with your own protocol throughout the rest of the tutorial.</blockquote><p>Simply swap out these sections in the code with the protocol your A/C uses.</p><blockquote><a href="https://github.com/crankyoldgit/IRremoteESP8266/tree/master/src">Supported Protocols</a></blockquote><pre>#include &lt;ir_Coolix.h&gt;<br><br>//<br><br>IRCoolixAC ac(kIrLed);</pre><p>You can check which commands your protocol supports by looking at the class functions.</p><blockquote><a href="https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Coolix.h#L121">For the Coolix protocol, click here.</a></blockquote><h3>Implementing the Commands in ESP32</h3><p>First, let’s program our <strong>ESP32</strong> with the software. We’ll write code to perform the following actions:</p><ul><li><strong>Turn on the air conditioner</strong></li><li><strong>Change the swing</strong> (<em>enable or disable</em>)</li><li><strong>Set the cooling mode</strong></li><li><strong>Turn off the air conditioner</strong></li></ul><p>Additionally, the <strong>blue LED will blink every 5 seconds</strong> each time a command is sent, and a <strong>Serial output</strong> will display the output with timestamps.</p><pre>#include &lt;Arduino.h&gt;<br>#include &lt;IRremoteESP8266.h&gt;<br>#include &lt;IRsend.h&gt;<br>#include &lt;ir_Coolix.h&gt;<br><br>const uint16_t kIrLed = 4; // Make sure this is the Data pin of Transmitter.<br>IRCoolixAC ac(kIrLed);<br>#define builtInPin 2 // Set the Blue LED Pin<br><br><br>void setup() {<br>  ac.begin(); // Begin the A/C operations<br>  Serial.begin(115200); // Preapare Serial Output<br>  pinMode(builtInPin, OUTPUT); // Set the Blue Led pin as output<br>  delay(200);<br>}<br><br>void loop() {<br>  Serial.print(getUptime()); // Get the current Time and print to the terminal.<br>  Serial.println(&quot; - Opening the Air Conditioner.&quot;); <br>  ac.on(); // Open the Air Conditioner.<br>  ac.send(); // We need to add this step after every command for actually &#39;send&#39; the signal to A/C.<br>  blink();<br>  delay(5000); // Wait 5 seconds.<br><br>  Serial.print(getUptime()); // Get the current Time and print to the terminal.<br>  Serial.println(&quot; - Changing the Swing State.&quot;); <br>  ac.setSwing(); // Enable / Disable the Swing Option<br>  ac.send();<br>  blink();<br>  delay(5000);<br><br>  Serial.print(getUptime());<br>  Serial.println(&quot; - Setting A/C to Cooling mode.&quot;);<br>  ac.setMode(kCoolixCool); // Set A/C to cooling mode.<br>  ac.send();<br>  blink();<br>  delay(5000);<br><br>  Serial.print(getUptime());<br>  Serial.println(&quot; - Close the Air Conditioner.&quot;); // Close the Air Conditioner.<br>  ac.off();<br>  ac.send();<br>  blink();<br>  delay(5000);<br>}<br><br><br>// Returns the ESP32&#39;s uptime (time since boot) as a formatted string.<br>// Format: &quot;HH:MM:SS&quot;<br>// - Uses millis() to calculate elapsed time since reset.<br>// - Example output: &quot;00:05:23&quot; (for 5 minutes 23 seconds uptime).  <br>String getUptime() {<br>  unsigned long seconds = millis() / 1000;<br>  unsigned long minutes = seconds / 60;<br>  unsigned long hours   = minutes / 60;<br><br>  char buffer[16];<br>  snprintf(buffer, sizeof(buffer), &quot;%02lu:%02lu:%02lu&quot;,<br>           hours, minutes % 60, seconds % 60);<br><br>  return String(buffer);<br>}<br><br>// Just a blink function<br>void blink() {<br>  delay(200);<br>  digitalWrite(builtInPin, HIGH);<br>  delay(200);<br>  digitalWrite(builtInPin, LOW);<br>}</pre><blockquote>Once you upload this code to your IDE, you should observe the following <strong>output</strong>.</blockquote><pre>Sketch uses 293901 bytes (22%) of program storage space. Maximum is 1310720 bytes.<br>Global variables use 21376 bytes (6%) of dynamic memory, leaving 306304 bytes for local variables. Maximum is 327680 bytes.<br>esptool.py v4.5.1<br>Serial port /dev/cu.usbserial-0001<br>Connecting....<br>Chip is ESP32-D0WD-V3 (revision v3.1)<br>Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None<br>Crystal is 40MHz<br>MAC: 6c:c8:40:88:d0:54<br>Uploading stub...<br>Running stub...<br>Stub running...<br>Changing baud rate to 921600<br>Changed.<br>Configuring flash size...<br>Flash will be erased from 0x00001000 to 0x00005fff...<br>Flash will be erased from 0x00008000 to 0x00008fff...<br>Flash will be erased from 0x0000e000 to 0x0000ffff...<br>Flash will be erased from 0x00010000 to 0x00057fff...<br>Compressed 18992 bytes to 13112...<br>Writing at 0x00001000... (100 %)<br>Wrote 18992 bytes (13112 compressed) at 0x00001000 in 0.5 seconds (effective 327.5 kbit/s)...<br>Hash of data verified.<br>Compressed 3072 bytes to 146...<br>Writing at 0x00008000... (100 %)<br>Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 279.4 kbit/s)...<br>Hash of data verified.<br>Compressed 8192 bytes to 47...<br>Writing at 0x0000e000... (100 %)<br>Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 449.1 kbit/s)...<br>Hash of data verified.<br>Compressed 294272 bytes to 149775...<br>Writing at 0x00010000... (10 %)<br>Writing at 0x0001d398... (20 %)<br>Writing at 0x0002ba6e... (30 %)<br>Writing at 0x0003113a... (40 %)<br>Writing at 0x00036824... (50 %)<br>Writing at 0x0003bd2d... (60 %)<br>Writing at 0x0004105a... (70 %)<br>Writing at 0x00047afa... (80 %)<br>Writing at 0x0005190f... (90 %)<br>Writing at 0x00057001... (100 %)<br>Wrote 294272 bytes (149775 compressed) at 0x00010000 in 2.6 seconds (effective 888.7 kbit/s)...<br>Hash of data verified.<br><br>Leaving...<br>Hard resetting via RTS pin...</pre><blockquote>And you will observe the following logs on <strong>Serial Monitor</strong>.</blockquote><pre>00:00:00 - Opening the Air Conditioner.<br>00:00:05 - Changing the Swing State.<br>00:00:11 - Setting A/C to Cooling mode.<br>00:00:17 - Close the Air Conditioner.</pre><p>Since the code part is ready, let’s implement the circuit diagram</p><h3>Circuit Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTHovNWFcejYblWbrYROcA.png" /><figcaption>Circuit Diagram for IR Transmitter</figcaption></figure><blockquote>Note: The module in the diagram has a limited range. Feel free to swap it with an IR transmitter that fits your needs.</blockquote><p>After everything (<em>Code and the Diagram</em>) is ready, we can <strong>test the functionality with the A/C.</strong></p><p>Place the ESP32 near your A/C and verify that it responds correctly to each command:<em> turning on, adjusting the swing, changing the mode, and turning off.</em></p><h3>Control Your A/C on the Local Network with Phone</h3><p>With the ESP32 A/C controller functioning correctly, the next step is to make it <strong>available on your local network.</strong></p><p>When it’s done, <strong>you’ll be able to control your air conditioner from your phone, tablet, computer, or any device on the network.</strong></p><p>To do that we will require one last programming.</p><p>We need to download this repository to our local: <a href="https://github.com/crankyoldgit/IRremoteESP8266/archive/refs/heads/master.zip">IRremoteESP8266</a></p><p>After that navigate the “/examples/Web-AC-Control/Web-AC-control.ino” file.</p><p><strong>Edit the Fields </strong>under the “User configuration space for AC library classes” with your protocol. <strong>Lastly</strong>, edit the ac library and kIrLed with your configuration. (<em>If you build shown in the schema, set as 14</em>)</p><h4>ESP32 Filesystem Uploader plugin</h4><blockquote>To upload, you need the Arduino version <strong>1.8.19, Arduino 2.x not supporting the ESP32 Filesystem Uploader plugin</strong></blockquote><p><strong>Download</strong> the Arduino Plugin from the link <a href="https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/">https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/</a></p><p>And Unpack here:</p><p>C:/Users/&lt;YOUR_USER&gt;/Documents/Arduino/tools/ESP32FS/tool/esp32fs.jar</p><blockquote>For MacOs the path is: ~/Documents/Arduino/tools/ESP32FS/tool/esp32fs.jar</blockquote><p>When you relaunch your IDE, you will see the option for <em>ESP32 Sketch Data Upload </em>under<em> </em><strong>Tools.</strong></p><p>Open the previous file /examples/Web-AC-Control/Web-AC-control.ino and click <em>Tools &gt; ESP32 Sketch Data Upload</em></p><p>After it’s completed also upload your code as usual <em>Upload</em> button.</p><p>When it’s completed you will see a new Wi-Fi network with AC Remote Control . Connect to thay Wi-Fi and open to your browser. You will see the Controls for your remote</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ouDpnhhqkZvT_7_X.png" /><figcaption>Control Panel for your Air Conditioner</figcaption></figure><h3>Connect to our Local Network</h3><p>To make this control panel available in our Local network we need to swap this part on Web-AC-control.ino:</p><pre>  WiFiManager wifiManager;<br><br><br>  if (!wifiManager.autoConnect(deviceName)) {<br>    delay(3000);<br>    ESP.restart();<br>    delay(5000);<br>  }</pre><p>With this:</p><pre>const char* ssid     = &quot;YOUR_WIFI_SSID&quot;;<br>const char* password = &quot;YOUR_WIFI_PASSWORD&quot;;<br><br>WiFi.begin(ssid, password);  // Connect to Wi-Fi<br><br>// Wait until connected<br>while (WiFi.status() != WL_CONNECTED) {<br>  delay(500);<br>  Serial.print(&quot;.&quot;);<br>}<br><br>Serial.println();<br>Serial.println(&quot;Connected to Wi-Fi!&quot;);<br>Serial.print(&quot;ESP32 IP Address: &quot;);<br>Serial.println(WiFi.localIP());  // Print ESP32 IP address</pre><blockquote>Edit the <em>YOUR_WIFI_SSID</em> and <em>YOUR_WIFI_PASSWORD</em> with your credentials</blockquote><p>Now that everything is set up, simply connect your ESP32 to the local network and enjoy <strong>controlling your A/C from your phone, tablet, or computer!</strong></p><h3><strong>Coming Up Next</strong></h3><p>In the next part, we’ll set up a <strong>Home Assistant server</strong>, connect a <strong>humidity and temperature sensor</strong> to our ESP32, and integrate it with Home Assistant using <strong>ESPHome</strong>. Don’t miss it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3349b9240c3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart Home DIY: Remote Control Your Air Conditioner with ESP32 (Part 1)]]></title>
            <link>https://bulutbatuhan.medium.com/smart-home-diy-control-air-conditioner-esp32-dcf545d6a6d4?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcf545d6a6d4</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 18:28:26 GMT</pubDate>
            <atom:updated>2026-05-31T18:03:58.140Z</atom:updated>
            <content:encoded><![CDATA[<p>Smart Home automations and <strong>IoT</strong> (<em>Internet of Things</em>) is rising up rapidly nowadays. Most modern home furniture supports IoT through their software or applications.</p><p>But what about the older, “<em>dumb</em>” devices in our homes? Can we control them via the Internet? Is there a way to bring them <strong>online</strong>?</p><blockquote><strong>The answer is Yes. We can make them smart.</strong></blockquote><p>In this article you will learn how to control your A/C (<em>air conditioner</em>) remotely.</p><p><strong>Here’s what we’ll cover:</strong></p><ul><li>Build a device to receive and decode our A/C’s remote.</li><li>Reprogram our ESP32 to transmit messages to the A/C.</li><li>Make the controls accessible on the local network.</li></ul><h3>Requirements</h3><p>To build this project, you will need the following hardware:</p><ul><li>ESP32</li><li>IR Receiver</li><li>IR Transmitter</li><li>2N2222 Transistor (<em>or any similar NPN Transistor</em>)</li><li>Breadboard</li><li>Jumper Wires</li></ul><p>You can <strong>easily find them</strong> online or at any electronics store that <strong>sells DIY components.</strong></p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>What is ESP32 and How Can We Use ESP32 Wi-Fi?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*GPhXFnhbmvL0P1PUQTrhxg.png" /><figcaption>ESP32 Development Board with Type-C</figcaption></figure><p>ESP32 is a microcontroller that integrate both Wi-Fi and Bluetooth capabilities. <strong>We will use ESP32 to control our A/C.</strong></p><h4>How can I program it ?</h4><p>You can use Arduino IDE to program your ESP32. Follow these steps:</p><p><strong>Download and install the Arduino IDE</strong> from the <a href="#">official website</a>. (<em>We’ll refer to it as </em><strong><em>IDE</em></strong><em> throughout this article.)</em></p><p>After installing, open the IDE and navigate to <strong>Tools → Board → Board Manager</strong>. <em>(or select from the left menu)</em></p><p>In the search bar, type <strong>ESP32</strong> and install <strong>“esp32 by Espressif Systems, version 2.0.11.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TDm_JOeZ9YjDpE4yKhgrlg.png" /><figcaption>Arduino IDE</figcaption></figure><p>After installing the IDE, <strong>connect your ESP32 to your computer</strong>. You should see a <strong>red LED turn on</strong>.</p><blockquote>Is this thing on?</blockquote><p>Let’s proceed to test the connectivity of the <strong>ESP32</strong> by uploading and running a simple Blink program, which will allow us to verify that the board is properly connected to our computer and that the <strong>IDE</strong> is correctly set up to communicate with the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_p9n-PwTVP84TOTJ-aisQ.png" /></figure><p>To proceed with uploading the program, you first need to <strong>select the correct port that your ESP32 is connected</strong> to, and then choose the appropriate board model from the “<em>Select Board</em>” menu in the IDE.</p><blockquote>I chose ESP32 Dev Module because I have that board, please choose correct board with the correct board.</blockquote><p>After that select <em>File &gt; Examples &gt; Basics &gt; Blink</em> and add this line inside the void setup() part.</p><pre>  #define LED_BUILTIN 2</pre><p><strong>Here it’s the source code</strong> if you cannot find it. Just copy and paste to your IDE.</p><pre>void setup() {<br>  #define LED_BUILTIN 2<br>  pinMode(LED_BUILTIN, OUTPUT);<br>}<br><br>void loop() {<br>  digitalWrite(LED_BUILTIN, HIGH);<br>  delay(500);<br>  digitalWrite(LED_BUILTIN, LOW);<br>  delay(500);<br>}</pre><p>After that we should observe the Blue LED will <strong>blink on ESP32 every second.</strong></p><p>Click <strong>Upload</strong> to upload the file to your <strong>ESP32</strong>.</p><p>You should this output on your IDE:</p><pre>Sketch uses 236825 bytes (18%) of program storage space. Maximum is 1310720 bytes.<br>Global variables use 21048 bytes (6%) of dynamic memory, leaving 306632 bytes for local variables. Maximum is 327680 bytes.<br>esptool.py v4.5.1<br>Serial port /dev/cu.usbserial-0001<br>Connecting....<br>Chip is ESP32-D0WD-V3 (revision v3.1)<br>Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None<br>Crystal is 40MHz<br>MAC:<br>Uploading stub...<br>Running stub...<br>Stub running...<br>Changing baud rate to 921600<br>Changed.<br>Configuring flash size...<br>Flash will be erased from 0x00001000 to 0x00005fff...<br>Flash will be erased from 0x00008000 to 0x00008fff...<br>Flash will be erased from 0x0000e000 to 0x0000ffff...<br>Flash will be erased from 0x00010000 to 0x00049fff...<br>Compressed 18992 bytes to 13112...<br>Writing at 0x00001000... (100 %)<br>Wrote 18992 bytes (13112 compressed) at 0x00001000 in 0.5 seconds (effective 327.3 kbit/s)...<br>Hash of data verified.<br>Compressed 3072 bytes to 146...<br>Writing at 0x00008000... (100 %)<br>Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 273.3 kbit/s)...<br>Hash of data verified.<br>Compressed 8192 bytes to 47...<br>Writing at 0x0000e000... (100 %)<br>Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 461.7 kbit/s)...<br>Hash of data verified.<br>Compressed 237184 bytes to 130404...<br>Writing at 0x00010000... (12 %)<br>Writing at 0x0001d26c... (25 %)<br>Writing at 0x0002439d... (37 %)<br>Writing at 0x000295a4... (50 %)<br>Writing at 0x0002ebcc... (62 %)<br>Writing at 0x00037131... (75 %)<br>Writing at 0x0003f1a5... (87 %)<br>Writing at 0x0004482c... (100 %)<br>Wrote 237184 bytes (130404 compressed) at 0x00010000 in 2.2 seconds (effective 857.8 kbit/s)...<br>Hash of data verified.<br><br>Leaving...<br>Hard resetting via RTS pin...</pre><p>Since we confirmed ESP32 is working, we can move forward with next steps.</p><h4>Read the A/C Remote with ESP32</h4><p>First we should read our A/C Remote to find the protocol.</p><p>I will use this library for that <a href="https://github.com/crankyoldgit/IRremoteESP8266"><em>IRremoteESP8266</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*Y4P5tPmTzSOi5i0e8cMbzg.png" /></figure><p>To install this, You can search <a href="https://github.com/crankyoldgit/IRremoteESP8266"><em>IRremoteESP8266</em></a> on <strong>Library Manager</strong> and Click Install.</p><p>After you installed the library copy <a href="https://raw.githubusercontent.com/crankyoldgit/IRremoteESP8266/refs/heads/master/examples/IRrecvDumpV2/IRrecvDumpV2.ino"><em>IRrecvDumpV2</em></a> content and paste it to your IDE. <strong>And Upload to your ESP32.</strong></p><p>After Upload, build this circuit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mr91LdAnedxb1K_GV0zW2Q.png" /><figcaption>Circuit Diagram for IRrecvDumpV2</figcaption></figure><p>After upload complete, Open the Serial Monitor (Right corner of your IDE) and set baud rate as 115200 baud</p><p>When you point your Remote to your IR Receiver, you will see some messages in your Terminal. For example this is my terminal output.</p><pre>Timestamp : 000027.169<br>Library   : v2.8.6<br><br>Protocol  : COOLIX<br>Code      : 0xB29F50 (24 Bits)<br>Mesg Desc.: Power: On, Mode: 0 (Cool), Fan: 4 (Min), Temp: 23C, Zone Follow: Off, Sensor Temp: Off<br>uint16_t rawData[199] = {4334, 4494,  476, 1684,  472, 600,  474, 1682,  476, 1680,  478, 600,  474, 602,  478, 1680,  478, 600,  476, 600,  476, 1682,  478, 598,  476, 602,  474, 1682,  478, 1678,  476, 598,  476, 1684,  474, 1680,  476, 600,  476, 602,  476, 1680,  478, 1678,  476, 1680,  474, 1678,  478, 1680,  476, 600,  476, 1682,  476, 1680,  476, 600,  476, 600,  476, 600,  476, 602,  476, 602,  474, 604,  474, 1680,  478, 598,  476, 1684,  474, 598,  478, 600,  476, 600,  476, 600,  476, 1684,  476, 598,  476, 1682,  478, 600,  476, 1678,  478, 1678,  476, 1682,  474, 1680,  476, 5282,  4340, 4494,  476, 1678,  478, 596,  480, 1676,  480, 1678,  476, 598,  478, 598,  480, 1678,  478, 598,  478, 600,  476, 1678,  478, 600,  476, 604,  476, 1676,  476, 1680,  476, 600,  478, 1704,  450, 1680,  476, 600,  476, 600,  478, 1680,  476, 1680,  476, 1678,  476, 1678,  478, 1680,  476, 598,  480, 1680,  474, 1680,  474, 600,  480, 598,  478, 600,  480, 598,  480, 598,  478, 598,  478, 1678,  478, 598,  478, 1678,  476, 598,  480, 600,  476, 600,  480, 600,  476, 1678,  478, 596,  480, 1678,  478, 598,  482, 1676,  478, 1678,  480, 1676,  478, 1678,  476};  // COOLIX B29F50<br>uint64_t data = 0xB29F50;<br><br><br>Timestamp : 000030.985<br>Library   : v2.8.6<br><br>Protocol  : COOLIX<br>Code      : 0xB27BE0 (24 Bits)<br>Mesg Desc.: Power: Off<br>uint16_t rawData[199] = {4336, 4522,  452, 1678,  478, 598,  476, 1684,  474, 1680,  472, 600,  476, 604,  474, 1708,  450, 600,  474, 602,  476, 1682,  476, 600,  476, 600,  478, 1682,  476, 1678,  478, 598,  474, 1684,  474, 602,  472, 1682,  478, 1680,  474, 1684,  472, 1680,  478, 598,  476, 1682,  476, 1678,  476, 1680,  476, 600,  474, 602,  474, 602,  476, 604,  476, 1682,  476, 600,  476, 600,  476, 1682,  476, 1678,  476, 1680,  476, 600,  476, 600,  476, 602,  478, 600,  476, 600,  476, 604,  474, 602,  476, 600,  478, 1680,  476, 1680,  476, 1678,  478, 1678,  478, 1678,  476, 5282,  4340, 4494,  478, 1678,  476, 600,  476, 1682,  476, 1680,  476, 600,  476, 600,  476, 1680,  476, 600,  476, 604,  476, 1682,  474, 600,  476, 600,  476, 1680,  476, 1680,  476, 600,  476, 1680,  476, 600,  476, 1678,  478, 1678,  478, 1678,  478, 1676,  476, 600,  478, 1680,  476, 1678,  478, 1678,  476, 600,  480, 598,  478, 600,  476, 600,  478, 1678,  478, 600,  480, 598,  480, 1676,  478, 1678,  480, 1678,  476, 600,  478, 598,  478, 600,  478, 598,  478, 598,  480, 598,  478, 600,  480, 598,  478, 1678,  478, 1678,  476, 1678,  478, 1678,  480, 1678,  476};  // COOLIX B27BE0<br>uint64_t data = 0xB27BE0;</pre><p>In here we can see I’m using the COOLIX Protocol . While building the Transmitter side we will use this information.</p><p>You can follow the guide on Part 2!</p><p><a href="https://bulutbatuhan.medium.com/smart-home-diy-control-air-conditioner-esp32-part-2-3349b9240c3a">Smart Home DIY: Remote Control Your Air Conditioner with ESP32 (Part 2)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcf545d6a6d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Logging with OpenTelemetry + Traces]]></title>
            <link>https://aws.plainenglish.io/kubernetes-logging-with-opentelemetry-traces-840effa3429c?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/840effa3429c</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[traceability]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 14:48:07 GMT</pubDate>
            <atom:updated>2026-05-31T18:03:37.825Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>What gets measured gets managed. — <em>Peter Drucker</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hFxvfqqfNCr0q7Nl5S4Bzw.jpeg" /></figure><p>Imagine you have an online shopping business that starts receiving requests from customers. After a while, customers begin to <strong>complain about the website slowing down.</strong></p><p>Or imagine that in your <strong>distributed application</strong>, certain endpoints start failing unexpectedly, even though you haven’t deployed anything recently.</p><h4>What can you do? How can you observe the system and identify the root cause?</h4><p>In this article, we’ll explore how to answer these questions.</p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>Resources</h3><p>To make things easier to follow, I’ve created an example application that you can deploy and <strong>try out in your own environment.</strong></p><p><em>Application Related:</em></p><ul><li><strong>NGINX-otel, Postgres, Redis, Frontend, Backend</strong></li></ul><p><em>Monitoring Related:</em></p><ul><li><strong>Tempo, Otel Collector, Grafana, Loki, Prometheus</strong></li></ul><blockquote>You can find the source code on GitHub: <a href="https://github.com/batuhan-bulut/distributed-monitoring">https://github.com/batuhan-bulut/distributed-monitoring</a></blockquote><p>I’m suggesting that pull this repository and deploy to your environment (<em>cluster or docker-compose</em>) to follow better.</p><h4>What Does the Application Do?</h4><p>The application is a basic example built with Python’s FastAPI framework.</p><p>Flow in <em>Mermaid Chart</em> is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*ySWX9oxTtbAcEyFj7JO4eA.png" /><figcaption>Mermaid Code for Application Flow</figcaption></figure><p>At the entry point, we have an <strong>NGINX reverse proxy.</strong></p><p>The frontend is responsible only for r<strong>outing requests to the backend</strong>, while the backend handles all the application logic.</p><p>The backend processes incoming requests, <strong>querying the PostgreSQL database, and uses Redis as a caching.</strong></p><p>I’m using Otel Python zero-code for Instrumenting [<a href="https://opentelemetry.io/docs/zero-code/python/">https://opentelemetry.io/docs/zero-code/python</a>]</p><pre>export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=&quot;${OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED:-true}&quot;<br><br>opentelemetry-instrument \<br>    --traces_exporter=&quot;${OTEL_TRACES_EXPORTER:-otlp}&quot; \<br>    --logs_exporter=&quot;${OTEL_LOGS_EXPORTER:-otlp}&quot; \<br>    --metrics_exporter=&quot;${OTEL_METRICS_EXPORTER:-otlp}&quot; \<br>    --service_name=&quot;${OTEL_SERVICE_NAME:-backend}&quot; \<br>    --exporter_otlp_endpoint=&quot;${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4317}&quot; \<br>    uvicorn &quot;${APP_MODULE:-main:app}&quot; --host 0.0.0.0 --port &quot;${PORT:-8000}&quot; &amp;</pre><p>and in the Python code I’m installing the libraries for that</p><pre>#requirements.txt<br>opentelemetry-sdk==1.33.1<br>opentelemetry-exporter-otlp==1.33.1<br>opentelemetry-distro==0.54b1<br>opentelemetry-instrumentation-fastapi==0.54b1<br>opentelemetry-instrumentation-redis==0.54b1<br>opentelemetry-instrumentation-psycopg2==0.54b1<br>opentelemetry-instrumentation-logging==0.54b1<br>opentelemetry-instrumentation-requests==0.54b1<br>opentelemetry-instrumentation-sqlalchemy==0.54b1</pre><p><em>To see this part in GitHub </em><a href="https://github.com/batuhan-bulut/distributed-monitoring/blob/main/applications/Backend/entrypoint.sh#L5"><em>click here</em></a></p><h3>General Flow</h3><h4>Traces</h4><p>When you sending a request to <strong>NGINX</strong> it’s adding the trace-id to request and sending to Otel Collector. For this capability I’m using modified version of NGINX (<em>nginx:1.27.5-otel</em>)</p><pre>#nginx.conf<br>otel_service_name nginx-rp;<br>otel_exporter {<br>  endpoint otel-collector:4317;<br>}</pre><p>And with the auto-instrumentation we can trace the HTTP request under 1 Trace with different span-ids.</p><p>For the <strong>Backend</strong> and <strong>Frontend</strong> we’re using <em>auto-instrumentation.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85fyhQB9b4flsKU5YwDvrg.png" /><figcaption>Different Spans collected under one Trace</figcaption></figure><p>All the Traces collected at Otel-Collector pod/container and sent to Tempo pod.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*E7WMxXdLO3BMOqhGIYk0xw.png" /><figcaption>Diagram of Traces</figcaption></figure><h4>Logs</h4><p>We’re collecting everything at Otel Collector again and sent them to Loki. With that, we can add Trace, Span Id’s to Loglines.</p><h4>Metrics</h4><p>We’re exporting Prometheus endpoint in Otel-Collector and we’re scraping them from Prometheus.</p><pre>#prometheus-config<br>scrape_configs:<br>  - job_name: &#39;otel-collector&#39;<br>    honor_labels: true  <br>    static_configs:<br>      - targets: [&#39;otel-collector:9464&#39;]<br>    scrape_interval: 5s</pre><pre>#otel-config<br>  prometheus:<br>    endpoint: &quot;0.0.0.0:9464&quot;</pre><h3>Examples</h3><p>I created few endpoints for Proof of Concept.</p><p>To access the Grafana Dashboard you can use <a href="http://localhost/grafanae">http://localhost:80/grafana</a> endpoint. Password and User is admin</p><p>I will be using the Grafana Drilldown feature mostly but I also prepare a simple dashboard, you can access the dashboard under Dashboards &gt; Services &gt; App Dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ftEjNpve4U-DxaktIU9Lyw.png" /><figcaption>Drildown &gt; Traces Screenshot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEp80q4Wt1j1QyuLB8HXig.png" /><figcaption>Drildown &gt; Metrics Screenshot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7uvbJnlKtaGtpgyv3_fI2Q.png" /><figcaption>Drildown &gt; Logs Screenshot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FY2TDawZABBtKu9osQLomg.png" /><figcaption>Custom Dashboard</figcaption></figure><h4>Endpoints</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ruQB9YDbunFxBn-arbGEsg.jpeg" /></figure><pre>#Create User<br>curl --location &#39;http://localhost:80/api/v1/users/create&#39; \<br>--header &#39;Content-Type: application/json&#39; \<br>--data &#39;{<br>    &quot;username&quot; : &quot;1234&quot;<br>}&#39;</pre><pre>#Get User<br>curl --location &#39;http://localhost:80/api/v1/users/1234&#39;</pre><pre>#Get All Users<br>curl --location &#39;http://localhost:80/api/v1/users/all&#39;</pre><h4>Let’s create the first the fist user and see the traces.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozxSYJwJrRM501X6T9C5Bw.png" /><figcaption>Traces for Create User</figcaption></figure><p>In here we can observe my first request hits <strong>nginx-rp</strong>.</p><p>After that <strong>Frontend</strong> receives this request and redirect to <strong>backend</strong>, in there we can see database operations for creating user.</p><p>And in final <strong>frontend</strong> returning the response.</p><p>If you click logs next to the services, you can see log lines belongs to that <strong>TraceId</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMDsN9z2vnUaRUMzU7miiA.png" /><figcaption>Backend Logs for Trace</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3T9pvjnt-fnIBu0GEcc6kQ.png" /><figcaption>Frontend Logs for Trace</figcaption></figure><p>Let’s test to create a new user with the same id, it should be fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ispcI8XCXDxD6IPwsBmjKw.png" /><figcaption>Traces for Failing Create User</figcaption></figure><p>As you can see at INSERT operation we have errors and if we expand the column we can see the reason of the error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0YwGytuFNeO_M9zR_uHVKw.png" /><figcaption>Error of the Create User</figcaption></figure><p>Thanks to the traces we can answer the;</p><ul><li>Why HTTP Request is failing?</li><li>Which pod/container is failing?</li><li>How to resolve this?</li></ul><p>Since I’m trying to create the same user with same id, database is failing because user is already exists.</p><h4>Now let’s try to fetch the user we created</h4><p>For getting the users I’m using Redis for caching.</p><p>In my application flow if Redis Cache not hit I’m adding the response to cache with TTL 5 seconds.</p><p><a href="https://github.com/batuhan-bulut/distributed-monitoring/blob/main/applications/Backend/routes/user.py#L27">See this in GitHub</a></p><p>It means if I sent same query twice under 5 seconds, first one should hit the database and cached by Redis and second request should hit the Redis directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9F-ubRJpnY8_-7Oh8g7OoQ.png" /><figcaption>First Request of Get User</figcaption></figure><p>As you can see first request hit the Redis (<em>1</em>) but since cache is missed we query the database and cache this on Redis (<em>2</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uvna3tXUM0TnppXAlgC2ag.png" /><figcaption>Second Request of Get User</figcaption></figure><p>In here, our request hit the Redis cache and we didn’t query the database.</p><p>Thanks to the traces we can follow every step of our application(s) doing. it’s crucial and highly important on distributed systems.</p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=840effa3429c" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/kubernetes-logging-with-opentelemetry-traces-840effa3429c">Kubernetes Logging with OpenTelemetry + Traces</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install ELK Stack on Docker]]></title>
            <link>https://bulutbatuhan.medium.com/install-elk-stack-on-docker-3a9b7123486c?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a9b7123486c</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kibana]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Sun, 27 Oct 2024 13:53:28 GMT</pubDate>
            <atom:updated>2026-05-31T18:04:01.949Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to install ELK Stack on Docker with Docker Compose</h3><p><strong>ELK Stack Docker Compose Installation Tutorial (ElasticSearch + LogStash + Kibana)</strong></p><blockquote>Github Link of the document:<em> </em><a href="https://github.com/batuhan-bulut/elk-stack-docker"><em>https://github.com/batuhan-bulut/elk-stack-docker</em></a></blockquote><p>Monitoring plays a <strong>important role</strong> for both <strong>internal</strong> development (<em>Stage, Preproduction, etc.</em>) and <strong>production</strong> environments.</p><p>Given its importance, numerous tools exist for monitoring, log collection, and system observation.</p><p>In this document, we’ll focus on the <strong><em>ELK Stack</em></strong> — a lovely combination of <strong><em>Elasticsearch</em></strong>, <strong><em>Logstash</em></strong>, and <strong><em>Kibana</em></strong>.</p><h3>What is ELK Stack?</h3><blockquote>ELK Stack is short name for Elasticsearch + Logstash + Kibana combination.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r244W-z4r5Aze1KLFB-JzA.png" /><figcaption>Generic ELK Stack Diagram</figcaption></figure><p>ELK Stack is powerful combination and <strong>created by Elastic</strong>. It’s very popular stack for monitoring and <strong>widely used</strong> in Monitoring field.</p><ul><li><strong>ElasticSearch</strong> : Search Engine based on<strong> Apache Lucene</strong> (<em>yes, we can use Lucene Queries</em>) and <strong>DataSource</strong> for all of the data’s we push.</li><li><strong>LogStash</strong>: Receive incoming data from multiple sources,<strong> modify it</strong> with some rules/patterns, send to your stash — <em>ElasticSearch for this document.</em></li><li><strong>Kibana</strong>: Data visualisation / Observability and analytics. <strong>The part where end users will use for dashboards.</strong></li></ul><p>Even they are working <strong>perfectly like the three swordsmen</strong>, they can easily combined with other monitoring tools. (<em>You can add ElasticSearch to Grafana as datasource or send logs to ElasticSearch directly, etc.</em>)</p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><p>Additionally, you can use <strong>Data Shippers</strong> (<a href="https://www.elastic.co/beats"><em>Beats</em></a>) to collect custom Datasets.</p><p>Most Popular ones are;</p><ul><li><a href="https://www.elastic.co/beats/filebeat"><strong>FileBeat</strong></a>: <em>Shipper for logs and other text based data</em></li><li><a href="https://www.elastic.co/beats/metricbeat"><strong>MetricBeat</strong></a>: <em>Shippler for System-level Monitoring</em></li></ul><p>And the rest are;</p><ul><li><a href="https://www.elastic.co/beats/packetbeat"><strong>PacketBeat</strong></a>: <em>Shipper for Network Data</em></li><li><a href="https://www.elastic.co/beats/winlogbeat"><strong>WinlogBeat</strong></a>: <em>Shipper for Windows Event Logs</em></li><li><a href="https://www.elastic.co/beats/auditbeat"><strong>AuditBeat</strong></a>: <em>Shipper for Audit Data</em></li><li><a href="https://www.elastic.co/beats/heartbeat"><strong>HeartBeat</strong></a>: <em>Shipper for Uptime Monitoring</em></li></ul><h3>Architecture of the Logging</h3><blockquote>Logging System Design should be determined from the beginning. It’s too complicated to implement the design later since it may require too much change on systems, application code, etc.</blockquote><p>Now we have general knowledge about ELK Stack. Let’s build our Stack!</p><p><strong>Ideally</strong>, all logs <strong>should be collected in LogStash</strong> instance, Transform the data (<em>drop unnecessary fields, add tags, parse text-string, etc.</em>) with Grok Patterns and send to ElasticSearch.</p><p>But if it’s small application or test/stage environment you may <strong>send the logs directly to ElasticSearch.</strong></p><h3>Install ELK Stack with Docker Compose</h3><p>For the context, we will use Docker and Docer Compose to build our environment.</p><p>Let’s launch our ELK Stack with Docker Swarm.</p><pre>version: &quot;1.0&quot;<br>services:<br>  elasticsearch:<br>    container_name: elasticsearch-container<br>    image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3<br>    environment:<br>      - &quot;discovery.type=single-node&quot;<br>    networks:<br>      - elk-bridge-network<br>    ports:<br>      - 9200:9200<br>  logstash:<br>    container_name: logstash-container<br>    image: docker.elastic.co/logstash/logstash:8.15.3<br>    networks:<br>      - elk-bridge-network<br>    depends_on:<br>      - elasticsearch<br>    ports:<br>      - 5044:5044<br>  kibana:<br>    container_name: kibana-container<br>    image: docker.elastic.co/kibana/kibana:8.15.3<br>    networks:<br>      - elk-bridge-network<br>    depends_on:<br>      - elasticsearch<br>    ports:<br>      - 5601:5601<br>networks:<br>  elk-bridge-network:<br>    driver: bridge</pre><p>Save this code block asdocker-compose.yml and run this (docker compose up -d) command on the same directory with file.</p><p>This command will download the images and setup the ELK Stack Automatically.</p><blockquote>Note: Make sure <strong>9200</strong>, <strong>5044</strong> and <strong>5601</strong> ports are available on your local. If not you can edit the docker-compose.yml file with available ports.</blockquote><p>After this step, we need to see Kibana Logs for Login &amp; Setup URL with the passcode.</p><h3>Configuring Kibana</h3><p>If you have Docker Desktop on your local, you can easily navigate the containers and choose <strong>kibana-container</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2m5g_lwTkKWzkTSk9jUl0A.png" /><figcaption>Kibana container Logs</figcaption></figure><p>If you don’t have Docker Desktop run this command on your terminal.</p><pre>docker compose logs kibana | grep &#39;get started&#39;</pre><p>It will return the same line with code.</p><p>After navigating this URL we expect to see Kibana Configure screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*tB9xbM3uWsqlpLAPy27row.png" /><figcaption>Kibana first-setup page</figcaption></figure><pre>docker exec -u elasticsearch elasticsearch-container bin/elasticsearch-create-enrollment-token --scope kibana</pre><p>With this command, we will get our token and we can continue our configuration.</p><p>After we get our enrollment token, we can with “<em>Configure Elastic</em>”.</p><p>When it’s configured, we need a password for login to Kibana.</p><ul><li><strong>Username</strong> : <em>elastic</em></li><li><strong>Password</strong>: <em>rockyou</em></li></ul><p>After all this done, we can login our Kibana instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIVcwCxDFSi20H3e5tL0aQ.png" /><figcaption>Home page of Kibana</figcaption></figure><h3>Let’s test our ELK Stack</h3><blockquote>We have monitoring , now we need logs!</blockquote><p>First, we need to modify our <strong>Logstash</strong> container to <strong>collect logs and send to Elasticsearch</strong>.</p><p>For that, we can replace our docker-compose.yml with below, create a new folder named config and add logstash.conf under config directory.</p><pre>input {<br>  tcp {<br>    port =&gt; 5044<br>    codec =&gt; json_lines<br>  }<br>}<br><br>output {<br>  elasticsearch {<br>    hosts =&gt; [&quot;${ELASTICSEARCH_URL}&quot;]<br>    index =&gt; &quot;logstash-%{+YYYY.MM.dd}&quot;<br>    user =&gt; &quot;${ELASTICSEARCH_USER}&quot;<br>    password =&gt; &quot;${ELASTICSEARCH_PASSWORD}&quot;<br>    ssl_verification_mode =&gt; &quot;none&quot;<br>  }<br>}</pre><p>It will open 5044 port for <a href="https://www.elastic.co/guide/en/logstash/current/plugins-inputs-tcp.html"><em>TCP Input</em></a> with <a href="https://www.elastic.co/guide/en/logstash/current/plugins-codecs-json_lines.html"><em>json_lines</em></a> codec.</p><p>Output is <a href="https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html"><em>elasticsearch</em></a>, and made necessary configurations under there.</p><p>After these steps run docker compose up -d again. It will automatically re-create the <strong>logstash container</strong> with the environment variables for authentication to ElasticSearch and bind the logstash.conffile.</p><pre>version: &quot;1.0&quot;<br>services:<br>  elasticsearch:<br>    container_name: elasticsearch-container<br>    image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3<br>    environment:<br>      - &quot;discovery.type=single-node&quot;<br>      - ELASTIC_PASSWORD=rockyou<br>    networks:<br>      - elk-bridge-network<br>    ports:<br>      - 9200:9200<br>  logstash:<br>    container_name: logstash-container<br>    image: docker.elastic.co/logstash/logstash:8.15.3<br>    networks:<br>      - elk-bridge-network<br>    volumes:<br>      - ./config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro<br>    environment:<br>      - ELASTICSEARCH_USER=elastic<br>      - ELASTICSEARCH_PASSWORD=rockyou<br>      - ELASTICSEARCH_URL=https://elasticsearch:9200<br>    depends_on:<br>      - elasticsearch<br>    ports:<br>      - 5044:5044<br>  kibana:<br>    container_name: kibana-container<br>    image: docker.elastic.co/kibana/kibana:8.15.3<br>    networks:<br>      - elk-bridge-network<br>    depends_on:<br>      - elasticsearch<br>    ports:<br>      - 5601:5601<br>networks:<br>  elk-bridge-network:<br>    driver: bridge</pre><p>Now we can test with send a request to 5044 port. For that we can execute this command on our terminal:</p><pre>(echo -e &#39;{&quot;message&quot;:&quot;ELK Stack is working!&quot;, &quot;source&quot;:&quot;logstash&quot;}\r&#39;; sleep 1) | telnet localhost 5044</pre><p>After this, we need to create an Index to see this log in Kibana.</p><h4>Create Index on Kibana</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6d0oj5NUezIRE0vvKVbMQ.jpeg" /><figcaption>Kibana create Data view</figcaption></figure><p>For that, Login Kibana and Navigate <em>Management -&gt; Stack Management -&gt; Kibana -&gt; Data Views</em></p><p>Or, just navigate this URL -&gt; <a href="http://localhost:5601/app/management/kibana/dataViews">http://localhost:5601/app/management/kibana/dataViews</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*pn2IgQMSM4LSnyzHbhHAgA.png" /><figcaption>Create Data View</figcaption></figure><p>Since our Index pattern islogstash-%{+YYYY.MMdd} in logstash.conffile, we make our Index pattern as logstash-* to collect every indexes starts with <em>logstash</em>.</p><p>After this, we can Navigate Analytics -&gt; Discover and choose <em>Logstash.</em></p><blockquote>And Voila!</blockquote><p>We can see our logline!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpda4cSBUedXIUueP_og3g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a9b7123486c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy Lambda function on AWS using Terraform]]></title>
            <link>https://aws.plainenglish.io/how-to-deploy-lambda-function-on-aws-using-terraform-16f7f1fa930f?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/16f7f1fa930f</guid>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[iac]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Tue, 18 Jun 2024 19:59:47 GMT</pubDate>
            <atom:updated>2026-05-31T18:04:06.776Z</atom:updated>
            <content:encoded><![CDATA[<p>Serverless functions are critical for DevOps and SysOps since you don’t need to worry about Infrastructure.</p><p>We will be looking for Amazon Web Services (<em>AWS</em>) Lambda <strong>functions</strong> and <strong>how can we deploy AWS Lambda with Terraform</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGpnOYXHeSN4R9PEe1ejrQ.png" /></figure><p>Github Link for all materials : <a href="https://github.com/batuhan-bulut/terraform-aws-lambda">https://github.com/batuhan-bulut/terraform-aws-lambda</a></p><h3>What is AWS Lambda?</h3><blockquote>Lambda is <strong>a compute service that you can use to build applications without</strong> provisioning or managing servers.</blockquote><p>With AWS Lambda you can execute your scripts in <strong>supported languages without thinking the servers</strong>. You can execute codes written in <em>Node.JS, Python, C#</em>, and <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html">many more languages</a>.</p><p>With Lambda you can do;<br>- Check the status of your EC2 Instances on Regions.<br>- Run some automation with <em>AWS CLI</em>.<br>- Schedue a task with <em>AWS SQS</em>.<br>- etc.</p><p>With this possibilities, AWS Lambda has <strong>very important place</strong> for <strong>DevOps</strong> and <strong>SysOps</strong> teams.</p><p>It’s easy to deploy a AWS Lambda from AWS Website with GUI.</p><p><strong>What if you have multiple accounts and you need to deploy the same Lambda to different regions?</strong> What you gonna do? Deploy Lambda’s one-by-one?</p><p>This is where <strong>IaC</strong> and <strong>Terraform</strong> joins the game.</p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>What is IaC ? (Infrastructure as Code)</h3><blockquote>Infrastructure as code (IaC) is the ability to provision and support your infrastructure using code instead of manual processes.</blockquote><p>With IaC, we can easily setup our any environment (<em>Development, Test, Stating, Production, etc.</em>). Populer providers has their CDK (Cloud Development Kit ) for your requirements.</p><h4>Why Terraform Important?</h4><p>Let’s say <strong>you have an app in AWS</strong> and it uses<strong> many services</strong> (E<em>C2, RDS, Lambda, SQS, etc.</em>). and you can deploy this application with AWS CDK easyily.</p><p><strong>What if management decides to switch Azure, GCP or another cloud provider?</strong></p><p>Most of your knowledge in <strong>AWS CDK</strong> is not important anymore because this providers <strong>has their CDK’s.</strong></p><p>This is where <strong>Terraform joins to our workflow.</strong></p><h3>What is Terraform ?</h3><blockquote>HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share for AWS, GCP, Azure, Alibaba Cloud, Kubernetes and many more.</blockquote><p>As you see, with knowledge and experience<strong> in Terraform we can manage many resources with simple commands.</strong></p><p>On this document, <strong>we will focus AWS side of Terraform</strong>.</p><h3>Lights, Camera, Action!</h3><blockquote>Before start make sure you have;<br> — AWS Account<br> — Terraform Installed on your local (<a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli">Installation Guide</a>)</blockquote><p>Be Careful : This actions can create a cost on AWS side.</p><h4>What will our Terraform code do;</h4><ul><li><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role">Provide IAM Role</a></li><li><a href="http://aws_iam_policy/">Provide IAM Profile</a></li><li><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment">Attach IAM Policy to profile</a></li><li><a href="https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file">Create a ZIP file for upload</a></li><li><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function">Create the Lambda Function</a></li></ul><p>On this document, we will <strong>use variables instead of hard-coded values</strong>. With this, you can <strong>execute the same script with different settings.</strong></p><p>This is our terraform/main.tf file, it contains the skeleton of our code.</p><pre>provider &quot;aws&quot; {<br>  region = var.region<br>}<br><br># IAM role for AWS Lambda<br>resource &quot;aws_iam_role&quot; &quot;terraform_lambda_iam_role&quot; {<br>name               = var.terraform_lambda_iam_role.name<br>assume_role_policy = var.terraform_lambda_iam_role.assume_role_policy<br>}<br><br># Create a new policy for Lambda<br>resource &quot;aws_iam_policy&quot; &quot;iam_policy_for_lambda&quot; {<br> name         = &quot;iam_policy_${var.terraform_lambda_iam_role.name}&quot;<br> description  = var.iam_policy_for_lambda.description<br> policy       = var.iam_policy_for_lambda.policy<br>}<br><br># Attach IAM Policy to IAM Role<br>resource &quot;aws_iam_role_policy_attachment&quot; &quot;attach_iam_policy_to_iam_role&quot; {<br> role        = aws_iam_role.terraform_lambda_iam_role.name<br> policy_arn  = aws_iam_policy.iam_policy_for_lambda.arn<br>}<br><br># Create a zip file for upload to Lambda<br>data &quot;archive_file&quot; &quot;zip_python_lambda_code&quot; {<br>type        = &quot;zip&quot;<br>output_path = &quot;${path.module}/python/${var.zip_python_lambda_code.name}.zip&quot;<br>source_file = &quot;${path.module}/../${var.zip_python_lambda_code.name}.py&quot;<br>}<br><br># Create the Lambda function<br>resource &quot;aws_lambda_function&quot; &quot;terraform_lambda&quot; {<br>filename                       = &quot;${path.module}/python/${var.zip_python_lambda_code.name}.zip&quot;<br>function_name                  = var.terraform_lambda.name<br>role                           = aws_iam_role.terraform_lambda_iam_role.arn<br>runtime                        = var.terraform_lambda.runtime<br>handler                        = &quot;${var.zip_python_lambda_code.name}.lambda_handler&quot;<br>}</pre><p>In this code block we read all variables from terraform/terraform.tf file. <strong>We can execute the same Terraform file with different configurations</strong> for different environments like Production, Staging or even different AWS Region.</p><p>To read this variables, we need to definition of variables. We can declare variables with “.tf” files.</p><p>This is how terraform.tf file looks like for code above.</p><pre>variable &quot;region&quot; {<br>  type = string<br>  description = &quot;AWS Region&quot;<br>  default = &quot;eu-central-1&quot;<br>}<br><br>variable &quot;zip_python_lambda_code&quot; {<br>  type = map(string)<br>  description = &quot;Name of the Python file&quot;<br>  default = {<br>    name = &quot;index&quot;<br>  }<br>}<br><br>variable &quot;terraform_lambda_iam_role&quot; {<br>  type = map(string)<br>  description = &quot;aws_iam_role - terraform_lambda_iam_role variables&quot;<br>  default = {<br>    name = &quot;Lambda-from-terraform&quot;<br>    assume_role_policy = &lt;&lt;EOF<br>{<br> &quot;Version&quot;: &quot;2012-10-17&quot;,<br> &quot;Statement&quot;: [<br>   {<br>     &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>     &quot;Principal&quot;: {<br>       &quot;Service&quot;: &quot;lambda.amazonaws.com&quot;<br>     },<br>     &quot;Effect&quot;: &quot;Allow&quot;,<br>     &quot;Sid&quot;: &quot;&quot;<br>   }<br> ]<br>}<br>EOF<br>  }<br>}<br><br>variable &quot;iam_policy_for_lambda&quot; {<br>  type = map(string)<br>  description = &quot;IAM policy for lambda&quot;<br>  default = {<br>    description = &quot;IAM policy - created by Terraform&quot;<br>    policy = &lt;&lt;EOF<br>{<br> &quot;Version&quot;: &quot;2012-10-17&quot;,<br> &quot;Statement&quot;: [<br>   {<br>     &quot;Action&quot;: [<br>       &quot;logs:CreateLogGroup&quot;,<br>       &quot;logs:CreateLogStream&quot;,<br>       &quot;logs:PutLogEvents&quot;<br>     ],<br>     &quot;Resource&quot;: &quot;arn:aws:logs:*:*:*&quot;,<br>     &quot;Effect&quot;: &quot;Allow&quot;<br>   }<br> ]<br>}<br>EOF<br>  }<br>}<br><br>variable &quot;terraform_lambda&quot; {<br>  type = map(string)<br>  description = &quot;Variables for lambda&quot;<br>  default = {<br>    name = &quot;Lambda_Terraform&quot;<br>    runtime = &quot;python3.12&quot;<br>    handler = &quot;index.lambda_handler&quot;<br>  }<br>}</pre><p>On this file we declare the variables and their default values, In Terraform we can declare different types of variables.</p><p>You can check <a href="https://developer.hashicorp.com/terraform/language/values/variables">Terraform documents</a> for more info.</p><p><strong>If you don’t want to use default values for your code</strong>, you can add a terraform/vars.tfvars file for override default variables. Context of this file is regular “<em>key = value</em>”.</p><p>Here it’s an example for <em>.tfvars</em> file</p><pre>region = &quot;us-east-1&quot;<br><br>terraform_lambda= {<br>    name = &quot;Override_Name&quot;<br>    runtime = &quot;python3.9&quot;<br>    handler = &quot;override.lambda_handler&quot;<br>}</pre><p>With this Terraform will override default values for region and terraform_lambda variables.</p><p><strong>Note</strong>: if you want to change a variable from object like terraform_lambda like this example, you need to pass all variables in the object, otherwise it will raise an error.</p><p>and let’s add a simple Pyton App to our root folder named index.py</p><pre># Simple Hello function<br>import json<br><br>def lambda_handler(event, context):<br>    return {<br>        &#39;statusCode&#39;: 200,<br>        &#39;body&#39;: json.dumps(&#39;Hello from Lambda!&#39;)<br>    }</pre><p>This is how folders should look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*PphP6Pl0sYflFID7QjlABg.png" /><figcaption>Folder structure</figcaption></figure><h3>Showtime!</h3><p>We’re ready for execute the code.</p><p>First we need to execute terraform init command for initalize a working directory containing Terraform configuration files.</p><pre>$terraform init<br><br>Initializing the backend...<br><br>Initializing provider plugins...<br>- Reusing previous version of hashicorp/aws from the dependency lock file<br>- Reusing previous version of hashicorp/archive from the dependency lock file<br>- Using previously-installed hashicorp/aws v5.54.1<br>- Using previously-installed hashicorp/archive v2.4.2<br><br>Terraform has been successfully initialized!<br><br>You may now begin working with Terraform. Try running &quot;terraform plan&quot; to see<br>any changes that are required for your infrastructure. All Terraform commands<br>should now work.<br><br>If you ever set or change modules or backend configuration for Terraform,<br>rerun this command to reinitialize your working directory. If you forget, other<br>commands will detect it and remind you to do so if necessary.</pre><p>After that, we can execute terraform plan to see the changes in the infrastructure.</p><pre>data.archive_file.zip_python_lambda_code: Reading...<br>data.archive_file.zip_python_lambda_code: Read complete after 0s [id=111]<br><br>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:<br>  + create<br><br>Terraform will perform the following actions:<br><br>  # aws_iam_policy.iam_policy_for_lambda will be created<br>  + resource &quot;aws_iam_policy&quot; &quot;iam_policy_for_lambda&quot; {<br>      + arn              = (known after apply)<br>      + attachment_count = (known after apply)<br>      + description      = &quot;IAM policy - created by Terraform&quot;<br>      + id               = (known after apply)<br>      + name             = &quot;iam_policy_Lambda-from-terraform&quot;<br>      + name_prefix      = (known after apply)<br>      + path             = &quot;/&quot;<br>      + policy           = jsonencode(<br>            {<br>              + Statement = [<br>                  + {<br>                      + Action   = [<br>                          + &quot;logs:CreateLogGroup&quot;,<br>                          + &quot;logs:CreateLogStream&quot;,<br>                          + &quot;logs:PutLogEvents&quot;,<br>                        ]<br>                      + Effect   = &quot;Allow&quot;<br>                      + Resource = &quot;arn:aws:logs:*:*:*&quot;<br>                    },<br>                ]<br>              + Version   = &quot;2012-10-17&quot;<br>            }<br>        )<br>      + policy_id        = (known after apply)<br>      + tags_all         = (known after apply)<br>    }<br><br>  # aws_iam_role.terraform_lambda_iam_role will be created<br>  + resource &quot;aws_iam_role&quot; &quot;terraform_lambda_iam_role&quot; {<br>      + arn                   = (known after apply)<br>      + assume_role_policy    = jsonencode(<br>            {<br>              + Statement = [<br>                  + {<br>                      + Action    = &quot;sts:AssumeRole&quot;<br>                      + Effect    = &quot;Allow&quot;<br>                      + Principal = {<br>                          + Service = &quot;lambda.amazonaws.com&quot;<br>                        }<br>                      + Sid       = &quot;&quot;<br>                    },<br>                ]<br>              + Version   = &quot;2012-10-17&quot;<br>            }<br>        )<br>      + create_date           = (known after apply)<br>      + force_detach_policies = false<br>      + id                    = (known after apply)<br>      + managed_policy_arns   = (known after apply)<br>      + max_session_duration  = 3600<br>      + name                  = &quot;Lambda-from-terraform&quot;<br>      + name_prefix           = (known after apply)<br>      + path                  = &quot;/&quot;<br>      + tags_all              = (known after apply)<br>      + unique_id             = (known after apply)<br>    }<br><br>  # aws_iam_role_policy_attachment.attach_iam_policy_to_iam_role will be created<br>  + resource &quot;aws_iam_role_policy_attachment&quot; &quot;attach_iam_policy_to_iam_role&quot; {<br>      + id         = (known after apply)<br>      + policy_arn = (known after apply)<br>      + role       = &quot;Lambda-from-terraform&quot;<br>    }<br><br>  # aws_lambda_function.terraform_lambda will be created<br>  + resource &quot;aws_lambda_function&quot; &quot;terraform_lambda&quot; {<br>      + architectures                  = (known after apply)<br>      + arn                            = (known after apply)<br>      + code_sha256                    = (known after apply)<br>      + filename                       = &quot;./python/index.zip&quot;<br>      + function_name                  = &quot;Override_Name&quot;<br>      + handler                        = &quot;index.lambda_handler&quot;<br>      + id                             = (known after apply)<br>      + invoke_arn                     = (known after apply)<br>      + last_modified                  = (known after apply)<br>      + memory_size                    = 128<br>      + package_type                   = &quot;Zip&quot;<br>      + publish                        = false<br>      + qualified_arn                  = (known after apply)<br>      + qualified_invoke_arn           = (known after apply)<br>      + reserved_concurrent_executions = -1<br>      + role                           = (known after apply)<br>      + runtime                        = &quot;python3.9&quot;<br>      + signing_job_arn                = (known after apply)<br>      + signing_profile_version_arn    = (known after apply)<br>      + skip_destroy                   = false<br>      + source_code_hash               = (known after apply)<br>      + source_code_size               = (known after apply)<br>      + tags_all                       = (known after apply)<br>      + timeout                        = 3<br>      + version                        = (known after apply)<br>    }<br><br>Plan: 4 to add, 0 to change, 0 to destroy.</pre><p>and we can execute terraform apply to push this changes to our infra.</p><p>After that you will see the success message on the console. It means every resource are created on AWS side. You can go and check &amp; execute your lambda function from AWS GUI or can check the Lambda function in CLI.</p><pre>aws lambda list-functions --region us-east-1 | grep Override_Name <br><br>&quot;FunctionName&quot;: &quot;Override_Name&quot;,<br>&quot;FunctionArn&quot;: &quot;arn:aws:lambda:us-east-1:11111:function:Override_Name&quot;,<br>&quot;LogGroup&quot;: &quot;/aws/lambda/Override_Name&quot;</pre><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f7f1fa930f" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/how-to-deploy-lambda-function-on-aws-using-terraform-16f7f1fa930f">How to deploy Lambda function on AWS using Terraform</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Closer Look at Microservices vs Modular Monolith vs Monolith: Exploring the Pros and Cons]]></title>
            <link>https://bulutbatuhan.medium.com/closer-look-at-microservices-vs-modular-monolith-vs-monolith-exploring-the-pros-and-cons-8c8b16029a24?source=rss-107bcaf7b00e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c8b16029a24</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <category><![CDATA[modular-monolith]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Batuhan Bulut]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 09:50:29 GMT</pubDate>
            <atom:updated>2026-05-31T18:04:10.181Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Think a place where software development is agile, scalable, and flexible. That’s the promise of microservices, a modern architectural approach to challenging the long-standing monolithic way.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t73T8vBFIQZHnz2OFkuTIw.jpeg" /><figcaption>Monolith vs Modular Monolith vs Microservices</figcaption></figure><p>A <strong>monolith application</strong> is more like a <em>one-piece software.</em> Everything happens on the same project, same code base.</p><p>Different is <strong>Modular Monolith</strong> was it’s still a monolith application, but <em>in pieces</em>. Modules in this approach are separated logically, not physically. If we want to physically separate it, we have to implement the microservice approach.</p><p>A <strong>microservices application</strong> is collection of <em>a lot of small applications. </em>Everything happens individually on different code base.</p><p>Actually on that versus, <strong>there no actual winner.</strong></p><p>In some cases<strong> monolith can easily dominate microservices</strong> or <strong>vice-versa</strong>. On that article we will deep dive to these <strong>pros </strong>and <strong>cons</strong>, and <strong>use-cases</strong>.</p><p>Buckle up for <strong>Zero to Hero: Microservices vs Monolith architecture.</strong></p><h3>Note for the Reader</h3><p>If you found this story helpful, please consider leaving a clap. You can also hold the clap button to give more claps!</p><p>yes, that actually works!</p><h3>Monolith Approrach</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*UxPCTAPCuza4Y0UyrddcbQ.png" /><figcaption>Monolith Approach</figcaption></figure><p>Monolith applications are often simple applications. All the magic happens in the same place like one big advanced, confusing machine. Everything related your project (User I/O, Database process, business workflow, etc.) happens on the same place.</p><p>Like a life, this is also double edged sword. We have a lot of cons with Monolith, also has a lot of negative impact to our project. Let’s check one by one;</p><h4>Why Monolith better?</h4><p>If you’re <strong>just started the development</strong> and trying to figure out something on your local; Monolith will be best for you. Since all the magic happens in the same place you can <strong>debug the error easily</strong> and fix the issue. <strong>Even in big enterprise-scaled projects monolith still have a place during development.</strong></p><ul><li><strong>Easy Debug:</strong> Since all the magic happens in the same place you can check and <strong>test all the workflow to find the debug, after that you can fix. </strong>Since you have all the application <strong>you can test if it broke or not some other parts in the application.</strong></li><li><strong>Developer-Friendly:</strong> <strong>More simply and clear code base in your project </strong>and reducing the complexity of distributed systems. You can work more efficiently as they have a all the view of the application, enabling easy debug steps, refactoring, and add improvements.</li><li><strong>Simplicity:</strong> The entire application is built as a monolithic. <strong>It means, it’s easier to develop, deploy, and maintain. </strong>Developers can focus on writing code without worrying about internal communication issues, network related issues (<em>timeout-latency, serialize, etc.</em>).</li><li><strong>Performance: </strong>Monolithic apps are extremely fast because of their simplicity. <strong>In Monolith app, functions, data access, DB operations, etc. are direct, without overhead of inter-process communications or network requests.</strong> Thanks to that, we have <strong>faster response times</strong> and <strong>better resource utilization, </strong>especially in workflows with heavy workloads.</li></ul><p><strong>Code base Management:</strong> In monolithic architecture, managing the code base becomes more streamlined. <strong>Since all the code is stored in a single repository, version control, code reviews, and collaboration among developers are simplified.</strong></p><h4>Disadvantage of Monolith?</h4><blockquote><em>If there is a lot of plusses in Monolith, why we’re not using in every project?</em></blockquote><p>Like <em>ying-yang</em>, everything has a <strong>plus </strong>and <strong>cons</strong>, even in development.</p><p>Monolith can be perfect choice for some applications or business plans, but <strong>still have disadvantages.</strong></p><p><strong>Not Scalability </strong>: Monolithic architectures can face challenges when it comes to <strong>scaling</strong>. As the application grows in size and complexity, it becomes<strong> harder to scale specific components independently. </strong>Scaling the entire monolith can result in inefficient resource utilization and can be costly, especially if certain components have higher resource requirements compared to others. This lack of granular scalability can limit the ability to handle high traffic or accommodate evolving needs.</p><p><strong>Limited Flexibility</strong>: Monolithic architectures often<strong> trust on a single technology stack</strong> or framework on the application. <strong>This can block</strong> the ability to adopt new technologies, languages, or frameworks that might be better suited for certain functionalities or development needs.</p><p><strong>One Fault to All</strong>: In a monolithic architecture, a <strong>failure in one component can potentially impact the entire application</strong>. Since all components share the same infrastustructure, a bug or crash in one flow can lead to the entire application becoming unavailable.</p><h4>Last Words about Monolith</h4><p>While monolithic architectures have disadvantages, t<strong>hey have been successfully used in certain applications</strong>, <strong>particularly when the scale and complexity are manageable and not changable later.</strong></p><h3>Modular Monolith Approach</h3><blockquote>New cheriff in town.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*-aXNqjyq4oOWa2IKrX-YpA.png" /><figcaption>Modular Monolith Approach</figcaption></figure><p>A 𝐌𝐨𝐝𝐮𝐥𝐚𝐫 𝐌𝐨𝐧𝐨𝐥𝐢𝐭𝐡 𝐚𝐫𝐜𝐡𝐢𝐭𝐞𝐜𝐭𝐮𝐫𝐞 is similar to a Monolith; <em>but more flexible way.</em></p><p>In this approach, instead of one monolith app, <strong>we can tear it down to more manageable, dedicated modules</strong>. These modules are <strong>still coupled</strong>, it’s not flexible as microservices but <strong>still can be deployed and developed independently.</strong></p><p>In modular monolith, logic encapsulation enables high reusability, while data remains consistent and communication patterns simple.</p><p>It is more easy to develop or maintain a modular monolith. With microservices you have hundreds of microservives in different machines, regions, etc. and this creates infra complexity and increase operational costs (<em>both financial and workload</em>)</p><p>Services in Modular Monolith can work with <strong>async (</strong><em>black arrows</em><strong>) with the Message Broker. </strong>Or also can work with <strong>sync</strong> (<em>purple arrows</em>) without Message Broker, if needed.</p><h4><strong>Good parts of Modular Monolith</strong></h4><p><strong>Modular/Independent Development: </strong>modular monolith allows developers to organize the codebase into separate modules or workflows. Development team <strong>can work on modules independently,</strong> and this can leads to <strong>shorten deployment times.</strong></p><p><strong>Better Reusability</strong>: Modules in a modular monolith<strong> can be reused</strong>. Multiple modules might share common features or libraries, eliminating duplicative code and fostering code reuse. This increases <strong>consistency</strong>, decreases the risk of defects, and improves development efficiency.</p><p><strong>Smooth Migration</strong>: If required, a modular monolith can be migrated with the Microservices with very little workload. The monolith can be divided into loosely linked modules, making it simpler to pinpoint potential microservice borders in the future. <strong>With this strategy, a smoother migration path is possible.</strong></p><h4><strong>About the disadvantages;</strong></h4><p>The modular monolith approach is sharing the <em>same disadvantages with Monolith approach.</em></p><h3>Microservices</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*5DR1ZumEwvXnk-ObfQXpzg.png" /><figcaption>Microservices</figcaption></figure><p><strong>Microservices (</strong><em>a.k.a the microservice architecture</em><strong>) is an architectural style that structures an application as a collection of services.</strong></p><p>Thanks to that we have a lot of advantages, a few advangates are;</p><ul><li><strong>Independently deployable:</strong> In microservices we don’t have any requirement for deployment. We can deploy these services any place, Since services communication in API mostly, there is no need to host them on the same Infrastructure.</li><li><strong>Loosely coupled:</strong> Microservices are developed independently, thanks to that codebase is loosely coupled, because of that refactoring or updating/changing the framework is very easy.</li><li><strong>Scalability and Elasticity:</strong> Since microservices are independent and loosely couple, we can deploy and scale as musch as we needed, If there is a big load in X service, we can easyly deploy a second one and split the workload with various ways.</li><li><strong>Fault Isolation and Resilience:</strong> Unlike the Monolith, if one microservice is failed, it will not crash the entire application. With that we can secure our uptime and even delete the problematic service and install a new one in a blink of an eye.</li></ul><p>One of the disadvantages of Microservices <strong>are is latency</strong>. since they are not hosted in same infra and distributed over the network, they are communicating with <em>API’s mostly</em>. During that communications, <strong>if our latency increases maybe some of the workloads will not work properly.</strong></p><p><strong>We have to make sure we tolerate these latencyies with async functions or even protect the workload with timeouts.</strong></p><p>Also, microservices architecture should be planned well because of <strong>operational workload and Infra complexity.</strong></p><p>All the services hosted in<strong> individual hosts and this may be overwhelming in big-scaled apps.</strong> Managing and coordinating multiple services, each with its own codebase, dependencies, and communication protocols, can be challenging.</p><p>Additionally, operational tasks such as monitoring, logging, and deployment become more complex in a distributed environment.</p><h3>So, Who is the Winner?</h3><p>Actually, there is no certain winner.</p><p><strong>Choosing the right architecture depends</strong> on the specific requirements of the application, the scale of the project, the development team’s expertise, and the need for future scalability and flexibility.</p><p>Each architecture has<strong> its pros and cons</strong>, and a careful evaluation of the project’s needs and trade-offs is essential to make an informed decision.</p><h4>Monolith</h4><ul><li>Monolith is a traditional software architecture where the entire application is <strong>built as a single, cohesive unit.</strong></li></ul><p><strong>Advantages:</strong></p><ul><li><strong>Simplicity</strong> in development and deployment, better performance due to direct function calls, <strong>no network latency</strong>, and ease of scaling the entire application.</li></ul><p><strong>Disadvantages:</strong></p><ul><li><strong>Limited scalability</strong> and technological flexibility, challenges in fault isolation, errors can crash entire application and longer development cycles for changes or updates.</li></ul><h4>Modular Monolith</h4><ul><li>Modular Monolith is a <strong>hybrid</strong> approach that combines some benefits of both <em>monolithic</em> and <em>microservices</em> architectures.</li></ul><p><strong>Advantages:</strong></p><ul><li>Offers modularity and independent development <strong>like microservices </strong>while still residing within a <strong>single codebase</strong> for simpler deployment and management.</li></ul><p><strong>Disadvantages:</strong></p><ul><li><strong>Limited scalability</strong> compared to fully distributed microservices, challenges in dependency management, and potential trade-offs between <em>monolithic</em> and <em>microservices</em> characteristics.</li></ul><h4>Microservices</h4><ul><li>Microservices is an architectural style where an application is divided into a collection of small, independent services that <strong>communicate with each other over a network.</strong></li></ul><p><strong>Advantages:</strong></p><ul><li><strong>Scalability</strong> and <strong>elasticity</strong> through <strong>independent scaling</strong>, fault isolation for better resilience, and independent development and deployment for faster iterations.</li></ul><p><strong>Disadvantages:</strong></p><ul><li><strong>Increased complexity</strong> and operational overhead, challenges in inter-service communication and data consistency, and potential difficulties in managing a distributed system.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c8b16029a24" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>