<?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 harsh on Medium]]></title>
        <description><![CDATA[Stories by harsh on Medium]]></description>
        <link>https://medium.com/@goenkaharsh27?source=rss-a4aec0dc2016------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SAHiNcjHzuacfHT-</url>
            <title>Stories by harsh on Medium</title>
            <link>https://medium.com/@goenkaharsh27?source=rss-a4aec0dc2016------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:44:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@goenkaharsh27/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[Deploying Istio Service Mesh on Amazon EKS: A Practical Guide]]></title>
            <link>https://medium.com/geekculture/deploying-istio-service-mesh-on-amazon-eks-a-practical-guide-8778f9c5f407?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/8778f9c5f407</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Thu, 15 Jan 2026 16:26:09 GMT</pubDate>
            <atom:updated>2026-01-15T16:26:09.219Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QgxZG07KkaJBb3WT.jpeg" /></figure><p>Microservices make it easier to scale and evolve applications — but they also introduce a new challenges: service-to-service security, visibility, traffic shaping, and reliability.</p><p>That’s where <strong>Istio</strong>, one of the most widely adopted service meshes, comes in.</p><p>In this guide, you’ll learn how to deploy Istio on <strong>Amazon Elastic Kubernetes Service (EKS)</strong>, enable observability, secure services with mTLS, and perform traffic shifting — all throughhands-on steps.</p><h4><strong>What Istio Does (and Why It Matters)</strong></h4><p>Istio sits between your services and manages communication automatically using lightweight <strong>Envoy sidecars</strong>.</p><p>With Istio, you get:</p><ul><li>Intelligent traffic control</li><li>Mutual TLS and zero-trust security</li><li>Built-in telemetry and tracing</li><li>Resilience, retries, and circuit-breaking</li></ul><p>You gain all of this <strong>without changing application code</strong>.</p><h3>Prerequisites</h3><p>You’ll need:</p><ul><li>AWS account</li><li>awscli</li><li>kubectl</li><li>eksctl</li><li>istioctl</li><li>(Optional) helm</li></ul><p><strong>Authentication: </strong><br>In this guide, we use AWS CloudShell. Ensure the required IAM roles are assigned. If you are using CloudShell, you can skip the step below.</p><pre>aws configure</pre><h4><strong>Step 1: Create an EKS Cluster</strong></h4><pre>eksctl create cluster \<br>  --name istio-eks-demo \<br>  --region ap-south-1 \<br>  --nodes 3 \<br>  --node-type t3.medium</pre><p>Run the following commands if eksctl is not installed in AWS CloudShell:</p><pre>curl -sLO &quot;https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz&quot;<br>tar -xzf eksctl_Linux_amd64.tar.gz<br>sudo mv eksctl /usr/local/bin/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWV6ni-2Btsuh2fXEwBYYw.png" /></figure><p>Verify:</p><pre>kubectl get nodes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RExeEPRUXVgTSpQsqyFXpQ.png" /></figure><h4><strong>Step 2: Install Istio</strong></h4><p>Download and install the latest Istio release:</p><pre>curl -L https://istio.io/downloadIstio | sh -<br>cd istio-*<br>export PATH=$PWD/bin:$PATH</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hibt_xgZukdn0W-PJdbXXA.png" /></figure><p>Confirm:</p><pre>istioctl version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECvRiOSx6HQ3eEW91uLVDA.png" /></figure><h4><strong>Step 3: Deploy the Istio Control Plane</strong></h4><p>Use the demo profile (great for learning):</p><pre>istioctl install --set profile=demo -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4cedrygzQ2M6HctESSaciA.png" /></figure><p>Enable automatic sidecar injection:</p><pre>kubectl label namespace default istio-injection=enabled</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yizhtgwAaPH1102FuytlhA.png" /></figure><p>Check components:</p><pre>kubectl get pods -n istio-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olY3WThL543IbNaZTvX6MQ.png" /></figure><p>You should see istiod, gateways, and supporting components starting up.</p><h4><strong>Step 4: Deploy a Sample Application</strong></h4><p>Deploy Istio’s sample Bookinfo app (files will be present in the samples folder inside istio directory):</p><pre>kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yxm7kTYCjUOaEnzqFBRsRw.png" /></figure><p>Expose it through an Istio Gateway:</p><pre>kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ckMK4qh8RunKJ8KWFr_fXA.png" /></figure><p>run below command to get the external url</p><pre>kubectl get svc istio-ingressgateway -n istio-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHOCEB7o3QXaDG62TreMMw.png" /></figure><p>Open in your browser:</p><pre>http://&lt;EXTERNAL-IP&gt;/productpage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eg9d5gzv_xo2igKRHduIiA.png" /></figure><h4><strong>Step 5: Turn On Observability</strong></h4><p>Istio integrates with multiple tools to provide end-to-end observability:</p><ul><li><strong>Kiali</strong> — Visualizes service-to-service traffic, mTLS status, and helps debug mesh configurations.</li><li><strong>Prometheus</strong> — Collects metrics such as request count, latency, and error rates from Envoy sidecars.</li><li><strong>Grafana</strong> — Displays Prometheus metrics using prebuilt dashboards for performance and traffic analysis.</li><li><strong>Jaeger</strong> — Provides distributed tracing to track requests across multiple services and identify bottlenecks.</li></ul><p>Install dashboards:</p><pre>kubectl apply -f samples/addons</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gx8wyFinIzf8Y8oWOaiSmA.png" /></figure><p>Expose Kiali by updating the Kiali service and changing the service type from ClusterIP to LoadBalancer:</p><pre>kubectl edit svc/kiali -n istio-system</pre><p>Now run below command to check kiali service and get external IP and browse:</p><pre>kubectl get svc -n istio-system<br>http://&lt;EXTERNAL-IP&gt;:20001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-bDaN7u5m-UaSkkjt7YDuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_glGq34-lBZrkDpqoCN2cw.png" /></figure><p>You now have real-time service graphs and metrics.</p><h4><strong>Step 6: Secure Traffic with mTLS</strong></h4><p>Enable strict mutual TLS:</p><pre>kubectl apply -n default -f - &lt;&lt;EOF<br>apiVersion: security.istio.io/v1beta1<br>kind: PeerAuthentication<br>metadata:<br>  name: default<br>spec:<br>  mtls:<br>    mode: STRICT<br>EOF</pre><p>Service-to-service traffic is now encrypted automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07aORtYj4jAR7MCr0j3FcA.png" /></figure><p><strong>Note:</strong> The demo profile and LoadBalancer services can incur AWS costs. Remember to delete resources after testing</p><h4><strong>Cleanup</strong></h4><pre>eksctl delete cluster --name istio-eks-demo</pre><h3><strong>Production Tips</strong></h3><p>When running Istio on EKS in real environments:</p><ul><li>Set CPU/memory limits for sidecars</li><li>Prefer managed node groups, and consider Fargate for selective, stateless workloads</li><li>Use revision-based Istio upgrades</li><li>Enforce namespace-specific security policies</li><li>Monitor control plane health</li><li>Practice failure drills regularly</li></ul><h3><strong>Final Thoughts</strong></h3><p>Istio adds a powerful, programmable layer on top of Kubernetes — bringing consistent security, deeper insights, and safer deployments.</p><p>Once comfortable with these basics, try:</p><ul><li>Automated installs using Helm or Terraform</li><li>Integrating CI/CD pipelines</li><li>Fine-grained security policies</li><li>Advanced traffic strategies</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8778f9c5f407" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/deploying-istio-service-mesh-on-amazon-eks-a-practical-guide-8778f9c5f407">Deploying Istio Service Mesh on Amazon EKS: A Practical Guide</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Transit Gateway Inter-Region Peering Explained]]></title>
            <link>https://aws.plainenglish.io/aws-transit-gateway-inter-region-peering-explained-6fcae7f1a4cc?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fcae7f1a4cc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Tue, 13 Jan 2026 08:33:09 GMT</pubDate>
            <atom:updated>2026-02-03T06:19:33.275Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*lYod4PmiBSZ-_tg8.png" /></figure><p>Growing across AWS Regions sounds simple , until your network turns into a patchwork of tunnels, peering links, and manual routes. Applications need to talk to each other <strong>securely, privately, and reliably</strong>, no matter where they live.</p><p>That’s exactly what <strong>AWS Transit Gateway Inter-Region Peering</strong> is designed for.</p><p>In this guide, we’ll cover what it is, how it works, when to use it, and the pitfalls to avoid , with diagrams to make it click.</p><h3>Quick refresher: What is AWS Transit Gateway?</h3><p>Think of <strong>AWS Transit Gateway (TGW)</strong> as a central switchboard for your network. Instead of building dozens of VPC-to-VPC connections, you connect everything to the hub , and let the hub handle routing.</p><h4><strong>Without TGW (too many connections)</strong></h4><pre>VPC A ---- VPC B<br>   \       /<br>    \     /<br>     VPC C</pre><h4>With TGW (hub and spoke , much simpler)</h4><pre>VPC A ----\<br>           \<br>            Transit Gateway<br>           /<br>VPC B ----/</pre><h4>What is Inter-Region Transit Gateway Peering?</h4><p><strong>Inter-Region TGW Peering</strong> links Transit Gateways across AWS Regions using AWS private backbone network , not the internet.</p><h4><strong>High-level architecture</strong></h4><p>VPCs (Region 1) → TGW (us-east-1) === Peering === TGW (eu-west-1) ← VPCs (Region 2)</p><p>✔ Traffic stays private<br> ✔ Encrypted end-to-end by default<br> ✔ Highly available<br> ✔ Works across AWS accounts</p><p>This is ideal for:</p><ul><li>Multi-Region apps</li><li>Disaster recovery and replication</li><li>Shared services (DNS, logging, auth)</li><li>Latency-sensitive internal traffic</li></ul><h3>How traffic actually flows</h3><ul><li>A Packet leaves a subnet in Region-A</li><li>Route table sends it to TGW-A</li><li>TGW-A forwards it through the peering link</li><li>TGW-B receives and forwards to the destination VPC</li><li>Response returns over the same path</li></ul><pre>VPC A1 --&gt; TGW-A === TGW-B --&gt; VPC B1</pre><p>No internet. No VPN. Predictable performance.</p><h4>How to set up Inter-Region TGW Peering (high-level)</h4><h4>Create a Transit Gateway in Region A (ap-south-1)</h4><p>Go to <strong>VPC console → Transit Gateways → Create Transit Gateway</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9yCkCd4lu2dEOp-OBTSRA.png" /></figure><ul><li>Give it a name (example: tgw-region-a) and adjust other options as needed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W1vG5YeC5ksWEkZOiK3iYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUMkIaD2JdJ7sLxTnAaViw.png" /></figure><p>Set options (defaults are usually fine):</p><ul><li>DNS support: <strong>Enable</strong></li><li>Auto-accept attachments: optional</li></ul><p>Click <strong>Create</strong></p><p>Repeat the same steps in Region B (us-east-1), Transit Gateways are regional resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZiJ-rHj7x8kIlD9M1CpfQ.png" /></figure><p>Attach VPCs to TGW in Region A</p><p>Open <strong>Transit Gateway Attachments → Create attachment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuBYoV3lUY4q9sxUnHEMLA.png" /></figure><p>Choose:</p><ul><li>Transit Gateway: tgw-1</li><li>Attachment type: <strong>VPC</strong></li><li>Select your VPC and subnets (one per AZ) and configure other options as required.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qw8Xc_f-SS8mxekUGilT0Q.png" /></figure><p>Create the attachment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u05guGv8Y1A_MWgLmI9gQg.png" /></figure><p>Do the same in Region B for its VPCs and TGW (tgw-2).</p><p>Create the Inter-Region TGW Peering</p><p>From <strong>either region (In our case ap-south-1)</strong>:</p><p>Go to Open <strong>Transit Gateway Attachments → Create attachment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuBYoV3lUY4q9sxUnHEMLA.png" /></figure><p>Select:</p><ul><li><strong>Requester TGW ID</strong>: tgw-1</li><li><strong>Attachment type: </strong>Peering Connection</li><li><strong>Target region</strong>: Region B</li><li><strong>Target TGW ID</strong>: select tgw-2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wweb2cV_0k_t_oRdTfsm7g.png" /></figure><p>Click <strong>Create</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4iJ6F2WduzFKDLLyPJv_jw.png" /></figure><p>A peering connection will show as <strong>pending-acceptance</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvvgn4bhBR2bI5Nbj2rkSw.png" /></figure><p>Accept the Peering Request (Region B) (us-east-1)</p><p>Switch to <strong>Region B</strong>:</p><ol><li>Open <strong>Transit Gateway Attachments</strong></li><li>Select the pending request</li><li>Click <strong>Accept request and name the connection for future reference.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KS-c4QQxGvkBvlRzitd-ug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIB_cKuxB5BEXMS6EgiXnQ.png" /></figure><p>The peering connection should now<strong> be available in both the regions.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvj96BKMWA2TTqUlXITMTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nSTbU6SQLLgi1dEdxC_E8A.png" /></figure><p>Update TGW Route Tables (Critical Step)</p><p>Without this step, <strong>no traffic flows</strong> even if the peering is “available”.</p><h3>Region A TGW route table</h3><p>Add routes that point to the TGW peering attachment (in the same route table associated with the transit gateway):</p><ul><li>Destination: CIDR of Region B VPC(s)</li><li>Target: <strong>TGW Peering attachment</strong></li></ul><p>Select create static route option to add static route</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jNi8ILGZ01-iq0X5prwZ8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1MzDGiAwi9BvF820KvJQA.png" /></figure><p>Repeat the same steps for region-b (us-east-1) transit gateway peering attachment</p><h3>Update VPC Route Tables (Both Regions)</h3><p>Each VPC that wants to talk across regions must route to its TGW.</p><h3>In Region A VPC route table:</h3><ul><li>Destination: CIDR of Region B VPC(s)</li><li>Target: <strong>Transit Gateway attachment</strong></li></ul><p>Select Edit route, add the route, and click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wV44wzfIeI_0AK4co-56dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gBOZx6tNt8pI3Ks58mSPVA.png" /></figure><p>Repeat the same steps for region-b (us-east-1) attached vpc route table.</p><h3>Test Connectivity</h3><p>From an EC2 in Region A, ping or connect to a host in Region B (and vice-versa):</p><ul><li>Use <strong>private IPs</strong></li><li>Ensure <strong>Security Groups</strong> allow traffic</li><li>Ensure <strong>Network ACLs</strong> allow traffic</li></ul><p>ping from region-a vm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXR1XXnLJJVwui912xzxXg.png" /></figure><p>ping from region-b vm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mUd6SaNiIhGGAnqcgd_Z-w.png" /></figure><h4>Costs you should expect</h4><p>You pay for:</p><p>1️⃣ <strong>Transit Gateway data processing</strong><br>2️⃣ <strong>Inter-Region data transfer</strong></p><p>Replication, logging, or database sync traffic can add up.<br>Use <strong>TGW Flow Logs + Cost Explorer</strong> to keep an eye on it.</p><h3>Important limitations (read this before deploying)</h3><h3>Peering is NOT transitive</h3><p>Traffic <strong>cannot</strong> hop TGW-to-TGW-to-TGW.</p><pre>TGW-A === TGW-B   === TGW-C<br>        |  ✘ cannot forward through B |</pre><h3>Other constraints</h3><ul><li>No multicast over peering</li><li>Overlapping CIDRs complicate routing</li><li>Network appliances require symmetric routing design</li></ul><p>Design your CIDR plan early , it saves headaches later.</p><h3>Security considerations</h3><p>Transit Gateway doesn’t inspect packets; it only routes. So:</p><ul><li>Segment networks using <strong>separate TGW route tables</strong></li><li>Use <strong>AWS RAM</strong> instead of wide-open shares</li><li>Monitor with <strong>Flow Logs</strong></li><li>Enforce controls using <strong>Security Groups + NACLs + firewalls</strong></li></ul><p>The principle of least privilege always wins.</p><h4><strong>Conclusion</strong></h4><p>Inter-Region Transit Gateway Peering is one of the cleanest ways to build a private, scalable, and high-performance global network on AWS. When designed correctly , with proper CIDR planning, routing tables, and security controls , it eliminates the complexity of VPN meshes and public internet dependencies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fcae7f1a4cc" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/aws-transit-gateway-inter-region-peering-explained-6fcae7f1a4cc">AWS Transit Gateway Inter-Region Peering Explained</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[Utilizing AWS ECS for Application Deployment and Establishing a Secure Connection to a Private RDS…]]></title>
            <link>https://aws.plainenglish.io/utilizing-aws-ecs-for-application-deployment-and-establishing-a-secure-connection-to-a-private-rds-774fc26eddbf?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/774fc26eddbf</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[knowledge]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 16:27:58 GMT</pubDate>
            <atom:updated>2023-07-31T03:33:55.528Z</atom:updated>
            <content:encoded><![CDATA[<h3>Utilizing AWS ECS for Application Deployment and Establishing a Secure Connection to a Private RDS Instance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ok5e5IV5kzglafOdL7CB6w.png" /></figure><p>This article provides a comprehensive guide on deploying an application on AWS Elastic Container Service (ECS) using AWS Fargate, a serverless compute engine. It also covers the process of connecting the application to a private Relational Database Service (RDS) instance. The instructions outlined in this article will assist you in leveraging the power of ECS and Fargate for seamless application deployment and integration with a secure RDS environment.</p><h4>AWS Elastic Container Service</h4><p>AWS Elastic Container Service is a fully managed container orchestration service that facilitates the deployment, management, and scaling of containerized applications. With AWS Elastic Container Service, containers can be launched at scale without the need to be concerned about the underlying infrastructure.</p><h4>AWS Fargate</h4><p>AWS Fargate is a serverless service that allows you to run containers without the need to manage servers or clusters. It is compatible with AWS ECS and AWS EKS</p><p>To begin, we need to containerize the application and push it to the AWS Elastic Container Registry. In order to do this, we have to create a private AWS Elastic Container Registry</p><p>Open the AWS Management Console and enter AWS ECR in the search bar to find the AWS Elastic Container Registry</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TE5mV4dWoNpWnp_KXSlC0Q.png" /></figure><p>Select Elastic Container Registry from the list, and a dashboard will appear, as demonstrated below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dj6OT4EGOYICdSpeuqxFtw.png" /></figure><p>Now, click on create repository</p><blockquote>Visibility Settings -&gt; Private (to create private repository)</blockquote><blockquote>Repository name -&gt; Give name of your repository</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSLd8FcVqrNKteAGoa6DAA.png" /></figure><p>Now, click on create repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gu2M4xakc1btfY6w8lzX7Q.png" /></figure><p>As you can see, our repository has been created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdbZPGL2vhhwEixrsc7N4w.png" /></figure><p>Now, we will create a virtual machine to build and push the image to AWS Elastic Container Registry</p><p>Once again, navigate to the search bar and search for EC2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yeJfISBp1u0Kxfo13oyQUw.png" /></figure><p>Now, select EC2 from the list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*--gDm6y6JzGqacaMLAUHYg.png" /></figure><p>Now, click on Instances and select Launch Instances to launch a Ubuntu-based virtual machine (VM). You can follow the (<a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/LaunchingAndUsingInstances.html">Launch Instances</a>) official AWS documentation on launching instances for more guidance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zeIzWMlgDTn5oSA9W00o0g.png" /></figure><p>Before accessing the VM, we need to create a role with a policy that grants the necessary permissions for the VM to push images to the AWS Elastic Container Registry</p><p>To do this, once again, search for IAM in the search bar and select IAM from the list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FCqPLRa1IM3QPIxRzw3mKw.png" /></figure><p>Now, select roles from the left side menu and click on create role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFwZ4o5MEWaokAckFoj3EQ.png" /></figure><p>Select AWS service as the trusted entity type and choose EC2 as the use case. Then, click on Next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_1XNPocPkcwHz-21RvVvw.png" /></figure><p>Now, search for AWS ECR in the policy search bar and select the second policy to attach to this specific role. Then, click on Next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQ6wo8xZKALd1ECyj5HzUg.png" /></figure><p>Now, provide a name for the role and click on create role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RSe3ffpGlUVVIQtmD90l5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QraTzb4aCLmD5tzzECpTuQ.png" /></figure><p>Now, attach the created role to the VM that will be used to push the image to the AWS Elastic Container Registry</p><p>To do so, select the VM, click on Actions, and navigate to the Modify IAM role option. Then, select that option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acz2S71YsHdg6Sbhu0x-Zg.png" /></figure><p>Now, select the previously created role and click on Update IAM role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jv1NHoAA_T5Wd4JX1RKeVQ.png" /></figure><p>Now, SSH into the VM and install the AWS CLI using the following commands. For more information, refer to the <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">AWS CLI</a> documentation</p><pre>sudo su -<br>apt install -y unzip<br>curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;<br>unzip awscliv2.zip<br>./aws/install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fAK0QU7NyINebMCx1AHfAQ.png" /></figure><p>Now, we need to install Docker on this VM. Follow the commands below to install Docker</p><pre>apt update<br>apt install ca-certificates curl gnupg<br>install -m 0755 -d /etc/apt/keyrings<br>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg<br>chmod a+r /etc/apt/keyrings/docker.gpg<br>echo \<br>  &quot;deb [arch=&quot;$(dpkg --print-architecture)&quot; signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \<br>  &quot;$(. /etc/os-release &amp;&amp; echo &quot;$VERSION_CODENAME&quot;)&quot; stable&quot; | \<br>  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null<br>apt update<br>apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qsWDjav3hlwSKyjj3gvCg.png" /></figure><p>Now, we need to authenticate Docker with the AWS Elastic Container Registry to enable image pushing to the registry</p><pre>aws ecr get-login-password --region &lt;region&gt;| docker login --username AWS --password-stdin &lt;account ID&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UckTEsuvDYgIrDV-P80Rtg.png" /></figure><p>As you can see login succeeded.</p><p>Now, we need to create a private RDS instance that will be utilized by our application to store the data generated by the application</p><p>To create a private database, search for RDS in the search bar and select RDS from the list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnXtvae-fRmgtz68aD_LCg.png" /></figure><p>Now, select Databases from the left menu and click on Create database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z80l4C9yuGMcaUX4vJxHfg.png" /></figure><p>Now, select MySQL as the engine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wGOqE_y-xldk2Rcg2rwRAg.png" /></figure><p>Now, select the Free tier as the template type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*5lmFM5iR3pB3FmyxpiFC1g.png" /></figure><p>Now, provide a root username and password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*wLvWu9uTTifYMX9YEyqmbg.png" /></figure><p>Now, in the connectivity settings, choose No for public access. In the VPC security group section, click on Create New and provide a name for your security group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-b6nyWcp1MPjc8IJgl_Acg.png" /></figure><p>Now, click on Create Database and wait for the database creation process to complete</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnVWupMPb64bXkBLRdmgrA.png" /></figure><p>As you can see database gets created.</p><p>Now, click on the database and copy the hostname. Make sure to save it somewhere for future reference</p><p>Now, log in to the VM again and install the MySQL package using the following commands</p><pre>apt install -y mysql-client-core-8.0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_XZwBNhyDuP931A9nEUZw.png" /></figure><p>Now access the database with below command</p><pre>mysql -h &lt;database hostname&gt; -u &lt;database username&gt; -p </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWh-IPpFKJzjVYdW-14vAA.png" /></figure><p>execute the below command to create a database with name db.</p><pre>create database &lt;database name&gt;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*1VW2gfJ4CVhQtjEAsB7ORA.png" /></figure><p>Now, create a table inside the database with below command</p><pre>use &lt;database name&gt;;<br><br>CREATE TABLE employees (<br>  id INT AUTO_INCREMENT PRIMARY KEY,<br>  name VARCHAR(100),<br>  age INT,<br>  salary DECIMAL(10, 2)<br>);</pre><p>Now, open the app.py file and replace the connection string with the appropriate username, password, and hostname of the database. Once done, save the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*iIiT0JYUalAKRoIXgmEyZw.png" /></figure><p>After replacing the connection details with the new username, password, and hostname, ensure to save the file</p><p>If you are unable to access the database, ensure that you create a rule in the security group associated with the database. In the source field of the rule, specify the security group attached to the VM</p><p>Now execute below command to build the Dockerfile and push the image to AWS Elastic Container Registry</p><pre>docker build -t &lt;account ID&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/&lt;registry name&gt;:latest .<br>docker push &lt;account ID&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/&lt;registry name&gt;:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4Rxrrbraa218kKjP6eBoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDp_VhKtvA8LRFeUSKHEFQ.png" /></figure><p>As you can see the image is pushed to AWS Elastic Container Registry</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5zdGe1cfDvL3r_9mGFpHw.png" /></figure><p>Now, click on the latest tag and copy the URI of the image, as it will be used in subsequent steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlWTkwMuEWMMHfNk4ft37g.png" /></figure><p>Now, we will create a cluster in AWS Elastic Container Service to host the container</p><p>To do that, search for ECS in the search bar and select ‘Elastic Container Service’ from the list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGc6w1DGihVH3nFHCy-R3A.png" /></figure><p>On the left side, select Clusters and click on Create Cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXnnVVb8dCwgQYHSLDck5g.png" /></figure><p>Now, provide a name for your cluster and select the appropriate options according to your requirements. Finally, click on Create</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SPobX2UALoKqWSHTa5EjEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YC0MDTFsnoEMnm46oeUvmQ.png" /></figure><p>Please note that it will take some time to create your cluster</p><p>Now, we need to create task definitions that will contain the necessary information about the container we want to launch</p><p>To do that, select Task Definitions from the left menu and click on Create new task definition</p><p>Task definitions can be created using two methods: JSON or the console. In our scenario, we will proceed with creating task definitions using the console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1pyNNHBSfz-fw9q0SwpmQ.png" /></figure><p>Now, provide a name for the task definition family</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6TWm-AgeF7APk1TtbnZ1YA.png" /></figure><p>Now, provide a name for your container, and in the Image URI field, paste the URI of the image that was copied in the previous steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Qym_EslCd3acd63QMzMbw.png" /></figure><p>Now, we need to modify the container port since our application is running on port 8080</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BYrC5j1yjkmGgfqeLUVUA.png" /></figure><p>Make any necessary modifications to the other settings according to your requirements, and then click on Next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jEkR89bJaoTeNqj1BFSDQw.png" /></figure><p>On the Configure environment, storage, monitoring, and tags page, adjust the settings as per your requirements. In our case, we will proceed with the default settings.</p><p>Now, click on Next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MeUoYfBy6Ho7BnNJIuBfdA.png" /></figure><p>On the Review and create page, review the configuration and click on Create</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bitCq2yi2LaTD_nZo8ijdQ.png" /></figure><p>Now, go back to the cluster and click on Create</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2BiZGGTIpJmNshmKI_tfw.png" /></figure><p>Now, select the task definition family we created in the previous step. Provide a name for your service and modify the other settings according to your requirements</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kHlqMwQf72Dykc27rZqLQ.png" /></figure><p>In the networking section, click on Create new security group. Provide a name and description for your security group, and make sure to allow port 8080 in the security group settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZIaiMApxL176VUu7YyyvQ.png" /></figure><p>Now, click on create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOX0JUqYN3ZnuDJThPWp8g.png" /></figure><p>After a while, you will see that your service has been deployed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0CiMuUSBz9mjHZgfPEzjHQ.png" /></figure><p>Now, we need to modify the security group of the database to allow the application to connect</p><p>Now, open the security group attached to the database and click on the Inbound Rules</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Nc1YxdcDmWHR9yN47Rk-Q.png" /></figure><p>Now, click on Edit inbound rules and add a rule with the type MYSQL/Aurora. In the source field, specify the security group attached to the container. Finally, click on Save rules</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_ulAKKPg0aQj7bFfR6ALA.png" /></figure><p>Now, navigate to the AWS ECS cluster and click on the cluster that we previously created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qI3nuN0xapfRjRsC5LlGng.png" /></figure><p>Now, go to the Tasks section and click on the task name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TmUxmgj8EIwnIyg4pohiqQ.png" /></figure><p>After clicking on the task name, navigate to the Network Binding section and copy the external link. Paste the link in your browser to access the application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-mTuies5lyWGgUKHJ4z-Q.png" /></figure><p>As you can see we can see our webpage and data is also appended in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJqH9LFDETNZPfuWAKfgIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*rvJejlCpsfZRC5rdWEujhA.png" /></figure><p>Code used in this blog <a href="https://github.com/harsh-del/flask-app"><strong>Code</strong></a></p><p><strong>If you liked the above blog, please clap and share.</strong></p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=774fc26eddbf" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/utilizing-aws-ecs-for-application-deployment-and-establishing-a-secure-connection-to-a-private-rds-774fc26eddbf">Utilizing AWS ECS for Application Deployment and Establishing a Secure Connection to a Private RDS…</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[Unlocking Synergy: Mastering Istio on AWS EKS for Seamless Microservices Management]]></title>
            <link>https://aws.plainenglish.io/unlocking-synergy-mastering-istio-on-aws-eks-for-seamless-microservices-management-b9ac7e1863b7?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9ac7e1863b7</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[integration]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 16:27:34 GMT</pubDate>
            <atom:updated>2023-07-17T08:01:13.539Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*G1HiN8Hysh0voThVQoubJg.png" /></figure><p>Embarking on the journey to leverage the power of Istio and AWS Elastic Kubernetes Service (EKS) can greatly enhance your microservices architecture and boost your application’s performance and resilience. In this comprehensive guide, we will walk you through the step-by-step process of installing and setting up Istio on AWS EKS. By the end, you’ll be equipped with the knowledge and tools to harness the full potential of these powerful technologies.</p><h4>AWS EKS</h4><p>AWS Elastic Kubernetes Service (EKS) is an AWS-provided managed platform that offers Kubernetes as a service</p><p>The AWS Elastic Kubernetes Service (EKS) facilitates seamless scalability, deployment, and management of applications, abstracting the complexities of underlying infrastructure</p><p>Kubernetes is a robust container orchestration tool that optimizes the efficient management, deployment, and scaling of containerized applications</p><h4>Istio</h4><p>Istio is a service mesh that abstracts the traffic layer from your cluster, enabling separate management</p><p>Istio is built upon the sidecar pattern, wherein it deploys an additional container, known as the Envoy proxy, alongside your pod. The Envoy proxy takes charge of traffic control and applies the various capabilities offered by Istio</p><p>To simplify the complex task of launching an EKS cluster and deploying a demo application, we will utilize eksctl for cluster setup</p><p>Now launch an ec2 instance, this instance will be used to install eksctl for provisioning an AWS EKS cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfbUZ6iif4zPc5iFOd6Tew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*g-UjcXx69-8JK1mYRPa9Jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*vnm1gRajzg-H0L2WK-MjQQ.png" /></figure><p>Now, click on launch.</p><p>Once the instance has been created, establish an SSH connection to the instance and execute the following commands as the root user.</p><pre>curl --silent --location &quot;https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz&quot; | tar xz -C /tmp<br>sudo mv /tmp/eksctl /usr/local/bin<br>eksctl version</pre><p>As you can see eksctl is installed and working fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aP0B1gReutiil7IWgkpLQ.png" /></figure><p>Now create a role that allow’s the above particular instance to launch an eks cluster as well as access the cluster, attach the role to above instance.</p><p>After creating the role run the below command to create the cluster</p><pre>eksctl create cluster --name test-cluster --version 1.22 --region ap-south-1 --nodegroup-name linux-nodes --node-type t2.medium --nodes 2</pre><p>as you can see the cluster is getting created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wGupthAerFTLNS0OjH8LNQ.png" /></figure><p>make sure you have kubectl installed, if not you might get the below error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CX7ywtHNxEhuBmoquvyhAQ.png" /></figure><p>our cluster is also visible from the aws console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A0WFe9loFEPLE1aZ9hHAIw.png" /></figure><p>Now run the below command to check if you can see nodes or not, if everything works fine we are good to go!!</p><pre>kubectl get nodes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BKZsgl6azhD_3XvvG9wJ5A.png" /></figure><p>Now we will install istioctl which will help to install istio, follow below commands to install istioctl</p><pre>curl -L https://istio.io/downloadIstio | sh -<br>cd istio-1.18.0<br>export PATH=$PWD/bin:$PATH</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lW2XBhE5WfWYk7qTD6LomA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*PrPAfXpjfQhBkEzLf9tJpw.png" /></figure><p>Now, execute the below command to install istio</p><pre>istioctl install --set profile=demo -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ot7Tr3KgsGBMcP4k6xnyfA.png" /></figure><p>Now we have to label the namespace to tell istio to manage this namespace and launch side car container</p><pre>kubectl label namespace default istio-injection=enabled</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-dpVbKoM0twEvlJf0J60zA.png" /></figure><p>Now run the below command to install sample application</p><pre>kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dwbmsgxptCwGawl3IE58A.png" /></figure><p>Now run the below kubectl commands to check deployment and services are running fine or not.</p><pre>kubectl get deploy<br>kubectl get svc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m3AfiVepJOqQUpOOmOGQbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_H-iJjpbyoeyMhBFy7-AQ.png" /></figure><p>Now run the below command in order to access the application from outer world</p><pre>kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cbsnrZQC6nuqocyOQjyI0Q.png" /></figure><p>Now run the below command to install some addons like kiali,prometheus,grafan and jaeger</p><pre>kubectl apply -f samples/addons --validate=false<br>kubectl rollout status deployment/kiali -n istio-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0R0rDnb5-_OXNqpbvzkbqA.png" /></figure><p>Now we have to patch the kiali service inorder to access kiali, for doing so run the following commands</p><pre>kubectl patch svc kiali -n istio-system -p &#39;{&quot;spec&quot;: {&quot;type&quot;: &quot;LoadBalancer&quot;}}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIz-yUhh3xucdJtTZtvv6w.png" /></figure><p>execute the below command to check if the service is patched or not</p><pre>kubectl get svc -n istio-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LqNbDYhkaJrIaTNRTQc1fQ.png" /></figure><p>Now copy the hostname of kiali and browse it with port 20001 and you can see the kiali dasboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYj8DsZIBHpCmHNC6uKnMQ.png" /></figure><p>Prior to visualizing or observing the traffic, it is necessary to generate some traffic. To achieve this, execute the following command and make note of the hostname associated with the istio-ingressgateway service.</p><pre>kubectl get svc -n istio-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LqNbDYhkaJrIaTNRTQc1fQ.png" /></figure><p>Now, utilizing the previously obtained hostname of the istio-ingressgateway service, access the hostname and append “/productpage” at the end of the URL. This is necessary as our application is hosted at the “/productpage” endpoint. Proceed to repeatedly access the same URL multiple times to generate the desired traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-lZAZMe4X-T4rEPISWjBew.png" /></figure><p>After generating the traffic, navigate back to the Kiali dashboard. Select the “Graph” option from the left-side menu. Choose the “default” namespace and modify the traffic metric to display data for the last 30 minutes. This will allow you to visualize and analyze the traffic patterns within the specified timeframe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-UCEjbWKFDAvFnc7Sf_MQ.png" /></figure><p>by utilizing the Kiali dashboard and configuring the appropriate settings, you can effectively visualize the traffic patterns and gain insights into the flow of traffic within the system. This visualization aids in understanding the behavior and performance of the application and its associated services.</p><p><strong>If you liked the above blog, please clap and share.</strong></p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9ac7e1863b7" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/unlocking-synergy-mastering-istio-on-aws-eks-for-seamless-microservices-management-b9ac7e1863b7">Unlocking Synergy: Mastering Istio on AWS EKS for Seamless Microservices Management</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[Using Strongswan to setup site to site IPsec VPN between GCP and Digital Ocean]]></title>
            <link>https://blog.thecloudside.com/using-strongswan-to-setup-site-to-site-ipsec-vpn-between-gcp-and-digital-ocean-617da7d63b46?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/617da7d63b46</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 13:26:31 GMT</pubDate>
            <atom:updated>2023-07-07T13:26:31.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TyqPXpDXb_poxtXuVijVRA.png" /></figure><p>For one of our projects, we need to replicate a database from Digital Ocean to GCP. One of the key challenges we faced while replication, was that we had to setup VPN tunnel from Digital Ocean to GCP but Digital Ocean does not provide any VPN solution like other cloud providers.</p><p>In this blog, we will discuss how we used an open-source tool Strongswan to configure IPsec tunnel between Digital Ocean and GCP.</p><h3>Strongswan</h3><p>It is an OpenSource IPsec-based VPN solution. It is a multiplatform IPsec implementation which helps you to setup site to site IPsec VPN between any cloud provider or bare metal machine.</p><h3>Pre-requisite</h3><ul><li>Should have a provisioned VM at GCP side, within a VPC where you have to setup tunnel.</li><li>Should have a configured droplet at Digital Ocean side where you have to setup a tunnel.</li></ul><h4><strong>Let’s begin by setting up Strongswan:</strong></h4><h4><strong>GCP side:</strong></h4><ul><li>SSH into the GCP VM and run the below commands to install strongswan.</li></ul><pre>apt update &amp;&amp; sudo apt upgrade -y<br>apt install strongswan -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*TdYToU5WvpDG6RpP2nDhVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rj72G0LqsYnby2wTmYRDUw.png" /></figure><ul><li>Now we have to generate PSK key which will be used by Strongswan server on both sites of VPN tunnel for authentication. For generating secret run the below command and paste the key somewhere after removing extra spaces.</li></ul><pre>openssl rand -base64 64</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*shaNHxIdLLPbZ0ilHFMJzg.png" /></figure><ul><li>Now open the <strong>/etc/ipsec.secrets</strong> file and add text with below format:</li></ul><p><strong><em>&lt;public ip of GCP VM (site a)&gt; &lt;public ip of Digital Ocean VM(site b)&gt; : &lt;encryption method&gt; &lt;key&gt;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FohstuVjyJ76fTtBwXZDrQ.png" /></figure><ul><li>Now open the <strong>/etc/ipsec.conf and </strong>add use below configuration.</li></ul><pre>config setup<br>        charondebug=&quot;all&quot;<br>        uniqueids=yes<br>        strictcrlpolicy=no<br><br># connection to siteB datacenter<br>conn siteA-to-siteB<br>  authby=secret<br>  left=%defaultroute<br>  leftid=&lt;public ip of site a&gt;<br>  leftsubnet=&lt;subnet range of site a&gt;<br>  right=&lt;public ip of site b&gt;<br>  rightsubnet=&lt;subnet range of site b&gt;<br>  ike=aes256-sha2_256-modp1024!<br>  esp=aes256-sha2_256!<br>  keyingtries=0<br>  ikelifetime=1h<br>  lifetime=8h<br>  dpddelay=30<br>  dpdtimeout=120<br>  dpdaction=restart<br>  auto=start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbBkdU2VE_outMyuYDBRFw.png" /></figure><ul><li>Now start the IPsec tunnel with the below command</li></ul><pre>ipsec restart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPkgSkY42sevPiNPbi9S6Q.png" /></figure><ul><li>Use below command to check status of IPsec tunnel</li></ul><pre>ipsec status <br>ipsec statusall</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vp4yVsr5wZnv9DdSz_J8mQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SHGcoFYUM43-SEEFq4Mr1w.png" /></figure><h4>Digital Ocean side:</h4><ul><li>SSH into the Digital Ocean droplet and run the below command to install Strongswan.</li></ul><pre>apt update &amp;&amp; sudo apt upgrade -y<br>apt install strongswan -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pECJ3RCEnRUnazjD_-O9Mg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TDg-_aBUAmCvkEvQsnav8Q.png" /></figure><ul><li>Now open the <strong>/etc/ipsec.secrets</strong> file and add text with below format:</li></ul><p><strong><em>&lt;public ip of Digital Ocean Droplet (site b)&gt; &lt;public ip of GCP VM (site a)&gt; : &lt;encryption method&gt; &lt;key&gt;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64NWPo-ffbIHz7dmDXHsfA.png" /></figure><ul><li>Now open the <strong>/etc/ipsec.conf and </strong>add use below configuration:</li></ul><pre>config setup<br>        charondebug=&quot;all&quot;<br>        uniqueids=yes<br>        strictcrlpolicy=no<br><br># connection to siteA datacenter<br>conn siteA-to-siteB<br>  authby=secret<br>  left=%defaultroute<br>  leftid=&lt;public ip of site b&gt;<br>  leftsubnet=&lt;subnet range of site b&gt;<br>  right=&lt;public ip of site a&gt;<br>  rightsubnet=&lt;subnet range of site a&gt;<br>  ike=aes256-sha2_256-modp1024!<br>  esp=aes256-sha2_256!<br>  keyingtries=0<br>  ikelifetime=1h<br>  lifetime=8h<br>  dpddelay=30<br>  dpdtimeout=120<br>  dpdaction=restart<br>  auto=start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peCrKII-LWqaywWmeKLwaA.png" /></figure><ul><li>Now start the IPsec tunnel with the below command</li></ul><pre>ipsec restart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usHkKDXx2j5B9VL2IpFL0w.png" /></figure><ul><li>Use below command to check status of IPsec tunnel</li></ul><pre>ipsec status <br>ipsec statusall</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5VXiH4c158p71Q20wm4ZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sca9ehHlfeRWBwnGhpnG2A.png" /></figure><ul><li>Now try to ping to the private ip of site b (Digital Ocean) server and vice versa with below command</li></ul><pre>ping &lt;private ip of site a&gt;<br>ping &lt;private ip of site b&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjiEOIkAuvywZLWrjxfJ7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*ddueTLKbCQhw2O9vEnkMaA.png" /></figure><p>As you can see now we can ping the other server private IP.</p><h4>Conclusion</h4><p>As of now we have used Strongswan to setup site to site IPsec tunnel using bare metal machines. In another blog we will setup tunnel using Cloud VPN.</p><p>Hope you found this blog helpful. Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=617da7d63b46" width="1" height="1" alt=""><hr><p><a href="https://blog.thecloudside.com/using-strongswan-to-setup-site-to-site-ipsec-vpn-between-gcp-and-digital-ocean-617da7d63b46">Using Strongswan to setup site to site IPsec VPN between GCP and Digital Ocean</a> was originally published in <a href="https://blog.thecloudside.com/">The Cloudside View</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Cloud VPN to setup site to site IPsec VPN between GCP and Digital Ocean]]></title>
            <link>https://blog.thecloudside.com/using-cloud-vpn-to-setup-site-to-site-ipsec-vpn-between-gcp-and-digital-ocean-dfcfb81c3219?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfcfb81c3219</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 13:25:20 GMT</pubDate>
            <atom:updated>2023-07-07T13:25:20.323Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xz5jGYFdhB9iIhq57Bc8gw.png" /></figure><p>For one of our projects, we needed to migrate all servers from Digital Ocean to GCP. One of the key challenges we faced while migrating, was that we had to set up VPN tunnel from Digital Ocean to GCP using Cloud VPN but Digital Ocean does not provide any VPN solution like other cloud providers.</p><p>In this blog, we will discuss how we used an open-source tool Strongswan to configure IPsec tunnel with Cloud VPN.</p><h3><strong>Cloud VPN</strong></h3><p>Cloud VPN is a service provided by Google Cloud for securely connecting your peer network to your VPC using IPsec VPN connection.</p><h3>Pre-requisite</h3><ul><li>Should have a configured droplet at Digital Ocean side where you have to setup a tunnel.</li></ul><h4>Let’s begin by setting up Cloud VPN on GCP side :</h4><ul><li>Navigate to Cloud VPN in GCP cloud console and select VPN option from left side menu and click on <strong>create VPN connection</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*UWsqE7dsoIiZPxu2oBO-yw.png" /></figure><ul><li>Now choose <strong>classic VPN</strong> and click on continue</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*zrKXQqwP_CnaDIWf56lEHA.png" /></figure><ul><li>Now give the following details</li></ul><p>-&gt; Name- Name of your VPN Gateway</p><p>-&gt; Description — Give purpose of your Gateway</p><p>-&gt; Network — Name of your VPC in which Gateway will reside.</p><p>-&gt; Region — Region in which Gateway will reside</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*HBuVlUSBDn1q8O6JsjtoVg.png" /></figure><ul><li>Now we have to provide an IP address which will act as Gateway IP address. For that click on <strong>IP address </strong>and click on create IP address</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*DktKVxa7KBcc2b2CJAvTVg.png" /></figure><ul><li>Now give a name which will refer your static IP address and click on <strong>reserve</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*aQxY_pykI8Pj6Zj1HghL4g.png" /></figure><p>Save the IP address, it will be used as gateway IP in strongswan configuration inside a digital ocean droplet which will act as Strongswan server</p><ul><li>keep this configuration as it is, click on <strong>cancel</strong> in tunnel configuration because we will do the tunnel configuration afterwards and click on <strong>create</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*HSfV23wX4PyLz5cdLjzR1g.png" /></figure><h4>Let’s setup Strongswan at Digital Ocean side:</h4><ul><li>Install strongswan with the following commands</li></ul><pre>apt update &amp;&amp; apt upgrade -y<br>apt install strongswan -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*7JiirtRsvyYqIM31Zx2kmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*SgfRobW2dp6fTWsvks4jpA.png" /></figure><ul><li>Now we have to generate PSK key which will be used by Strongswan server on both sites of VPN tunnel for authentication. For generating secret run the below command and paste the key somewhere after removing extra spaces.</li></ul><pre>openssl rand -base64 64</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zXBWy_G2Ygmxxs-r8enSQ.png" /></figure><ul><li>Now open the <strong>/etc/ipsec.secrets</strong> file and append text with below format</li></ul><p><strong><em>&lt;public ip of Strongswan server (Digital Ocean)&gt; &lt;VPN Gateway IP (Cloud VPN)&gt; : &lt;encryption method&gt; &lt;key&gt;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40BFVcm0V067_0DqWMoqUA.png" /></figure><ul><li>Now open the <strong>/etc/ipsec.conf </strong>and use the below configuration</li></ul><pre>config setup<br>        charondebug=&quot;all&quot;<br>        uniqueids=yes<br>        strictcrlpolicy=no<br><br># connection to siteB datacenter<br>conn siteB-to-siteA<br>  authby=secret<br>  left=%defaultroute<br>  leftid=&lt;public ip of Digital Ocean server&gt;<br>  leftsubnet=&lt;subnet range of VPC at Digital Ocean side&gt;<br>  right=&lt;public ip of VPC Gateway(GCP)&gt;<br>  rightsubnet=&lt;subnet range&gt;<br>  ike=aes256-sha2_256-modp1024!<br>  esp=aes256-sha2_256!<br>  keyingtries=0<br>  ikelifetime=1h<br>  lifetime=8h<br>  dpddelay=30<br>  dpdtimeout=120<br>  dpdaction=restart<br>  auto=start</pre><p>Subnet range — the range should be same with respect to the subnet to which tunnel will be set at GCP side</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*SJdWXon2UMpBZnJjCNT39w.png" /></figure><ul><li>Now start the IPsec tunnel with the below command</li></ul><pre>ipsec restart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*FEucnPJExJEtW-7n1XHS5w.png" /></figure><ul><li>Use below command to check status of IPsec tunnel</li></ul><pre>ipsec status <br>ipsec statusall</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*L-UlVImkFm3pUppT_sT8JA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*UpOpPA4TrXYtaZWX_z3qiQ.png" /></figure><p>As the tunnel is connecting state but not up because we haven’t configured the tunnel at the GCP side, as soon as we set up the tunnel at GCP side the status here will be up.</p><h4><strong>Configuring Tunnel on GCP side:</strong></h4><ul><li>Navigate to <strong>Hybrid Connectivity</strong> page inside GCP console and click on <strong>Cloud VPN Tunnels</strong> column and click on <strong>Create VPN Tunnel</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6FyBQenPwZhjMU0sCvexXw.png" /></figure><ul><li>Now choose the VPC Gateway we created in previous steps and click on continue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*EO4-EgnR13MKeA7n4jxWHA.png" /></figure><ul><li>Now give the following details</li></ul><p>-&gt; Name — Name of your tunnel</p><p>-&gt; Description — Description of your tunnel</p><p>-&gt; Remote peer IP Address — Public IP of the Strongswan server at Digital Ocean side</p><p>-&gt; IKE version — use IKEv2 version</p><p>-&gt; IKE pre shared key — copy paste the key which we generated for authentication in previous steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*bG5esYzDw2MdVfneTPDG3g.png" /></figure><ul><li>Now in routing options, choose <strong>Policy-based</strong> option and provide following details</li></ul><p>-&gt; Remote network IP ranges — give the VPC CIDR range of Strongswan server at Digital Ocean side</p><p>-&gt; Local subnetworks — choose your subnet to which the tunnel will do routing (keep it same as the subnet range your provided at configuration of Strongswan server on Digital Ocean side)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*rzJQyUX1yms4HMExntQWJg.png" /></figure><ul><li>Now click on create and wait for some time till the tunnel gets up.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*rQkPtsQaULjRFANLInGSiw.png" /></figure><ul><li>Now the tunnel is up from the GCP side and Digital Ocean side.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*CjHRWp2XFTY8IwIDGI8BNw.png" /></figure><ul><li>For checking tunnel status at Digital Ocean side, run below command</li></ul><pre>ipsec status <br>ipsec statusall</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*Vi1VgxJr8SlZLuY4EbAPBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*xXZfO7q8jDwXNNIo4d5DHA.png" /></figure><h4>Configuring Strongswan server(VM) as a router:</h4><ul><li>Now run the below command for enabling IP forwarding</li></ul><pre>sysctl -w net.ipv4.ip_forward=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*pP-SC5K7NmaLtBj317tnbQ.png" /></figure><h4><strong>Configuring rules on backend server:</strong></h4><ul><li>Now ssh to the backend server from Strongswan server with below format, if we don’t ssh in this way and ssh using the public ip, our connection will drop as soon as we do any network changes.</li></ul><p><em>ssh -o ProxyCommand=”ssh -W %h:%p root@{public_IP_of_gateway_Droplet}” root@{private_IP_of_backend_Droplet}</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*EJeTqPW7dQsS9XnbgJSoag.png" /></figure><ul><li>Now install <strong>net-tools</strong> package which is required for modification of route tables with below command</li></ul><pre>apt install -y net-tools</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*3DZxyMUvYRnDpfe2xUNSdg.png" /></figure><ul><li>For getting Gateway IP run the below command</li></ul><pre>route -n</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*zuRLxx818W1Kw7I2PyrxrA.png" /></figure><ul><li>Now run the below command and replace your Gateway IP</li></ul><p><strong><em>ip route add 169.254.169.254 via {your-gateway-IP} dev eth0</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*fIBr_nNFwUejgvsxBnPE2w.png" /></figure><ul><li>Now run the below command and replace your private ip of strongswan server</li></ul><p><strong><em>ip route change default via {private_IP_of_gateway_Droplet}</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*imxxzBdya4-zA4uSb7i9jA.png" /></figure><ul><li>Now try to ping to any server on GCP side from both Strongswan server and from any VM at Digital Ocean side inside that VPC where Strongswan server resides</li></ul><p><strong><em>ping ip</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*boOWyFdxFbv8VbcB_P4uCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*PyHCi6VZQ-ZfDHGLon6u4Q.png" /></figure><ul><li>Now try to ping to any server on Digital Ocean side from GCP side.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*2Vcrm1jp1f_zrf_gbg4VXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*jcBJoHbUFv1w66Mce6w7BQ.png" /></figure><p>As you can see now we can ping all the VM’s from each side.</p><h4>Conclusion</h4><p>So here we have used Strongswan and Cloud VPN to setup site to site IPsec tunnel.</p><p>Hope you found this blog helpful. Thanks for reading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfcfb81c3219" width="1" height="1" alt=""><hr><p><a href="https://blog.thecloudside.com/using-cloud-vpn-to-setup-site-to-site-ipsec-vpn-between-gcp-and-digital-ocean-dfcfb81c3219">Using Cloud VPN to setup site to site IPsec VPN between GCP and Digital Ocean</a> was originally published in <a href="https://blog.thecloudside.com/">The Cloudside View</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieving Canary Deployments for VM-Based Apps on Compute Engine with Cloud Build]]></title>
            <link>https://blog.thecloudside.com/achieving-canary-deployments-for-vm-based-apps-on-compute-engine-with-cloud-build-6d8bc55e3dd3?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d8bc55e3dd3</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-build]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Tue, 30 May 2023 03:33:51 GMT</pubDate>
            <atom:updated>2023-05-30T03:33:51.938Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRNRYpU8e-3C1l2AJuWxQg.png" /></figure><p>In this blog, we will guide you on how to make the most out of canary deployments using Google Cloud Build. We will provide a detailed, step-by-step demonstration of how to use canary deployments by deploying a sample application to the Google Compute Engine.</p><h4>What is Canary Deployment</h4><p>Canary deployments enable a gradual rollout of new application versions. Initially, a small subset of live traffic is directed to the new version, while the majority of users continue using the current version. This controlled approach allows for testing and monitoring before full exposure to all users.</p><p>I will start with a bit of introduction to the services used, please skip if you already know.</p><h4>Cloud Build</h4><p>Cloud Build is a Continuous Integration and Continuous delivery service provided by Google Cloud which helps developers to build, test and deploy their code to production.</p><p>Cloud Build is a complete serverless platform where you don’t have to take care of underlying infrastructure for running your CI/CD code instead just run your code and the underlying infrastructure is taken care of by Google Cloud, this is what serverless is all about. With Cloud Build you can also build your docker images by providing Dockerfile to Cloud Build.</p><p><strong>Let&#39;s start! We will configure Cloud Build to automate the updating of the managed instance group, employing a canary deployment approach whenever the developer pushes code to the Git repository.</strong></p><ul><li>For this scenario we will be creating an instance template with a startup script, for doing so we will be using the gcloud command to create an instance-template.</li></ul><pre>gcloud compute instance-templates create web-inst-temp --project=learning-project-125487 --machine-type=n1-standard-1  --metadata=startup-script=sudo apt install git apache2 -y &amp;&amp; sudo git clone &lt;repo link&gt; &amp;&amp; sudo cp lecture0/* /var/www/html/   --tags=http-server,https-server</pre><ul><li>Here gcloud is used to create an instance template with a startup script that pulls the code from the repository and installs Apache as a web server.</li><li><em>— project → argument is used to specify the project in which you want to create the template</em></li><li><em>— machine-type -&gt; argument is used to define the type of Virtual Machine to be launched</em></li><li><em>— metadata -&gt; argument is used to set a startup script which will be executed at boot time</em></li><li><em>— tags → argument is used to add tags so that the firewall rule will be applied</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USdvFb85X4vg3VCJ91rTQQ.png" /></figure><ul><li>After creating the instance template, now we need to create a health check which will be applied to our managed instance group, for doing this we will be using gcloud</li></ul><pre>gcloud beta compute health-checks create http http-health-check --project=learning-project-125487 --port=80 --request-path=/ --proxy-header=NONE --no-enable-logging --check-interval=5 --timeout=5 --unhealthy-threshold=2 --healthy-threshold=2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X12_OP1I8JHvqgxzaDEnZg.png" /></figure><ul><li>After creating the instance template we will create a managed instance group, for doing so we will be using gcloud command</li></ul><pre>gcloud beta compute instance-groups managed create http-web-group --project=learning-project-125487 --base-instance-name=http-web-group --size=1 --template=web-inst-temp --zone=us-central1-a --list-managed-instances-results=PAGELESS --health-check=http-health-check --initial-delay=300</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GGlVFfihfHDUQrb_RGM5A.png" /></figure><pre>gcloud beta compute instance-groups managed set-autoscaling http-web-group --project=learning-project-125487 --zone=us-central1-a --cool-down-period=60 --max-num-replicas=3 --min-num-replicas=1 --mode=on --target-cpu-utilization=0.6</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8GkHrLrF26dwAgdL1Uapw.png" /></figure><ul><li>Now we will be creating an External Http(s) LoadBalancer, for doing so go to the google cloud console and go to the load balancing page, and choose HTTP load balancer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cX9jH1Y2RyAdesOsEmf9xQ.png" /></figure><p>have the below option checked and click on continue</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*AtevFATvjAAfiWxPIWOUPg.png" /></figure><p><strong>Load Balancers have mainly two configurations frontend and backend. Now we will configure the frontend</strong></p><ul><li>You can consider the below configuration or create your own according to your use case and then click on done.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*Zxo5HLSK63bCbw1SrG2uWA.png" /></figure><p>after the frontend configuration, we will configure the backend configuration.</p><ul><li>Now click on Backend Configuration from the left dialog box and then click on Backend Services &amp; Backend Buckets drop-down list and click on Create Backend Service</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5eOQsIMIV7vbHmCOjWhEg.png" /></figure><ul><li>For reference, you can follow the below Backend configuration or you can configure it on your own.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*aY5aq_CKI9TVD9d6v-UFQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*v-btTuBo0enpq9cz4xyXQQ.png" /></figure><ul><li>click <em>Done</em> and after add the same health check you created for your MIGs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*NbM48ekDF7Zul3XltX6v4g.png" /></figure><ul><li>Now click on <em>Create</em>.</li><li>Now name your Load Balancer and click on Create.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*60MIdRHWZVQZlogsSG4oCQ.png" /></figure><ul><li>Now we will create a pub/sub topic with the name <strong>canary topic</strong> which will be used to store the latest template ID for canary deployment. For creating a pub/sub topic navigate to the pub/sub console and click on <strong>Create Topic</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4x8t6qpaUrOvDF7XkEqxzA.png" /></figure><ul><li>Now click on <strong>create</strong> and topic will be created</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*AqmSDrq_HSArKqxbBebwww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4iUB1NHNNCwiQD_lwkO6w.png" /></figure><ul><li>Now we just have to create a Cloud Build trigger to trigger a pipeline that will automatically start a canary update with respect to the target size defined in <em>cloudbuild.yaml</em> file as soon as the developer pushes code to the git repository</li><li>Navigate to Cloud Build from the google cloud console and set up build triggers by clicking on Setup Build Trigger</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*JbHo8chWIzJplDlZG5pOJA.png" /></figure><ul><li>For the configuration of Cloud Build Trigger, you can refer below configuration. Here we are using push to branch, you can use events according to your use case or configure a webhook event</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*z5_-_vIg0Yese4irdG7Nvw.png" /></figure><ul><li>After this we need to provide our source repository, by clicking on connect to a new repository, here we are using GitHub as my source repository but you can choose from the options under Select source</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIzpaSs6jxv6RvdZ3FeiEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tm54wBKuafew6k1f1v8zOw.png" /></figure><ul><li>If you don’t find your repository, choose the option <strong>Edit Repositories under Github </strong>in Repository drop-down menus are shown below</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*tXU0hThDyRJ32QYgBk3VNQ.png" /></figure><ul><li>Now it will take you to the Google Cloud build plugin which gets installed on your GitHub in previous steps,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIpnK4mnMtjNGvArCwgqHw.png" /></figure><ul><li>Now go down, under the repository access section, under <strong>Only select repositories click on </strong>Select Repositories, and choose your repository. Now your repository will be shown and you can choose your repository and click on connect.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*pF3t68JYyMV47_wTBJtYDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*GUkp8PTyWxb3SbkwQRk0PA.png" /></figure><ul><li>Now we need to provide our configuration file(<strong>cloudbuild.yaml</strong>) which contains CI/CD build steps. Here we have two ways either you can upload your CI/CD file to the Github repository or you can manually upload your file to Cloud Build. In this case we have uploaded cloudbuild.yaml to the github repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrCSYz-QeqxLZgbkv8E0YQ.png" /></figure><ul><li>Here is cloudbuild.yaml file which will update the mig as soon as the developer pushes code to the repository.</li></ul><pre>steps:<br>- name: gcr.io/google.com/cloudsdktool/cloud-sdk<br>  id: creating-instance-template<br>  entrypoint: &#39;bash&#39;<br>  args: [&#39;-c&#39;,&#39;gcloud compute instance-templates create web-inst-temp-$BUILD_ID --project=learning-project-125487 --machine-type=n1-standard-1 --metadata=startup-script=&quot;sudo apt install git nginx -y &amp;&amp; sudo git clone &lt;repo link&gt; &amp;&amp; sudo cp cloud-build-mig/* /var/www/html/&quot; --tags=http-server,https-server&#39;]<br>  secretEnv: [&#39;USERNAME&#39;, &#39;PASSWD&#39;]</pre><pre>- name: gcr.io/cloud-builders/gcloud<br>  id: pub-sub-store-id<br>  args: [&#39;pubsub&#39;, &#39;topics&#39;, &#39;publish&#39;, &#39;canary-topic&#39;, &#39;--message=web-inst-temp-$BUILD_ID&#39;]<br></pre><pre>- name: gcr.io/cloud-builders/gcloud<br>  id: wait-until-stable<br>  args: [&#39;compute&#39;, &#39;instance-groups&#39;, &#39;managed&#39;, &#39;wait-until&#39;, &#39;--stable&#39;, &#39;http-web-group&#39;, &#39;--zone=us-central1-a&#39;]</pre><pre>- name: gcr.io/google.com/cloudsdktool/cloud-sdk<br>  id: updating-mig<br>  entrypoint: &#39;bash&#39;<br>  args:<br>  - &#39;-c&#39;<br>  - |-<br>     apt install -y jq &amp;&amp; \<br>     gcloud compute instance-groups managed describe http-web-group --project=lofty-equinox-385805 --zone=us-central1-a --format=json | jq -r &#39;.instanceTemplate&#39; | awk -F / &#39;{print $10}&#39; &gt; b.txt &amp;&amp; \<br>     gcloud pubsub subscriptions pull canary-topic-sub --auto-ack --project=lofty-equinox-385805 --format=json | jq -r &#39;.[].message.data | @base64d&#39; &gt; a.txt &amp;&amp; \<br>     gcloud compute instance-groups managed rolling-action start-update http-web-group --version=template=`cat b.txt` --canary-version=template=`cat a.txt`,target-size=1 --zone=us-central1-a --project=lofty-equinox-385805<br> </pre><pre>- name: gcr.io/cloud-builders/gcloud<br>  id: again-pub-sub-store-id<br>  args: [&#39;pubsub&#39;, &#39;topics&#39;, &#39;publish&#39;, &#39;canary-topic&#39;, &#39;--message=web-inst-temp-$BUILD_ID&#39;]<br></pre><pre>- name: gcr.io/cloud-builders/gcloud<br>  id: send-notification<br>  entrypoint: &#39;bash&#39;<br>  args:<br>  - &#39;-c&#39;<br>  - |- <br>    curl -X POST -H &#39;Content-type: application/json&#39; --data &#39;{&quot;blocks&quot;:[{&quot;type&quot;:&quot;header&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;plain_text&quot;,&quot;text&quot;:&quot;Cloud Build&quot;,&quot;emoji&quot;:true}},{&quot;type&quot;:&quot;section&quot;,&quot;fields&quot;:[{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;*Type:*\nTrigger&quot;},{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;*Deployment Type:*\nCanary&quot;},{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;*Executed by:*\nGitHub&quot;}]},{&quot;type&quot;:&quot;section&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;plain_text&quot;,&quot;text&quot;:&quot;Managed Instance Group updated by Cloud Build&quot;,&quot;emoji&quot;:true}},{&quot;type&quot;:&quot;section&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;For viewing the web app click this button --&gt;&quot;},&quot;accessory&quot;:{&quot;type&quot;:&quot;button&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;plain_text&quot;,&quot;text&quot;:&quot;Click Me&quot;,&quot;emoji&quot;:true},&quot;url&quot;:&quot;http://&lt;domain name&gt;&quot;,&quot;action_id&quot;:&quot;button-action&quot;}}]}&#39;  &lt;URL&gt;<br>    <br>availableSecrets:<br>  secretManager:<br>  - versionName: &lt;Resource ID of secret&gt;<br>    env: &#39;PASSWD&#39;<br>  - versionName: &lt;Resource ID of secret&gt;<br>    env: &#39;USERNAME&#39;</pre><ul><li><strong>The first step one will create a new template as soon as the developer pushes the code to the repository.</strong></li><li><strong>The second step will send a message to the pub/sub</strong></li><li><strong>The third step will wait or will hold that build until MIGs become stable.</strong></li><li><strong>The fourth step will update the MIG using a canary deployment strategy</strong></li><li><strong>Fifth will again send a message to the pub/sub</strong></li><li><strong>The sixth step will send a notification to Slack channel about the canary deployment</strong></li></ul><p>After doing all the above steps click on create and your trigger will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ajOeSYhICVD16VRDfgSI6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oCBED8OlqA0nYTFIqYjcsg.png" /></figure><ul><li>Before executing the trigger, we have to create an incoming webhook which will be used for sending notifications to the slack channel, for doing so firstly we will create a slack app.</li><li>Navigate to this link <a href="https://api.slack.com/apps/new">slack app</a> for creating a Slack app that will be used to generate tokens for your workspace which will be used by slack api.</li><li>Now a create app dialog box will appear, click on <strong>from scratch option</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*aNgijPENRUImL69-RTxwkw.png" /></figure><ul><li>Now give your app a name and choose your slack workspace and click on create app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*0MXOJWLDzL1eoX2HzWineA.png" /></figure><ul><li>Now your app settings page will appear where you will see an option with name <strong>incoming webhook</strong>, click that option</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2untpAUr7JtCgk8cRVB79g.png" /></figure><ul><li>Now we have to enable incoming webhook,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*5N2c49THV2iN_vJMobiVEQ.png" /></figure><ul><li>After enabling the webhook go down and click on <strong>Add new webhook to workspace</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*bSjNWD6QBNVOtTLSWoHyOg.png" /></figure><ul><li>Now it will ask which channel to send notification to, and provide your channel name and click on allow.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*F79k1JC29YitFSKdaSyWNQ.png" /></figure><ul><li>Now you will get a webhook url, copy the url and replace it with the url in the cloudbuild.yaml file created in previous steps.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*2Xar5zwKLSolRE9kxS-fcg.png" /></figure><ul><li>Now we will create another Cloud Build Trigger which will forward a rolling update for completely updating MIG.</li><li>Navigate to Cloud Build from google cloud console and set up build triggers by clicking on Triggers from left side menu and click on create trigger</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*SYU7xSlTc2xlCTauR3CZeA.png" /></figure><ul><li>For configuration of Cloud Build Trigger you can refer below configuration . Here we are using webhook events, because we will be executing our trigger with a url.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*wUE_enIGuuGFsk0uu80TKg.png" /></figure><ul><li>After choosing Webhook url, it will ask for choosing some secret, choose <strong>Use a new secret option</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*xxSWA-BBZSxTrhbF-paJHw.png" /></figure><ul><li>Now click on <strong>Show Url Preview </strong>and copy the url</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*vZvJranoJrhIbvehZ4cAsQ.png" /></figure><ul><li>Now click on <strong>Create secret </strong>and give your secret a name and again click on <strong>create secret</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*PhpyRanLVR0RMMWUMvKyRw.png" /></figure><ul><li>After this we need to provide our source repository,by clicking on connect to new repository, here I am using github as my source repository but you can choose from the options under Select source</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*36vARsmMYr0c92m4kf2JsQ.png" /></figure><ul><li>Choose your github account and under repository select your repository and click on connect, your repository might be different</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*KraHinC_1YYHE41LirKz-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*GJ73R24zio2IE2UoNYYLkw.png" /></figure><ul><li>Now we need to provide our configuration file(<strong>cloudbuild.yaml</strong>) which contains CI/CD build steps. Choose type as <strong>Cloud Build configuration file </strong>and location as <strong>Repository</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*_GTMYsp2zqhJ9r1B1Qtc7Q.png" /></figure><ul><li>Here is cloudbuild.yaml file which will completely update the mig using canary deployment strategy as client sends a command through stack slash commands.</li></ul><pre>steps:<br>- name: gcr.io/google.com/cloudsdktool/cloud-sdk<br>  id: canary-rollout-complete<br>  entrypoint: &#39;bash&#39;<br>  args:<br>  - &#39;-c&#39;<br>  - |-<br>     apt install -y jq &amp;&amp; \<br>     gcloud pubsub subscriptions pull canary-topic-sub --auto-ack --project=lofty-equinox-385805 --format=json | jq -r &#39;.[].message.data | @base64d&#39; &gt; temp.txt &amp;&amp; \<br>     cat temp.txt &amp;&amp; \<br>     gcloud compute instance-groups managed rolling-action start-update http-web-group     --version=template=`cat temp.txt`    --zone=us-central1-a  --project=lofty-equinox-385805<br> <br>- name: gcr.io/cloud-builders/gcloud<br>  id: send-notification<br>  entrypoint: &#39;bash&#39;<br>  args:<br>  - &#39;-c&#39;<br>  - |- <br>    curl -X POST -H &#39;Content-type: application/json&#39; --data &#39;{&quot;blocks&quot;:[{&quot;type&quot;:&quot;header&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;plain_text&quot;,&quot;text&quot;:&quot;Cloud Build&quot;,&quot;emoji&quot;:true}},{&quot;type&quot;:&quot;section&quot;,&quot;fields&quot;:[{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;*Type:*\nTrigger&quot;},{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;*Deployment Type:*\nCanary Complete&quot;},{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;*Executed by:*\nSlack Slash - Client&quot;}]},{&quot;type&quot;:&quot;section&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;plain_text&quot;,&quot;text&quot;:&quot;Managed Instance Group updated Completely by Cloud Build&quot;,&quot;emoji&quot;:true}},{&quot;type&quot;:&quot;section&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;mrkdwn&quot;,&quot;text&quot;:&quot;For viewing the web app click this button --&gt;&quot;},&quot;accessory&quot;:{&quot;type&quot;:&quot;button&quot;,&quot;text&quot;:{&quot;type&quot;:&quot;plain_text&quot;,&quot;text&quot;:&quot;Click Me&quot;,&quot;emoji&quot;:true},&quot;url&quot;:&quot;http://&lt;domain name&gt;&quot;,&quot;action_id&quot;:&quot;button-action&quot;}}]}&#39;  &lt;URL&gt;</pre><p>&lt;url&gt; — paste the same url saved in previous steps</p><ul><li>The first step will take the instance template created by the other trigger responsible for the rollout of the canary update to MIG completely.</li><li>The second step will send a notification for complete rollout to Managed instance group on Slack.</li></ul><p>After doing all the above steps click on create and your trigger will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*APoJVQ-I-FapHF6vPWde0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqbxvjxIIBwBwWtbD8k3WQ.png" /></figure><ul><li>Now we will create a slack command that will trigger the cloud build trigger created in the previous step. For that go to your Slack app setting page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*DQBcvZPQiBbYkCAvClFsog.png" /></figure><ul><li>Now click on <strong>Slash commands</strong> from the left side menu under features and click on Create New Command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*k6Fxpye59N1akuY6u3kMAA.png" /></figure><ul><li>Now give your command a <strong>name</strong> and in <strong>Request Url</strong> paste the URL copied in the previous step (cloud build trigger URL saved in previous steps) and click on <strong>save</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*TZFbBnFDyHcf8WuSanf9jQ.png" /></figure><ul><li>After creating the slack slash command, it will ask you to re-initialize your slack app, for re-initializing slack app navigate to Install the app from the <strong>left side</strong> menu and choose <strong>Reinstall to Workspace</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*4AVFnJXwYMjlZLGPOhiaEg.png" /></figure><ul><li>Now just choose your Slack channel again and click on <strong>allow</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*dwiBPKRVruls3ddZNeNyzA.png" /></figure><ul><li>Now just push code to the repository which you have provided as a source and cloud build will trigger the pipeline.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBbMTD3ecYmOpNliNG4lDw.png" /></figure><ul><li>Now the build is successful and a notification is sent to your Slack app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*0Cr6dnLllkWyoPwWtpCerg.png" /></figure><ul><li>Now click on the <strong>Click Me </strong>button for viewing the web app</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*vV27RsOgMPTHwOdk8ZgEXg.png" /></figure><ul><li>Now if you find the changes accurate, we can completely update the MIG with the slack slash command we created</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*JRadnWzMv6RFiCtRq2FQPA.png" /></figure><ul><li>Now the other cloud trigger will execute another pipeline(step 6) which will completely rollout the changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9_ma0dOIGBzm8Eufmq3Qw.png" /></figure><p>Now we will also get a notification on Slack for the complete rollout of the new web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*xSqjeg3fjRJ1VoftDLUZlQ.png" /></figure><p>I trust that this workflow has been helpful to you. May this post provide valuable insights as you venture into the world of Google Cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d8bc55e3dd3" width="1" height="1" alt=""><hr><p><a href="https://blog.thecloudside.com/achieving-canary-deployments-for-vm-based-apps-on-compute-engine-with-cloud-build-6d8bc55e3dd3">Achieving Canary Deployments for VM-Based Apps on Compute Engine with Cloud Build</a> was originally published in <a href="https://blog.thecloudside.com/">The Cloudside View</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Kubernetes made easy]]></title>
            <link>https://medium.com/@goenkaharsh27/managing-kubernetes-made-easy-8b125fb0c625?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b125fb0c625</guid>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[tools]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Wed, 27 Jul 2022 15:28:52 GMT</pubDate>
            <atom:updated>2022-07-27T15:28:52.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OeMD6D30KC0tW7se.png" /></figure><p>Managing Kubernetes is not an easy task when it comes to development, staging and production environments. In these environments it is required to monitor pod’s as well as node’s, and how much resources is being consumed by them.</p><p>There is a dashboard provided by Kubernetes that helps to monitor these aspects but is not as dynamic as it is required to manage the clusters, one of the reason is it does not provide plugins support.</p><p>The best open source tools to help people out there to manage Kubernetes cluster is Lens.</p><h3>Lens</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bLWOnBpJeJMJHhZC.png" /></figure><p>Lens is the open-source IDE provide by Mirantis. Lens is the way that the world runs Kubernetes. It provides a one point solution for managing Kubernetes Cluster. Lens provides an interactive dashboard and terminal that helps to manage cluster which we will be seeing further, it also provides some visuals.</p><p>Lens is built in open source and have 450K users around the world and also have 17K stars on github.</p><h3>Installing Lens</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1aGu8_t9Td4GYb8lOdbTA.png" /></figure><p>For installing lens you can go to below mentioned link to install Lens. Lens provides an IDE for Windows, Linux and Mac as well.</p><p><a href="https://k8slens.dev/">Lens | The Kubernetes IDE</a></p><h3>Configuring Lens</h3><p>Lens won’t connect to your cluster automatically, you would be required to provide the config file to Lens, this config file will be used by Lens to connect to cluster.</p><p>For Providing config file to Lens click on the three dots at the top left corner after opening Lens IDE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*i0w8zU8aURedrVwbBngKMw.png" /></figure><p>click on add cluster, which will prompt you to provide config file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QkWdLub_9PZpGYh2J0zsxA.png" /></figure><p>copy paste the content of config file and click on add clusters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCcmsOXv_XvykaT2aHfIJg.png" /></figure><p>Now lens knows how to connect to your cluster.</p><h3>Lens Overview</h3><p>Now navigate to cluster catalog. Here you will see all the clusters whose config file has been provided to Lens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RadKG-jxvFrD_-obTkFzcg.png" /></figure><p>Your cluster won’t be visible in the left pane so for that from catalog you have to pin the cluster so it will be visible in the left pane.</p><p>Lens by default doesn’t export the metrices so that we can see the visuals, for that go to settings of cluster by right clicking on the cluster from the left pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-FRLVqBe0DUNcxdYhmLCnw.png" /></figure><p>now go to lens metrics and enable all the options and click on apply. After doing so the metrics will be available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LSGes8RQUJlndZek7NJ0-Q.png" /></figure><h3>Lens Terminal and Resources</h3><p>Lens also provide terminal through which we can interact with the cluster through kubectl command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayRwqqpKyREgZU-RHCMQ_A.png" /></figure><p>Lens also provide us with the feature of custom template which we can use to create resources without logging into the Kubernetes master.</p><p>For this click on the plus sign and then click on create resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SDdQnEJ8G4Yx96l81HG0A.png" /></figure><p>After doing so select the template and click on create and close and your resources will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*czz2fizFAtKkMeOg_P9cOw.png" /></figure><h3>Monitoring Resources with Lens</h3><p>By clicking on the particular resources like deployment, pods, services etc. We can see info about the resource and their metrics also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCu3nAf7hJv08dBZ_BfYeQ.png" /></figure><p>There is an edit option at top right by which we can edit the resources as well and from terminal icon we can get the terminal of the resources like pod.</p><p><strong>If you liked the above blog, please clap and share.</strong></p><p><a href="https://www.linkedin.com/in/goenkaharsh/">Harsh Goenka - Jr DevOps Engineer - PeerXP® | PWSLab | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b125fb0c625" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Aggregation Framework and Map-Reduce]]></title>
            <link>https://medium.com/@goenkaharsh27/mongodb-aggregation-framework-and-map-reduce-ebc6488689b1?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebc6488689b1</guid>
            <category><![CDATA[information]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Sun, 19 Sep 2021 07:42:34 GMT</pubDate>
            <atom:updated>2021-09-19T07:42:34.829Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rHiBrlitOsO_Dx1b.jpg" /></figure><p>Don’t know what aggregation Framework and what MongoDB is,</p><p>then this article is cooked and served for you.</p><h4>What is Databases?</h4><p>A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system(DBMS). Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database.</p><h4>What is MongoDB?</h4><p>MongoDB is an open-source document-oriented database that is designed to store a large scale of data and also allows you to work with that data very efficiently. It is categorized under the NoSQL (Not only SQL) database because the storage and retrieval of data in the MongoDB are not in the form of tables.</p><p>The MongoDB database is developed and managed by MongoDB.Inc under SSPL(Server Side Public License) and initially released in February 2009. It also provides official driver support for all the popular languages like C, C++, C#, and .Net, Go, Java, Node.js, Perl, PHP, Python, Motor, Ruby, Scala, Swift, Mongoid. So, that you can create an application using any of these languages. Nowadays there are so many companies that used MongoDB like Facebook, Nokia, eBay, Adobe, Google, etc. to store their large amount of data.</p><h3>What is MongoDB Aggregation Framework ?</h3><p>Aggregation operations process data records and return computed results. Aggregation operations group values from multiple documents together, and can perform a variety of operations on the grouped data to return a single result. MongoDB provides three ways to perform aggregation: the aggregation pipeline, the map-reduce function, and single purpose aggregation methods.</p><h3>What is Map Reduce Function ?</h3><p>Map-reduce is a data processing paradigm for condensing large volumes of data into useful <em>aggregated</em> results.</p><p>Today we are gonna perform MongoDB map-reduce program and aggregation framework example</p><p>firstly we have to import the data as show below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*R8om1v1Lk2teufo-RyPifQ.png" /></figure><p>after importing the data use db command to see whether the database is create or not</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*LanDd_bad2SVvsw6mMljsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*fK84BwdKGPOcjWtBrDrlWA.png" /></figure><p>as you can see both the database and collections is created.</p><p>Now, we have to create a aggregation function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*XT2z2oAttY83gFdp.png" /></figure><p>Here,</p><p>data=Collection Name</p><p>aggregate()=MongoDB pre-created function</p><p>$match= it use the pre-define keyword to match the patter</p><p>.pretty()= to see the output in pretty format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*YFWrEHLJfme_TFj1.png" /></figure><h3>Creating Mapper function</h3><p>For creating mapper program we have to create mapper function as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*YZ_HWBxcd7EM2GOU.png" /></figure><p>in a very simple way mapper means to filter some data.</p><p>Here,</p><p>$split: use to split the data</p><h3>Creating Reducer function</h3><p>For creating reducer program we have to create reducer function as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ybbzQkmQLcCPIvKM.png" /></figure><p>Here,</p><p>.length: to find the length</p><h3>Running Mapper-Reducer program</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TGQLgXBq-RAZfZ89.png" /></figure><p>Here,</p><p>MapReduce(): it is a pre-created function only we have to mapper and reducer function</p><p>out: means in which collection you want to output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/0*pVv3FA-_y6OSY5Fa.png" /></figure><p>as you can see myOutput collection is created and output is stored in that collection.</p><p>According to my data set, it finds the result according to my need where mapper program splits the data on some criteria and with reducer program length is counted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*xikbh0tmsseOoD-k.png" /></figure><p>❗<strong>GitHub Link :-</strong></p><p><a href="https://github.com/harsh-del/map-reducer">GitHub - harsh-del/map-reducer</a></p><p>❗ <strong>LinkedIN Link :-</strong></p><p><a href="https://www.linkedin.com/in/goenkaharsh/">Harsh Goenka - Jr DevOps Engineer - PeerXP® | PWSLab | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebc6488689b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating AWS Storage Gateway Module with AWS Terraform]]></title>
            <link>https://aws.plainenglish.io/creating-aws-storage-gateway-module-with-terraform-7a48634adbb0?source=rss-a4aec0dc2016------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a48634adbb0</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[harsh]]></dc:creator>
            <pubDate>Thu, 26 Aug 2021 09:40:05 GMT</pubDate>
            <atom:updated>2022-03-08T18:36:21.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MhAaRkZyftTXRqWWs4oAtg.png" /></figure><p>Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centers and servers, you can access technology services, such as computing power, storage, and databases, on an as-needed basis from a cloud provider like Amazon Web Services (AWS).</p><p>Creating infrastructure is a painful process as we have to create it manually and removing infrastructure is also the same, this is where terraform comes into play.</p><p>Now what is terraform and how do we make modules in terraform to do so.</p><h3>What is terraform?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*2e4ancT9r3ClilgpmhyfUw.jpeg" /></figure><p>Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can help with multi-cloud by having one workflow for all clouds. The infrastructure Terraform manages can be hosted on public clouds like Amazon Web Services, Microsoft Azure, and Google Cloud Platform, or on-prem in private clouds such as VMWare vSphere, OpenStack, or CloudStack. Terraform treats infrastructure as code (IaC) so you never have to worry about your infrastructure drifting away from its desired configuration.</p><p>For creating the module you just have to create three terraform files main.tf, variables.tf and output.tf with extension {.tf }, your main code resides in main.tf and variables in variables.tf , output.tf as such is not required but you can include it in to show something to the user.</p><p>After creating the above files you have to upload the created files in the Github repository with release tags like v1.0 and make sure your git hub repository name follows the terraform-&lt;PROVIDER&gt;-&lt;NAME&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*Lc4B2Q8FYqDlalJnG66EYA.png" /></figure><p>Now go to terraform registry and upload your module.</p><p><a href="https://registry.terraform.io/github/create">https://registry.terraform.io/github/create</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*D2ZYugRfj08e80sayPJ_jQ.png" /></figure><p>To download and use the module you have to make a terraform file with the code provided in the provided instruction on the terraform module registry with the input variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*4hS3rGwDzALSy3Ubc5X0yA.png" /></figure><p>After this run terraform apply --auto-approve command to run the playbook and your gateway will be created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkMAOYH2_RdOkbgjPX1Gug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*eNSIDVcBCjKFtwn668zO8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*jzyFi5o1GkC9UNmB7lCZxg.png" /></figure><p>As you can see our storage gateway is created.</p><p><strong>If you liked the above blog, please clap and share.</strong></p><ul><li><a href="https://github.com/harsh-del/terraform-aws-storagegateway">GitHub - harsh-del/terraform-aws-storagegateway</a></li><li><a href="https://www.linkedin.com/in/goenkaharsh/">Harsh Goenka - Jr DevOps Engineer - PeerXP® | PWSLab | LinkedIn</a></li></ul><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>. Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><em> and </em><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>. Join our </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>community Discord</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a48634adbb0" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/creating-aws-storage-gateway-module-with-terraform-7a48634adbb0">Creating AWS Storage Gateway Module with AWS 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>
    </channel>
</rss>