<?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 Ashwin Agarkhed on Medium]]></title>
        <description><![CDATA[Stories by Ashwin Agarkhed on Medium]]></description>
        <link>https://medium.com/@ashwin.p.agarkhed?source=rss-d1d6f7467461------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5Pjgq7wsxBPXhwcRP0N4lA.png</url>
            <title>Stories by Ashwin Agarkhed on Medium</title>
            <link>https://medium.com/@ashwin.p.agarkhed?source=rss-d1d6f7467461------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:34:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashwin.p.agarkhed/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[Infrastructure for deploying Azure APIM]]></title>
            <link>https://medium.com/@ashwin.p.agarkhed/infrastructure-for-apim-beta-limited-release-also-known-as-cloud-api-beta-release-25e42af620c3?source=rss-d1d6f7467461------2</link>
            <guid isPermaLink="false">https://medium.com/p/25e42af620c3</guid>
            <category><![CDATA[api-management]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Ashwin Agarkhed]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 11:50:36 GMT</pubDate>
            <atom:updated>2025-03-19T20:38:34.804Z</atom:updated>
            <content:encoded><![CDATA[<p>This document relates to Enhancing ACS Production Security. It acts as a guide for teams to create the APIM Infrastructure (by using powershell scripts) . After the infrastructure is created the API’s need to be deployed to the API Management resource . Hence this is also related to</p><p>The setup creates a Cloud API which is fronted by application gateway . A WAF (Web Application Firewall) is attached to the application gateway which prevents all top 10 OWASP attacks like SQL injection, cross-site scripting, DDOS attack so on and so forth. This also prevents attacks from Geolocation and IP as gives administrators the control on which traffic flows in. By running the script, We will be creating the below shown architecture diagram(one on top:- Fig1.1):</p><p><strong>FOLLOWING IS THE CLOUD-API BETA RELEASE NOTES URL</strong>:</p><p>To Create the Infrastructure:</p><ul><li>Assuming we are creating the infrastructure for USA region in production, create certs for the hostnames, hostnames are for the 3 URLS: (Gateway URL, Developer Portal and the Management )</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEtCMReP0BW612ngiAUARQ.png" /></figure><h3>MicroFrontend routing for system:</h3><p>Following is the Architecture Diagram of Microfrontend routing built on top of the CLOUD-API infrastructure.</p><p>Teams want to serve up microfrontends for microservices . All these micro frontends (MFE’s) are stored in a blob (shown here as Prodigy Blob MFE’s). The required routing for it would be any requests to <a href="https://us.cloud.avigilon.com/">https://U</a>RL need to get routed to the webclient and any requests to <a href="https://us.cloud.avigilon.com/unity/">https://URL/prodigy/*</a> needs to serve up a Microfrontend. All of this routing is handled in the Application gateway shown in the below diagram. Note that the application gateway has a WAF attached to it so all requests to MFE’s are flowing through a firewall</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWv4Pn4VMDlb0D7fkQkSFg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25e42af620c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Infrastructure as Code (Azure Well Architected Framework- Kubernetes[AKS] cluster)]]></title>
            <link>https://medium.com/@ashwin.p.agarkhed/cloud-community-of-practice-acs-cloud-architecture-diagram-and-the-use-of-web-application-a72981572e87?source=rss-d1d6f7467461------2</link>
            <guid isPermaLink="false">https://medium.com/p/a72981572e87</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[application-architecture]]></category>
            <category><![CDATA[kuberenetes]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Ashwin Agarkhed]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 16:30:10 GMT</pubDate>
            <atom:updated>2025-04-24T23:19:40.467Z</atom:updated>
            <content:encoded><![CDATA[<p>This diagram is a production ready cloud architecture of kubernetes cluster on Azure, as per Azure Well Architected Framework. All of this is created by terraform and source code for it exists in this github repo : <a href="https://github.com/ashwinpagarkhed/secure-aks">Link</a></p><ul><li>This diagram shows Web client connecting to microfrontends and microservices</li><li>The newly setup Web Application Firewall (WAF) for blocking all malicious requests based on top 10 OWASP attacks. The Firewall blocks attack specific to geolocation or specific IP’s. Following type of OWASP attacks are blocked:</li><li>SQL injection Attack</li><li>Cross-site scripting Attack (XSS)</li><li>PHP injection Attack</li><li>DDOS Attacks</li><li>Remote command execution Attack</li><li>HTTP Request Smuggling Attack</li><li>HTTP Response Splitting Attack</li><li>The Application gateway in the ApGwSubnet inside the AksVnet can have public and private IP at the same time. We can have ingress for public IP and private IP separately. So the traffic from APIM will go on private IP and will be routed through the ingress pointing to the private IP whereas the traffic from public internet which doesn’t go through the APIM, can be routed to the public IP of the Application gateway which would be routed through the ingress pointing to the public IP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XquQBoEbBi69pHOAL2boBQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a72981572e87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated Performance testing pipeline for checking slow API metrics]]></title>
            <link>https://medium.com/@ashwin.p.agarkhed/automated-performance-testing-pipeline-for-checking-slow-api-metrics-in-acs-3-18v-0ecee36d3395?source=rss-d1d6f7467461------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ecee36d3395</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[jmeter-load-testing]]></category>
            <dc:creator><![CDATA[Ashwin Agarkhed]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 16:27:28 GMT</pubDate>
            <atom:updated>2025-04-15T21:41:42.229Z</atom:updated>
            <content:encoded><![CDATA[<p>Integrate PowerShell automated Jmeter Load test into Azure DevOps Pipeline Close and was created as a to do a performance testing for our various releases. This document acts as a guide for Operations team to implement Performance testing for various environments. This performance testing mimics behavior of thousands of users logging into the web client and hitting various API’s as specified by us in the .jmx file. The link to the CI/CD pipeline which does the load tes</p><p><strong>Goal</strong> : To mimic load on the system equivalent to large number of users logging in and hitting all the API’s so as to increase the CPU utilization and measure the slow performing api’s and find a way to mitigate the slowness to increase customer satisfaction while using Avigilon Cloud Services.<br><strong>Approach</strong>: JMeter is a widely used tool for conducting performance testing. To generate a .jmx file, ensure that JMeter is installed on your system, as it is a prerequisite. Additionally, Java must be installed to run JMeter. Once both JMeter and Java are installed, open the JMeter GUI. Create a thread group and specify the APIs that need to be accessed. The initial API should be a POST method for logging in, where you will provide a username and password as JSON in the POST request. Subsequently, include all the desired APIs. Save the file as a .jmx file and add it to the Azure DevOps repository for Gatekeeper.<br>To summarize the solution:</p><ol><li>Create your JMeter test plans (and supporting files like CSV files) and put them into a folder in your repo</li><li>Create a “run.sh” file that launches the Docker image and runs the tests</li><li>Create a “test.sh” file for each JMeter test plan — this just calls “run.sh” passing in the test plan and any parameters</li><li>Publish the “reports” directory for post-run analysis</li></ol><p>This is the repo <a href="https://github.com/ashwinpagarkhed/gatekeeper">Link</a> that has the source code for the performance testing pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*ehNEUoGiZqO89jELt8d3SA.png" /></figure><p>Notes:</p><ul><li>The NAME variable is the name of the container instance in our case it is “jmetertest”</li><li>The IMAGE is the container image to launch — in this case “justb4/jmeter:latest” — this container includes Java and JMeter, as well as an entrypoint that launches a JMeter test</li><li>ROOTPATH is the first arg to the script and is the path that contains the JMeter test plan and data files</li><li>The script stops any running instance of the container, and then deletes it</li><li>The final line of the script runs a new instance of the container, mapping a volume from “ROOTPATH” on the host machine to a folder in the container called “/test” and then passes in remaining parameters (skipping ROOTPATH) as arguments to the entrypoint of the script. These are the JMeter test arguments.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*9nrxBo8yIG7Dx55VQfvEiA.png" /></figure><p>This does the JMeter load test by passing in variables like:</p><ol><li>Jhost = domain of the environment where we need to send load</li><li>Jduration = duration for which we wan to run this test</li><li>Jrampup = duration after which we want the threads to send load in succession</li><li>JtenantId = the org for the environment</li></ol><p>This logs the JMeter load test results to a file which gets saved as JSON file which can then be visualized in the artifacts ..It is as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*964H8zZZuO3Q-C5c3p04Kg.png" /></figure><h3>Executing from a Pipeline</h3><p>We’ve done most of the hard work — now we can put the script into a pipeline. We need to execute the test script with the correct arguments and upload the test results and we’re done! Here’s the pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*kgmQ5Lwk8w_H70MsrYagFA.png" /></figure><p>This is very simple — and we don’t even have to worry about installing Java or JMeter — the only prerequisite we have is that the agent is able to run Docker containers! The first step executes the test.sh script, passing in the arguments just like we did from in the console. The second task publishes the report folder so that we can analyze the run.<br>Here’s a snippet of the log while the test is executing: we can see the download of the Docker image and the boot up — now we just wait for the test to complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*5oG9lGnbjHHiO6oGQ8DWfg.png" /></figure><h3>Conclusion</h3><p>Once you have a JMeter test, it’s fairly simple to run it in a Docker container as part of your build (or release) process. Of course this doesn’t test load from multiple locations and is limited to the amount of threads the agent can spin up, but for quick performance metrics it’s a clean and easy way to execute load tests. Add to that the powerful GUI authoring capabilities of JMeter and you have a good performance testing platform.<br>Happy load testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ecee36d3395" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Kubernetes Architecture]]></title>
            <link>https://medium.com/@ashwin.p.agarkhed/secure-kubernetes-architecture-azure-cloud-31885220fdfa?source=rss-d1d6f7467461------2</link>
            <guid isPermaLink="false">https://medium.com/p/31885220fdfa</guid>
            <category><![CDATA[aks-cluster]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ashwin Agarkhed]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 16:06:43 GMT</pubDate>
            <atom:updated>2025-04-15T21:42:50.791Z</atom:updated>
            <content:encoded><![CDATA[<p>The effort here is focused towards architecting the Azure Kubernetes Service . We Migrated from the unsecure vanilla k8s cluster to the azure well architected k8s cluster with private links to all resources in Azure thus eliminating the traffic flow over internet. This was prioritized due to the Russia-Ukraine conflict to tighten the security posture for Avigilon Cloud Services and achieve SOC2 and ISO2700 compliance.</p><p>All of this has been source controlled in github: <a href="https://github.com/ashwinpagarkhed/secure-aks">Link</a> . The way to run this would be running the driver script <a href="https://github.com/ashwinpagarkhed/secure-aks/blob/main/src/powershell/Driver/20220115130118836-deploy-SecureAKSCluster.ps1">deploy-SecureAKSCluster.ps1</a> in the src/powershell/Driver folder</p><p>Q .) How to migrate to this cluster from vanilla k8s cluster?</p><p>A .) Following are the steps to migrate to this cluster:-</p><ul><li>Make sure private endpoint for all the required azure resources has been created in the VmSubnet .</li><li>If your team is creating private endpoints some notes:-</li><li>Make sure the private endpoints are created inside the aks-&lt;environmentToken&gt;-rg Resource Group</li><li>Make sure if there is a private dns zone already present in the resource group, use the same one</li><li>If the private DNS zone is not present in the aks-&lt;environmentToken&gt;-rg Resource Group, create one.</li><li>Make sure auto registration for private dns zone is turned off</li><li>Note that every environment will have its own private DNS zone for a kind of resource. For example one aks-&lt;environmentToken&gt;-rg Resource Group will have 1 private DNS zone for service bus, 1 private DNS zone for sql DB so on and so forth</li><li>Make minor changes to use the private endpoints inside the cluster instead of public urls of Azure resources</li><li>Repoint deployment pipelines to the new cluster and rerun them ( this is similar to deploying your microservice to a new environment)</li><li>Make change in App Service (blue-&lt;env&gt;-api) configuration API to point to the URL of the new cluster</li><li>Follow the bullet points for qa and production environments. creating in CI → QA → Production</li></ul><p>Q .) Why to migrate all the microservices to this cluster?<br>A .) Following is the requirement:-</p><ul><li>Needed for Microfrontend routing using application gateway</li><li>Remediate Azure Cosmos DB Vulnerability</li><li>ACS SOC 2 and ISO2700 Compliance</li><li>The template allows to deploy a rich set of AKS features which harden and lock down the cluster and also make developers life easy… such as:</li><li>Access only from Office or by turning on VPN</li><li>AKS-managed AAD integration</li><li>Firewall for outbound and inbound traffic</li><li>Azure RBAC for Kubernetes Authorization</li><li>Managed identity in place of a service principal</li><li>Azure Active Directory pod-managed identities</li><li>Azure Network Policies</li><li>Azure Monitor for containers</li><li>Application Gateway Ingress Controller</li><li>Dynamic allocation of IPs and enhanced subnet support</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvTywYNQd5OPFRJjHQ7BIQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31885220fdfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD pipeline to deploy flask-app on K8s locally]]></title>
            <link>https://medium.com/@ashwin.p.agarkhed/ci-cd-pipeline-to-deploy-flask-app-on-k8s-locally-80d63875dbbd?source=rss-d1d6f7467461------2</link>
            <guid isPermaLink="false">https://medium.com/p/80d63875dbbd</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ashwin Agarkhed]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 06:12:28 GMT</pubDate>
            <atom:updated>2021-09-12T16:02:05.864Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jenkins pipeline to deploy Python app on Kubernetes</h3><p>In this article, I’ll be making use of Github, Jenkins, Docker to deploy a simple flask API on K8s. The image of the dockerized app will be stored on docker hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*8baCzKa3qtf0n26nlxwxsw.png" /></figure><h3>Pre-Requisites</h3><ol><li>Must have minikube installed and running on your system</li><li>Have Jenkins server setup</li><li>Have an account on docker hub and docker installed on your system</li><li>Have code committed to a Github repository.</li></ol><p>Once you are done with all the pre-requisite installation and setup,we can now proceed ahead in deploying the Flask application.</p><h3>Setting up everything step-by-step:-</h3><p>Let’s start by logging into your Jenkins server and set up various things:</p><p>1.) Create a new job and add a description to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*tbPpqIpIJ7n6VWWyv3vMxQ.png" /></figure><p>2.)Add the GitHub repository as shown in the diagram. In this basic demo, I am assuming that the repository is public</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*xsX6U3f-KT6gv3Ey62trww.png" /></figure><p>3.) In build triggers choose PollSCM and enter “* * * * *” in Schedule. This will trigger the build every minute as code is committed to master branch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*tDA-7MQHXDVMJ9AxZQjbCw.png" /></figure><p>4.)In post-build actions, I give executable permissions to run-scripts.sh script, use docker login command to log in to docker, and run the run-scripts.sh script. Please note DOCKERPWD is env variable that I have set in Jenkins.</p><pre>sudo chmod +x run-scripts.sh;${DOCKERPWD} | docker login --username ashwinpagarkhed --password-stdin;./run-scripts.sh</pre><p>command, to login with user id and password. Make sure to enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*gGfjQugWWcFZQ8A_o5wiIQ.png" /></figure><p>The run-scripts.sh looks like this:</p><pre>sudo docker kill $(docker ps -q)<br>sudo docker container rm $(sudo docker ps -a)<br>sudo docker rmi $(docker images -a -q)<br>sudo docker build -t ashwinpagarkhed/image:latest .<br>sudo docker push ashwinpagarkhed/image<br>sudo docker run -d -it -p 5002:5000 -t ashwinpagarkhed/image:latest</pre><p>This scripts stops and removes all containers, removes the old image, and builds the image from the docker file and webapp.war file which is present in the current directory. Then it pushes the image to docker hub and then starts the container . We can access the container at port 5002.</p><p>Dockerfile contents:</p><pre>FROM python:3.6<br>COPY . /app<br>WORKDIR /app<br>RUN pip install -r requirements.txt<br>ENTRYPOINT [&quot;python&quot;]<br>CMD [&quot;hello.py&quot;]</pre><p>After the image is successfully pushed and we see a container running at port 5002, We can proceed to run the following command on our local system:</p><pre>kubectl apply -f resources.yaml</pre><p>the resources.yaml file looks like this:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: webapp<br>spec:<br>  selector:<br>    matchLabels:<br>      app: webapp<br>  replicas: 2<br>  template: #template for the pods<br>    metadata:<br>      labels:<br>        app: webapp<br>    spec:<br>      containers:<br>      - name: webapp-container<br>        image: ashwinpagarkhed/image:latest<br>        resources:<br>          limits:<br>            memory: &quot;128Mi&quot;<br>            cpu: &quot;500m&quot;</pre><pre>---</pre><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: flaskwebapp<br>spec:<br>  selector:<br>    app: webapp<br>  ports:<br>  - name: tcp<br>    port: 5000<br>    targetPort: 5000<br>    nodePort: 30080<br>  type: NodePort</pre><p>We can find the application running at port &lt;minikube IP&gt;:30080.</p><p>To find how to use Prometheus and Grafana to monitor the pods after deploying them, check out the code in the repository:</p><p><a href="https://github.com/agarkhed-DevOpsOrg/cicd-pipeline-k8s-docker-jenkins-flask">GitHub - agarkhed-DevOpsOrg/cicd-k8s-docker-flask: Set up a cicd-pipeline for flask-application using k8s docker jenkins</a></p><p>If any further questions feel free to reach out to me on linkedin: <a href="https://www.linkedin.com/in/ashwinpagarkhed/">Link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80d63875dbbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>