<?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 Si Thu Ye Aung on Medium]]></title>
        <description><![CDATA[Stories by Si Thu Ye Aung on Medium]]></description>
        <link>https://medium.com/@sithuyeaung?source=rss-6ed84764dc2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*m31NgJaQz1S6OPWuYXagog@2x.jpeg</url>
            <title>Stories by Si Thu Ye Aung on Medium</title>
            <link>https://medium.com/@sithuyeaung?source=rss-6ed84764dc2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 05:39:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sithuyeaung/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[“Boosting Kubernetes Storage: Longhorn Installation Guide for Medium-Sized Clusters”]]></title>
            <link>https://sithuyeaung.medium.com/boosting-kubernetes-storage-longhorn-installation-guide-for-medium-sized-clusters-c794538634ed?source=rss-6ed84764dc2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c794538634ed</guid>
            <dc:creator><![CDATA[Si Thu Ye Aung]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 05:24:34 GMT</pubDate>
            <atom:updated>2023-10-15T05:26:35.119Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CYWgfj_d8Ed2_NNZg1IAJQ.png" /></figure><p>Excited to share a step-by-step guide on deploying Longhorn storage on your Kubernetes cluster! 🌐</p><p>If you’re managing a medium-sized Kubernetes cluster and looking for a reliable, open-source storage solution, Longhorn might be your answer. It’s a game-changer for data persistence and scalability. Here’s how to get started:</p><ol><li><strong>Prerequisites: </strong>Ensure you have a working Kubernetes cluster up and running. You’ll also need kubectl access.</li></ol><p>E.g: kubect get nodes</p><pre>NAME     STATUS ROLES                  AGE    VERSION<br>master01  Ready  controlplane,etcd.   5m34s   v1.17.5<br>master02  Ready  controlplane,etcd.   5m34s   v1.17.5<br>master03  Ready  controlplane,etcd.   5m34s   v1.17.5<br>worker01  Ready  worker               5m34s   v1.17.5<br>worker02  Ready  worker               5m34s   v1.17.5</pre><p><strong>2.Install Longhorn: </strong>Deploy Longhorn into your cluster using a simple YAML manifest. It’s lightweight and easy to configure.</p><p>Create a Namespace (Optional, but recommended):</p><pre>kubectl create namespace longhorn-system</pre><p><strong>3. Deploy the Longhorn on K8s or RKE.</strong></p><pre>helm repo add longhorn https://charts.longhorn.io<br>helm repo update<br>helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace --version 1.4.0<br>kubectl -n longhorn-system get pod</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*HMim7OUvV8txy0gC1xoXig.png" /></figure><p>4. <strong>Deploy the Storage class K8s or RKE.</strong></p><p>cat &lt;&lt;EOF |kubectl create -f -</p><p>allowVolumeExpansion: true</p><p>apiVersion: storage.k8s.io/v1</p><p>kind: StorageClass</p><p>metadata:</p><p>name: mongo-storage</p><p>parameters:</p><p>dataLocality: strict-local</p><p>provisioner: driver.longhorn.io</p><p>reclaimPolicy: Delete</p><p>volumeBindingMode: Immediate</p><p>EOF</p><p><strong>5. Get the Storage Class.</strong></p><p>kubectl get storageclass</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*asX19NOXlVbOfYPE8vekHg.png" /></figure><p>The best part? Longhorn is open-source and community-driven, which means it’s continuously improving!</p><p>Feel free to ask any questions or share your experiences with Longhorn in the comments below. Let’s elevate our Kubernetes storage game together!</p><p>#Kubernetes #Longhorn #StorageSolutions #DevOps #OpenSource #DataManagement #MediumClusters</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c794538634ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Kubernetes with RKE on Red Hat: A Guide for Medium-Sized Enterprises”]]></title>
            <link>https://sithuyeaung.medium.com/installing-rke-cluster-on-redhat-enterprise-linux-8-5-5d246737ad2e?source=rss-6ed84764dc2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d246737ad2e</guid>
            <dc:creator><![CDATA[Si Thu Ye Aung]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 04:56:19 GMT</pubDate>
            <atom:updated>2023-10-15T04:59:43.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ualHa2vioHFVPEz2Fvjg9w.png" /></figure><h3>Rancher Kubernetes Engine (RKE) is a lightweight Kubernetes installer that simplifies the deployment and management of Kubernetes clusters. To install RKE on Red Hat Linux for a medium-sized cluster, you can follow these steps:</h3><p>Note: This guide assumes that you have a Red Hat Linux server set up and ready to use.</p><h3>Prerequisites for RKE All Nodes.</h3><p><strong>System OS Requirement and root privilege account.</strong></p><ol><li>Redhat 8.5 (5 Nodes Based on your requirements).</li><li>Root or sudo access on the server.</li></ol><h3>DNS mapping in k8s all hosts.</h3><p>cat &lt;&lt;EOF | sudo tee -a /etc/hosts</p><p>192.168.200.10 master-01 master-01.example.com</p><p>192.168.200.11 master-02 master-02.example.com</p><p>192.168.200.12 master-03 master-03.example.com</p><p>192.168.200.30 worker-01 worker-01.example.com</p><p>192.168.200.31 worker-02 worker-02.example.com</p><p>EOF</p><h3>Firewall allow following ports for each nodes.</h3><p>[root@master01 ~]# firewall-cmd — add-port={22/tcp,80/tcp,2376/tcp,2379/tcp,2380/tcp,8472/tcp,9099/tcp,10250/tcp,6443/tcp,10254/tcp,30000–32767/tcp,30000–32767/udp} — permanent<br>success<br>[root@master01 ~]# firewall-cmd — reload<br>success</p><h3>Selinux permissive mode for each nodes</h3><p>sudo sed -i ‘s/SELINUX=enforcing/SELINUX=permissive/’ /etc/selinux/config</p><h3>Configure required modules for each nodes</h3><p>cat &lt;&lt;EOF | sudo tee /etc/modules-load.d/containerd.conf</p><p>overlay</p><p>br_netfilter</p><p>EOF</p><p>sudo modprobe overlay</p><p>sudo modprobe br_netfilter</p><p>sudo sed -i ‘s/^net.ipv4.ip_forward/#&amp;/’ /etc/sysctl.d/*</p><p>cat &lt;&lt;EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf</p><p>net.bridge.bridge-nf-call-iptables = 1</p><p>net.ipv4.ip_forward = 1</p><p>net.bridge.bridge-nf-call-ip6tables = 1</p><p>net.ipv6.conf.all.disable_ipv6 = 1</p><p>net.ipv6.conf.default.disable_ipv6 = 1</p><p>EOF</p><p>sudo sysctl -p /etc/sysctl.d/99-kubernetes-cri.conf</p><h3>Disable Swap for each nodes</h3><p>sudo swapoff -a</p><p>sudo sed -i ‘s/^[^#]*swap/#&amp;/’ /etc/fstab</p><h3>Install Docker Engine (CE) for each nodes</h3><p>sudo dnf install -y yum-utils device-mapper-persistent-data lvm2 iscsi-initiator-utils vim wget chrony</p><p>sudo dnf config-manager — add-repo=https://download.docker.com/linux/centos/docker-ce.repo</p><p>sudo dnf remove -y podman buildah</p><p>sudo dnf install -y docker-ce docker-ce-cli containerd.io</p><p>sudo usermod -a -G docker $USER</p><p>sudo systemctl enable docker — now</p><p>docker –version</p><p>sudo mkdir -p /etc/containerd</p><p>sudo containerd config default | sudo tee /etc/containerd/config.toml</p><p>sudo systemctl enable containerd –now</p><h3>SSH setting for RKE mandatory requirement for each nodes</h3><p>cat &lt;&lt;EOF | sudo tee -a /etc/ssh/sshd_config</p><p>AllowStreamLocalForwarding yes</p><p>PermitTunnel yes</p><p>EOF</p><p>sudo systemctl restart sshd</p><h3>SSH Keygen generate and ssh-copy-id</h3><p>- Login to the master nodes with ssh client.</p><p>ssh-keygen</p><p>ssh-copy-id k8s@master-01.example.com</p><p>ssh-copy-id k8s@master-02.example.com</p><p>ssh-copy-id k8s@master-03.example.com</p><p>ssh-copy-id k8s@worker-01.example.com</p><p>ssh-copy-id k8s@worker-02.example.com</p><h3>Download the RKE on master node</h3><p>wget <a href="https://github.com/rancher/rke/releases/download/v1.4.1/rke_linux-amd64">https://github.com/rancher/rke/releases/download/v1.17.5/rke_linux-amd64</a></p><p>sudo install -o root -g root -m 0755 rke_linux-amd64 /usr/bin/rke</p><p>rke — version</p><h3>Download the kubectl on master node</h3><p>curl -LO “https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl&quot;</p><p>sudo install -o root -g root -m 0755 kubectl /usr/bin/kubectl</p><p>kubectl version — client –short</p><h3>SSH tunnel testing on k8s Nodes</h3><p>ssh -i ~/.ssh/id_rsa k8s@master-01 docker version</p><p>ssh -i ~/.ssh/id_rsa k8s@master-02 docker version</p><p>ssh -i ~/.ssh/id_rsa k8s@master-03 docker version</p><p>ssh -i ~/.ssh/id_rsa k8s@worker-01 docker version</p><p>ssh -i ~/.ssh/id_rsa k8s@worker-02 docker version</p><h3>Building the RKE cluster</h3><p>rke config</p><pre>[rke@master01 ~]$ rke config <br>[+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]: /home/k8s/.ssh/id_rsa<br>[+] Number of Hosts [1]: 5<br>[+] SSH Address of host (1) [none]: master01<br>[+] SSH Port of host (1) [22]:<br>[+] SSH Private Key Path of host (master01) [none]: /home/k8s/.ssh/id_rsa<br>[+] SSH User of host (master01) [redhat]: k8s<br>[+] Is host (master01) a Control Plane host (y/n)? [y]:<br>[+] Is host (master01) a Worker host (y/n)? [n]:<br>[+] Is host (master01) an etcd host (y/n)? [n]: y<br>[+] Override Hostname of host (master01) [none]:<br>[+] Internal IP of host (master01) [none]:<br>[+] Docker socket path on host (master01) [/var/run/docker.sock]:<br>[+] SSH Address of host (2) [none]: master02<br>[+] SSH Port of host (2) [22]:<br>[+] SSH Private Key Path of host (master02) [none]: /home/k8s/.ssh/id_rsa<br>[+] SSH User of host (master02) [redhat]: k8s<br>[+] Is host (master02) a Control Plane host (y/n)? [y]: y<br>[+] Is host (master02) a Wok8sr host (y/n)? [n]: n<br>[+] Is host (master02) an etcd host (y/n)? [n]: y<br>[+] Override Hostname of host (master02) [none]:<br>[+] Internal IP of host (master02) [none]:<br>[+] Docker socket path on host (master02) [/var/run/docker.sock]:<br>[+] SSH Address of host (3) [none]: master03<br>[+] SSH Port of host (3) [22]:<br>[+] SSH Private Key Path of host (master03) [none]: /home/k8s/.ssh/id_rsa<br>[+] SSH User of host (master03) [redhat]: k8s<br>[+] Is host (master03) a Control Plane host (y/n)? [y]: y<br>[+] Is host (master03) a Wok8sr host (y/n)? [n]: n<br>[+] Is host (master03) an etcd host (y/n)? [n]: y<br>[+] Override Hostname of host (master03) [none]:<br>[+] Internal IP of host (master03) [none]:<br>[+] Docker socket path on host (master03) [/var/run/docker.sock]:<br>[+] SSH Address of host (4) [none]: worker01<br>[+] SSH Port of host (4) [22]:<br>[+] SSH Private Key Path of host (worker01) [none]: /home/k8s/.ssh/id_rsa<br>[+] SSH User of host (worker01) [redhat]: k8s<br>[+] Is host (worker01) a Control Plane host (y/n)? [y]: n<br>[+] Is host (worker01) a Wok8sr host (y/n)? [n]: y<br>[+] Is host (worker01) an etcd host (y/n)? [n]: n<br>[+] Override Hostname of host (worker01) [none]:<br>[+] Internal IP of host (worker01) [none]:<br>[+] Docker socket path on host (worker01) [/var/run/docker.sock]:<br>[+] SSH Address of host (5) [none]: worker02<br>[+] SSH Port of host (5) [22]:<br>[+] SSH Private Key Path of host (worker02) [none]: /home/k8s/.ssh/id_rsa<br>[+] SSH User of host (worker02) [redhat]: k8s<br>[+] Is host (worker02) a Control Plane host (y/n)? [y]: n<br>[+] Is host (worker02) a Wok8sr host (y/n)? [n]: y<br>[+] Is host (worker02) an etcd host (y/n)? [n]: n<br>[+] Override Hostname of host (worker02) [none]:<br>[+] Internal IP of host (worker02) [none]:<br>[+] Docker socket path on host (worker02) [/var/run/docker.sock]:<br>[+] Network Plugin Type (flannel, calico, weave, canal) [calico]:<br>[+] Authentication Strategy [x509]:<br>[+] Authorization Mode (rbac, none) [rbac]:<br>[+] Kubernetes Docker image [rancher/hyperkube:v1.17.5-rancher1]:<br>[+] Cluster domain [cluster.local]: <br>[+] Service Cluster IP Range [10.43.0.0/16]:<br>[+] Enable PodSecurityPolicy [n]:<br>[+] Cluster Network CIDR [10.42.0.0/16]:<br>[+] Cluster DNS Service IP [10.43.0.10]:<br>[+] Add addon manifest URLs or YAML files [no]:</pre><p>rke up</p><pre>[rke@master01 ~]$ rke up<br>INFO[0000] Running RKE version: v1.0.8<br>INFO[0000] Initiating Kubernetes cluster<br>INFO[0000] [dialer] Setup tunnel for host [master01]<br>INFO[0000] [dialer] Setup tunnel for host [master02]<br>INFO[0000] [dialer] Setup tunnel for host [master03]<br>INFO[0000] [dialer] Setup tunnel for host [worker01]<br>INFO[0000] [dialer] Setup tunnel for host [worker02]<br>...<br>INFO[0379] [ingress] Setting up nginx ingress controller<br>INFO[0379] [addons] Saving ConfigMap for addon rke-ingress-controller to Kubernetes<br>INFO[0379] [addons] Successfully saved ConfigMap for addon rke-ingress-controller to Kubernetes<br>INFO[0379] [addons] Executing deploy job rke-ingress-controller<br>INFO[0384] [ingress] ingress controller nginx deployed successfully<br>INFO[0384] [addons] Setting up user addons<br>INFO[0384] [addons] no user addons defined<br>INFO[0384] Finished building Kubernetes cluster successfully</pre><h3>Kube config setting up</h3><p>mkdir ~/.kube</p><p>cp kube_config_cluster.yml ~/.kube/config</p><h3>Kube config setting up</h3><p>kubectl labels nodes master-01.example.com node=master-01<br>kubectl labels nodes master-02.example.com node=master-02<br>kubectl labels nodes master-03.example.com node=master-03<br>kubectl labels nodes worker-01.example.com node=worker-01<br>kubectl labels nodes worker-02.example.com node=worker-02</p><p>kubectl get nodes</p><pre>NAME     STATUS ROLES                  AGE    VERSION<br>master01  Ready  controlplane,etcd.   5m34s   v1.17.5<br>master02  Ready  controlplane,etcd.   5m34s   v1.17.5<br>master03  Ready  controlplane,etcd.   5m34s   v1.17.5<br>worker01  Ready  worker               5m34s   v1.17.5<br>worker02  Ready  worker               5m34s   v1.17.5</pre><p><strong>Will be continue for K8s components in next series.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d246737ad2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Azure Application Gateway with Terraform]]></title>
            <link>https://sithuyeaung.medium.com/deploying-azure-application-gateway-with-terraform-f995df664f66?source=rss-6ed84764dc2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f995df664f66</guid>
            <dc:creator><![CDATA[Si Thu Ye Aung]]></dc:creator>
            <pubDate>Wed, 27 Sep 2023 08:20:29 GMT</pubDate>
            <atom:updated>2023-09-27T08:20:29.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlRVda9VJm91ZL-o4Q9b9w.png" /></figure><p>Azure Application Gateway is a powerful service in Microsoft Azure that helps you manage and optimize the traffic to your web applications. It provides features like load balancing, SSL termination, URL-based routing, and more. To make the deployment and management of Azure Application Gateway easier and more efficient, you can use Terraform, a popular Infrastructure as Code (IaC) tool. In this post, we’ll walk through the steps to deploy Azure Application Gateway using Terraform.</p><p>Prerequisites:</p><p>Before you begin, make sure you have the following prerequisites in place:</p><ol><li>An Azure subscription.</li><li>Terraform installed on your local machine.</li><li>Azure CLI installed on your local machine.</li><li>Basic knowledge of Terraform and Azure.</li></ol><p><strong>Step 1: Create an Azure Service Principal</strong></p><p>To interact with Azure resources from Terraform, you’ll need to create a service principal. Run the following Azure CLI command to create one:</p><pre>az ad sp create-for-rbac --name ServicePrincipalName --role Contributor --scopes /subscriptions/{your-subscription-id}Make a note of the appId, password, tenant, and subscription_id values, as you&#39;ll need them in the Terraform configuration.</pre><p>Make a note of the appId, password, tenant, and subscription_id values, as you&#39;ll need them in the Terraform configuration.</p><p><strong>Step 2: Set up Azure Storage account to store the terraform state file.</strong></p><pre>az group create --name myResourceGroup --location EastUS<br>az storage account create --name mystorageaccount --resource-group myResourceGroup --location EastUS --sku Standard_LRS</pre><p><strong>Step 3: Configure Terraform Variables</strong></p><p>Create a variables.tf file to store your Terraform variables. You can use variables to make your configuration more dynamic and reusable.</p><pre>variable &quot;group_name&quot; {<br>  description = &quot;A name to use for most resource group.&quot;<br>  default     = &quot;rg-appgw-001&quot;<br>}<br><br>variable &quot;location&quot; {<br>  description = &quot;The location where to deploy the app-gw.&quot;<br>  default     = &quot;Southeast Asia&quot;<br>}<br><br><br>variable &quot;vnet_name&quot; {<br>  description = &quot;A name to use for most vnet.&quot;<br>  default     = &quot;vent-appgw&quot;<br>}<br><br>variable &quot;subnet_name&quot; {<br>  description = &quot;A name to use for subnet name&quot;<br>  default     = &quot;snet-agw-external-001&quot;<br>}<br><br>variable &quot;pip_name&quot; {<br>  description = &quot;A name to use for public ip name&quot;<br>  default     = &quot;pip-awg-external-sea-001&quot;<br>}<br><br>variable &quot;appgw_name&quot; {<br>  description = &quot;A name to use for application gateway name&quot;<br>  default     = &quot;appgw-external-001&quot;<br>}<br><br>variable &quot;backend_address_pool_name&quot; {<br>    default = &quot;nonprod-k8s-istio-lb-backend-pool&quot;<br>}<br><br>variable &quot;address_space&quot; {<br>    description = &quot;A subnet to use for address space&quot;<br>    default = [&quot;10.0.0.0/16&quot;]<br>}<br><br>variable &quot;subnet_name_01&quot; {<br>    description = &quot;A subnet to use for subnet name&quot;<br>    default = [&quot;10.0.0.1/24&quot;]<br>}<br><br>variable &quot;subnet_name_02&quot; {<br>    description = &quot;A subnet to use for subnet name&quot;<br>    default = [&quot;10.0.0.2/24&quot;]<br>}<br><br>variable &quot;subnet_01&quot; {<br>    description = &quot;A subnet to use for address space&quot;<br>    default = [&quot;10.0.0.1/24&quot;]<br>}<br><br>variable &quot;subnet_02&quot; {<br>    description = &quot;A subnet to use for address space&quot;<br>    default = [&quot;10.0.0.2/24&quot;]<br>}<br><br>variable &quot;frontend_http_port_name&quot; {<br>    default = &quot;http&quot;<br>}<br><br>variable &quot;frontend_https_port_name&quot; {<br>    default = &quot;https&quot;<br>}<br><br>variable &quot;frontend_public&quot; {<br>    default = &quot;appGwPublicFrontendIp&quot;<br>}<br><br>variable &quot;frontend_private&quot; {<br>    default = &quot;appGwPrivateFrontendIp&quot;<br>}<br><br>variable &quot;backend_pool_name&quot; {<br>    default = &quot;myBackenddPort&quot;<br>}<br><br><br>variable &quot;http_setting_name&quot; {<br>    default = &quot;myHTTPsetting&quot;<br>}<br><br>variable &quot;listener_name&quot; {<br>    default = &quot;myListener&quot;<br>}<br><br>variable &quot;request_routing_rule_name&quot; {<br>    default = &quot;myRoutingRule&quot;<br>}</pre><p><strong>Step 4: Configure Terraform for Remote State Storage.</strong></p><p>In your Terraform configuration ( versions.tf ), configure remote state storage using the Azure Storage Account you created:</p><p>This file will contain your Terraform configuration, backend state file store to Azure Storage Account and Service Account.</p><pre>terraform {<br>  required_providers {<br>    azurerm = {<br>      source = &quot;hashicorp/azurerm&quot;<br>      version = &quot;3.53.0&quot;<br>    }<br>  }<br><br>}<br><br>terraform {<br>  backend &quot;azurerm&quot; {<br>    resource_group_name  = &quot;&lt;your-resource-group-name&gt;&quot;<br>    storage_account_name = &quot;&lt;your-storage-account-name&gt;&quot;<br>    container_name       = &quot;&lt;your-storage-container-name&gt;&quot;<br>    key                  = &quot;&lt;your-storage-account-key-name&gt;&quot;<br>    sas_token            = &quot;&lt;your-sas-key-value&gt;&quot;<br>  }<br>}<br><br>provider &quot;azurerm&quot; {<br>  skip_provider_registration = &quot;true&quot;<br>  features {}<br>  subscription_id   = &quot;&lt;your-subscription-id&gt;&quot;<br>  tenant_id         = &quot;&lt;your-tenant-id&gt;&quot;<br>  client_id         = &quot;&lt;your-client-id&gt;&quot;<br>  client_secret     = &quot;&lt;your-secret-id&gt;&quot;<br>}</pre><p><strong>Step 5: Set up Terraform Configuration</strong></p><p>Create a new directory for your Terraform project and create a (main.tf) file inside it. This file will contain your Terraform configuration for the Azure Application Gateway.</p><pre>#create the resource group<br>resource &quot;azurerm_resource_group&quot; &quot;default&quot; {<br>  name     = var.group_name<br>  location = var.location<br>}<br><br><br>#create the Virtual Network, Subnet and associated with NSG.<br>resource &quot;azurerm_virtual_network&quot; &quot;defualt&quot; {<br>  name                = var.vnet_name<br>  location            = var.location<br>  resource_group_name = var.group_name<br>  address_space       = [var.address_space]<br>  <br><br>  subnet {<br>    name           = var.subnet_name_01<br>    address_prefix = &quot;var.subnet_01&quot;<br>  }<br><br>  subnet {<br>    name           = var.subnet_name_02<br>    address_prefix = &quot;var.subnet_02&quot;<br>  }<br><br>  tags = {<br>    environment = &quot;Non-prod&quot;<br>  }<br>} <br><br>#create the public ip address<br>resource &quot;azurerm_public_ip&quot; &quot;default&quot; {<br>  resource_group_name = var.group_name<br>  location            = var.location<br>  allocation_method   = &quot;Static&quot;<br>  sku                 = &quot;Standard&quot;<br>}<br><br>#create the app gw-02&quot;<br>resource &quot;azurerm_application_gateway&quot; &quot;default&quot; {<br>  name                = <br>  resource_group_name = var.group_name<br>  location            = var.location<br><br>  sku {<br>    name     = &quot;Standard_v2&quot;<br>    tier     = &quot;Standard_v2&quot;<br>    capacity = 1<br>  }<br>  gateway_ip_configuration {<br>    name      = &quot;appgw-gateway-ip-configuration&quot;<br>    subnet_id = &quot;var.subnet_name_01&quot;<br>  }<br><br> frontend_port {<br>    name = var.frontend_http_port_name<br>    port = 80<br>  }<br><br> frontend_port {<br>    name = var.frontend_https_port_name<br>    port = 443<br>  }<br><br></pre><p><strong>Step 6: Initialize and Apply the Configuration</strong></p><p>Run the following Terraform commands to initialize your configuration and apply it:</p><pre>terraform init<br>terraform apply</pre><p><strong>Conclusion:</strong></p><p>In this post, we’ve demonstrated how to deploy an Azure Application Gateway using Terraform. By defining your infrastructure as code, you can easily version, share, and automate the deployment of your Azure resources. This approach ensures consistency and repeatability in your Azure deployments, making it easier to manage and maintain your infrastructure.</p><p><strong>Remember to clean up your resources when you’re done by running:</strong></p><pre>terraform destroy</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f995df664f66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy and config Minio Server on RHEL]]></title>
            <link>https://sithuyeaung.medium.com/how-to-deploy-and-config-minio-server-on-rhel-c98eba40ff5a?source=rss-6ed84764dc2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c98eba40ff5a</guid>
            <category><![CDATA[minio]]></category>
            <dc:creator><![CDATA[Si Thu Ye Aung]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 09:41:30 GMT</pubDate>
            <atom:updated>2023-04-28T09:41:30.491Z</atom:updated>
            <content:encoded><![CDATA[<p>Minio is an open source object storage server that enables developers to store and manage unstructured data such as photos, videos, and documents. It is designed to be compatible with the Amazon S3 API, making it easy for developers to use Minio as a drop-in replacement for Amazon S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20D_FFwz_HagcmdlKgMmDQ.jpeg" /></figure><p>System OS Requirement and root privilege account.</p><ol><li>Redhat 8.5</li><li>Root user access.</li></ol><h3>Minio server installation</h3><p><strong>Firewall Port allowed following list.</strong></p><p>sudo firewall-cmd — permanent — add-port={9000,9001}/tcp</p><p><strong>User add for minio .</strong></p><p>sudo useradd -s /sbin/nologin -d /data minio</p><p><strong>Download the Minio packages.</strong></p><p>wget -O /usr/local/bin/minio <a href="https://dl.min.io/server/minio/release/linux-amd64/minio">https://dl.min.io/server/minio/release/linux-amd64/minio</a></p><p><strong>Granted the minio packages and directory to user minio access permission</strong></p><p>sudo install -o root -g root -m 0755 minio /usr/local/bin/minio</p><p>sudo chown -R minio:minio /data/</p><p>sudo groupadd -r minio</p><p>sudo useradd -M -r -s /sbin/nologin -g minio -d /data minio</p><p><strong>Get the mino Version</strong></p><p>minio –version</p><p><strong>To install the SSL certificate</strong></p><p>sudo mkdir /etc/minio/ssl</p><p>sudo mkdir /etc/minio/ssl</p><p>cp /home/srvadmkube/cgcc-com-kh/* /etc/minio/ssl/</p><p><strong>Create the minio config as per following</strong></p><p>cat &lt;&lt;’EOF’ | sudo tee /etc/minio/minio.conf</p><p># Minio local volumes.</p><p>MINIO_VOLUMES=”/data”</p><p># Minio cli options.</p><p>MINIO_OPTS=” — address :9000 — console-address :9001 — certs-dir /etc/minio/ssl”</p><p># Access Key of the server.</p><p>MINIO_ROOT_USER=”minioadmin”</p><p># Secret key of the server.</p><p>MINIO_ROOT_PASSWORD=”minioadmin”</p><p># Minio server region</p><p>MINIO_SITE_REGION=”eu-west-1&quot;</p><p># Minio server URL</p><p>MINIO_SERVER_URL=<a href="https://dev-minio.cgcc.com.kh:9000/">https://dev-minio.example.com:9000</a></p><p>EOF</p><h3>Config the minio’s systemctl service.</h3><p>cat &lt;&lt;’EOF’ | sudo tee /usr/lib/systemd/system/minio.service</p><p>[Unit]</p><p>Description=Minio</p><p>Wants=network-online.target</p><p>After=network-online.target</p><p>[Service]</p><p>WorkingDirectory=/usr/local</p><p>User=minio</p><p>Group=minio</p><p>ProtectProc=invisible</p><p>EnvironmentFile=/etc/minio/minio.conf</p><p>ExecStartPre=/bin/bash -c “if [ -z \”${MINIO_VOLUMES}\” ]; then echo \”Variable MINIO_VOLUMES not set in /etc/minio/minio.conf\”; exit 1; fi”</p><p>ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES</p><p># Let systemd restart this service always</p><p>Restart=always</p><p># Specifies the maximum file descriptor number that can be opened by this process</p><p>LimitNOFILE=65536</p><p># Specifies the maximum number of threads this process can create</p><p>TasksMax=infinity</p><p># Disable timeout logic and wait until process is stopped</p><p>TimeoutStopSec=infinity</p><p>SendSIGKILL=no</p><p>[Install]</p><p>WantedBy=multi-user.target</p><p>EOF</p><p><strong>Time to enable the minio service</strong></p><p>sudo systemctl enable minio –now</p><p>sudo systmectl start minio</p><p><strong>Login Test for Minio portal.</strong></p><p>Login URL : <a href="https://dev-minio.cgcc.com.kh:9000/">https://dev-minio.example.com:9000</a></p><p>Username: minioadmin</p><p>Password: minioadmin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*x8UMUdN6SauzI-rS58mJvg.png" /></figure><p><strong>Time to create the S3 Backup</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*JLNGvDlqMhOPw9Tio5y4Ow.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c98eba40ff5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy an Azure Firewall Premium using Terraform]]></title>
            <link>https://sithuyeaung.medium.com/how-to-deploy-an-azure-firewall-premium-using-terraform-9c5135046421?source=rss-6ed84764dc2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c5135046421</guid>
            <dc:creator><![CDATA[Si Thu Ye Aung]]></dc:creator>
            <pubDate>Thu, 27 Apr 2023 10:34:42 GMT</pubDate>
            <atom:updated>2023-04-27T10:40:13.864Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure Firewall is a cloud-based network security service that provides firewall capabilities to protect Azure Virtual Network resources. It is a fully managed service that allows you to create, enforce, and log application and network connectivity policies across multiple subscriptions and virtual networks. With Azure Firewall, you can centrally manage your network security policies and provide secure access to your applications and data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*igYez3msB9uSqewSuKgaUQ.png" /></figure><p>In this article, we will learn how to deploy an <strong>Azure Firewall</strong> (<strong>Premium) and Azure Firewall Policy (Premium) </strong>using <strong>Terraform</strong>.</p><p>Prerequisite lists are following us.</p><ol><li>Pre-installed Terrafrom on your local machine.</li><li>azure service principal account. ( contributor role in your subscription)</li></ol><h3>1. Create the terraform provided .</h3><p>We required to create the <strong>Terrafrom</strong> file called <strong>provider.tf </strong>and add the following code:</p><pre>terraform {<br>  required_providers {<br>    azurerm = {<br>      source = &quot;hashicorp/azurerm&quot;<br>      version = &quot;3.53.0&quot;<br>    }<br>}<br>provider &quot;azurerm&quot; {<br>  skip_provider_registration = &quot;true&quot;<br>  features {}<br>  subscription_id   = &quot;your_subscription_id&quot;<br>  tenant_id         = &quot;your_tenant_id&quot;<br>  client_id         = &quot;client_id&quot;<br>  client_secret     = &quot;client_secret&quot;<br>}</pre><h3>2. Creating the necessary resources in Azure.</h3><p>We required to create two <strong>Terrafrom</strong> file called <strong>main.tf and variables.tf. </strong>And then<strong> </strong>add the following code:</p><p><strong>First, we add the code to variables.tf file</strong>.</p><pre>variable &quot;group_name&quot; {<br>  description = &quot;A name to use for most resource group.&quot;<br>  default     = &quot;rg-afw-nonprod-001&quot; <br>}<br><br>variable &quot;vnet_name&quot; {<br>  description = &quot;A name to use for most resource group.&quot;<br>  default     = &quot;vnet-afw-nonprod-001&quot;<br>}<br><br>variable &quot;location&quot; {<br>  description = &quot;The location where to deploy the firewall.&quot;<br>  default     = &quot;Southeast Asia&quot;<br>}<br><br>variable &quot;address_space&quot; {<br>  description = &quot;A list of network addresses.&quot;<br>  default     = [&quot;10.0.0.0/16&quot;]<br>}<br><br>variable &quot;subnet_name&quot; {<br>  description = &quot;A name to use for subnet name&quot;<br>  default     = &quot;AzureFirewallSubnet&quot;<br>}<br><br>variable &quot;address_prefix&quot; {<br>  description = &quot;A list of addresse prefixes.&quot;<br>  default     = [&quot;10.0.1.0/24&quot;]<br>}<br><br>variable &quot;pip_name&quot; {<br>  description = &quot;A name to use for public ip name&quot;<br>  default     = &quot;pip-afw-nonprod-001&quot;<br>}<br><br>variable &quot;fw_name&quot; {<br>  description = &quot;A lame to use for firewall name&quot;<br>  default     = &quot;fw-afw-nonprod-001&quot;<br>}<br><br>variable &quot;fwp_name&quot; {<br>  description = &quot;A name to use for firewall policy name&quot;<br>  default     = &quot;fw-afwp-nonprod-001&quot;<br>}</pre><p><strong>Second, we add the code to main.tf file.</strong></p><p><strong>1.1 Create the resource group as per following block.</strong></p><pre>resource &quot;azurerm_resource_group&quot; &quot;default&quot; {<br>  name     = var.group_name<br>  location = var.location<br>}</pre><p><strong>1.2 Create the VNET, Sub-net and address-prefix as per following block.</strong></p><pre>variable &quot;address_space&quot; {<br>  description = &quot;A list of network addresses.&quot;<br>  default     = [&quot;10.0.0.0/16&quot;]<br>}<br><br>variable &quot;subnet_name&quot; {<br>  description = &quot;A name to use for subnet name&quot;<br>  default     = &quot;AzureFirewallSubnet&quot;<br>}<br><br>variable &quot;address_prefix&quot; {<br>  description = &quot;A list of addresse prefixes.&quot;<br>  default     = [&quot;10.0.1.0/24&quot;]<br>}</pre><p><strong>1.3. Create the public IP address as per following block.</strong></p><pre>resource &quot;azurerm_public_ip&quot; &quot;default&quot; {<br>  name                = var.pip_name<br>  location            = azurerm_resource_group.default.location<br>  resource_group_name = azurerm_resource_group.default.name<br>  allocation_method   = &quot;Static&quot;<br>  sku                 = &quot;Standard&quot;<br>}</pre><p><strong><em>Note:</em></strong><em> there is only support “</em><strong><em>Standard</em></strong><em>” SKU.</em></p><p><strong>1.4. Create the Azure Firewall (Premium SKU) as per following block.</strong></p><pre>resource &quot;azurerm_firewall&quot; &quot;default&quot; {<br>  name                = var.fw_name<br>  location            = azurerm_resource_group.default.location<br>  resource_group_name = azurerm_resource_group.default.name<br>  sku_name            = &quot;AZFW_VNet&quot;<br>  sku_tier            = &quot;Premium&quot;<br>  firewall_policy_id  = azurerm_firewall_policy.default.id<br>  ip_configuration {<br>    name                 = &quot;configuration&quot;<br>    subnet_id            = azurerm_subnet.default.id<br>    public_ip_address_id = azurerm_public_ip.default.id<br>  }<br>}</pre><p><strong>Let’s start to create the Azure Firewall Policy (Premium SKU) and associate with Azure Firewall.</strong></p><p>3. <strong>Create Terrafrom file called afwp.tf as per following block.</strong></p><p><strong>We created Azure Firewall Policy (Premium) and enabled following feature.</strong></p><ol><li><strong>Threat intelligence.</strong></li><li><strong>IDS/IPS.</strong></li><li><strong>TLS Inspection.</strong></li><li><strong>Logs Analytics.</strong></li><li><strong>SKU (Premium)</strong></li></ol><pre>resource &quot;azurerm_firewall_policy&quot; &quot;default&quot; {<br>  name                      = var.fwp_name<br>  resource_group_name       = azurerm_resource_group.default.name<br>  location                  = azurerm_resource_group.default.location<br>  sku                       = &quot;Premium&quot;<br>  threat_intelligence_mode  = &quot;Alert&quot;<br>  #threat_intelligence_allowlist {<br>  #  fqdns                   = [&quot;*.microsoft.com&quot;]<br>  #  ip_addresses            = [&quot;8.8.8.8&quot;]<br>  #}<br>  intrusion_detection {<br>    mode                     = &quot;Alert&quot;<br>  }<br>  identity {<br>    identity_ids             = [<br>      &quot;/subscriptions/ec27316e-9920-1236-82ed-1674b5a40e9ef/resourceGroups/rg-afw-nonprod-001/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fw-cert-id-Kzk2-kdfaid&quot;<br>      ]<br>    type                     = &quot;UserAssigned&quot;<br>  }<br>  tls_certificate {<br>    key_vault_secret_id     = &quot;https://fw-cert-kv-ulnijfromwxid.vault.azure.net/secrets/fw-cert-ULNIJfROMwxid/f6d557e0337d472k06fk9391&quot;<br>    name                    = &quot;fw-cert-id-Kzk2-kdfaid&quot;<br>  }<br>  insights {<br>    default_log_analytics_workspace_id = &quot;/subscriptions/ec27316e-9920-1236-82ed-1674b5a40e9ef/resourceGroups/rg-log-001/providers/Microsoft.OperationalInsights/workspaces/log-nonprod-fw-001 <br>    enabled                            = true <br>    retention_in_days                  = 30 <br>    log_analytics_workspace {<br>    firewall_location = &quot;southeastasia&quot; <br>    id                = &quot;/subscriptions/ec27316e-9920-1236-82ed-1674b5a40e9eff/resourceGroups/rg-log-shared-sea-001/providers/Microsoft.OperationalInsights/workspaces/log-nonprod-fw-001&quot; <br>    }<br>  }<br>}<br></pre><p><strong>Now, All are ready ( VNet, Subnet, Public IP address, Firewall , Firewall policy and Logs ) .</strong></p><p><strong>It is time to create Firewall rules.</strong></p><p><strong>First thing First create the D-NAT Rules. As per following block.</strong></p><pre>resource &quot;azurerm_firewall_policy_rule_collection_group&quot; &quot;dnat&quot; {<br>  name               = &quot;FW-DNAT-GROUP&quot;<br>  firewall_policy_id = azurerm_firewall_policy.default.id<br>  priority           = 300<br><br>  nat_rule_collection {<br>    name     = &quot;Allow_HTTPS&quot;<br>    priority = 200<br>    action   = &quot;Dnat&quot;<br>    rule {<br>      name                = &quot;Allow_HTTPS&quot;<br>      protocols           = [&quot;TCP&quot;]<br>      source_addresses    = [&quot;*&quot;]<br>      destination_address = azurerm_public_ip.default.ip_address //module.firewall_publicip.public_ip[0].ip_address<br>      destination_ports   = [&quot;443&quot;]<br>      translated_address  = &quot;10.71.134.4&quot;<br>      translated_port     = &quot;443&quot;<br>    }<br>  }<br>  nat_rule_collection {<br>    name     = &quot;Allow_HTTP&quot;<br>    priority = 205<br>    action   = &quot;Dnat&quot;<br>    rule {<br>      name                = &quot;Allow_HTTP&quot;<br>      protocols           = [&quot;TCP&quot;,&quot;UDP&quot;]<br>      source_addresses    = [&quot;*&quot;]<br>      destination_address = azurerm_public_ip.default.ip_address //module.firewall_publicip.public_ip[0].ip_address<br>      destination_ports   = [&quot;80&quot;]<br>      translated_address  = &quot;10.71.134.5&quot;<br>      translated_port     = &quot;80&quot;<br>    }<br>  }<br>  nat_rule_collection {<br>    name     = &quot;Allow_RDP&quot;<br>    priority = 210<br>    action   = &quot;Dnat&quot;<br>    rule {<br>      name                = &quot;Allow_RDP&quot;<br>      protocols           = [&quot;TCP&quot;,&quot;UDP&quot;]<br>      source_addresses    = [&quot;*&quot;]<br>      destination_address = azurerm_public_ip.default.ip_address //module.firewall_publicip.public_ip[0].ip_address<br>      destination_ports   = [&quot;3389&quot;]<br>      translated_address  = &quot;10.0.3.4&quot;<br>      translated_port     = &quot;3389&quot;<br>    }<br>  }<br>}</pre><p>Here is the Ref URL: <a href="https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall_policy_rule_collection_group">https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall_policy_rule_collection_group</a></p><p>Next , Create a Application Rule group and Rules as per following.</p><pre>resource &quot;azurerm_firewall_policy_rule_collection_group&quot; &quot;app&quot; {<br>  name               = &quot;FW-APP-GROUP&quot;<br>  firewall_policy_id = azurerm_firewall_policy.default.id<br>  priority           = 300<br>  application_rule_collection {<br>    name     = &quot;allow_whitelist&quot;<br>    priority = 200<br>    action   = &quot;Allow&quot;<br>    rule {<br>      name = &quot;allow_whitelist&quot;<br>      protocols {<br>        type = &quot;Http&quot;<br>        port = 80<br>      }<br>      protocols {<br>        type = &quot;Https&quot;<br>        port = 443<br>      }<br>      source_addresses  = [&quot;10.0.2.4&quot;]<br>      terminate_tls     = &quot;false&quot;<br>      destination_fqdns = [&quot;*.microsoft.com&quot;]<br>    }<br>  }<br>application_rule_collection {<br>    name     = &quot;allow_google&quot;<br>    priority = 205<br>    action   = &quot;Allow&quot;<br>    rule {<br>      name = &quot;allow_google&quot;<br>      protocols {<br>        type = &quot;Http&quot;<br>        port = 80<br>      }<br>      protocols {<br>        type = &quot;Https&quot;<br>        port = 443<br>      }<br>      source_addresses  = [&quot;10.0.2.4&quot;]<br>      terminate_tls     = &quot;false&quot;<br>      destination_fqdns = [&quot;*.google.com&quot;]<br>    }<br>  }<br>}</pre><p>Finally, we create the Network rule group and Rules.</p><pre>resource &quot;azurerm_firewall_policy_rule_collection_group&quot; &quot;net&quot; {<br>  name               = &quot;FW-NET-GROUP&quot;<br>  firewall_policy_id = azurerm_firewall_policy.default.id<br>  priority           = 300<br>  network_rule_collection {<br>    name     = &quot;allow_rdp_from_office&quot;<br>    priority = 200<br>    action   = &quot;Allow&quot;<br>    rule {<br>      name                  = &quot;allow_rdp_from_office&quot;<br>      protocols             = [&quot;TCP&quot;, &quot;UDP&quot;]<br>      source_addresses      = [&quot;*&quot;]<br>      destination_addresses = [&quot;10.0.2.4&quot;]<br>      destination_ports     = [&quot;80&quot;, &quot;443&quot;, &quot;3389&quot;]<br>    }<br>  }<br><br>  network_rule_collection {<br>    name     = &quot;allow_icmp&quot;<br>    priority = 205<br>    action   = &quot;Allow&quot;<br>    rule {<br>      name                  = &quot;allow_icmp&quot;<br>      protocols             = [&quot;TCP&quot;, &quot;UDP&quot;]<br>      source_addresses      = [&quot;*&quot;]<br>      destination_addresses = [&quot;10.0.2.4&quot;]<br>      destination_ports     = [&quot;*&quot;]<br>    }<br>  }<br><br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c5135046421" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>