<?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 Raghavendra Bharadwaj on Medium]]></title>
        <description><![CDATA[Stories by Raghavendra Bharadwaj on Medium]]></description>
        <link>https://medium.com/@rbharadwaj16?source=rss-712927172beb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FX-lrQZ80sStu52Y.jpg</url>
            <title>Stories by Raghavendra Bharadwaj on Medium</title>
            <link>https://medium.com/@rbharadwaj16?source=rss-712927172beb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:45:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rbharadwaj16/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[Building Developer Experience using Backstage, Crossplane and ArgoCD — Part 2 (Integration with…]]></title>
            <link>https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argocd-part-2-integration-with-f97cca660d07?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f97cca660d07</guid>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[developer-experience]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Tue, 05 May 2026 16:12:17 GMT</pubDate>
            <atom:updated>2026-05-05T18:35:30.155Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building Developer Experience using Backstage, Crossplane and ArgoCD — Part 2 (Integration with Azure OpenAI)</h3><p>In the previous part of this <a href="https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argocd-part-1-e7ee03ad54e9">article</a>, we looked at building a standard self service workflow using Backstage, Crossplane and ArgoCD. If you haven’t read that, you probably should read the article here, first. In this article, we spice it up a bit by integrating the solution with Azure OpenAI to bring in a conversational AI layer into the stack.</p><p>While the previous setup is still the standard and is also the cleanest setup to start with, the request experience is fairly rigid. In a simple scenario, that is fine. But as the platform grows and the number of resources and parameters increases, the form based approach starts becoming a little less friendly from a developer experience point of view. A developer generally thinks in terms of intent, not in terms of platform parameter names. After all, we are trying to build the best experience for Developers, in the first place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWkqYchHHcYm-AJUxtwp-Q.png" /></figure><p>In continuation to the previous article, we have added an alternate user experience layer, we have integrated Azure OpenAI to enable a chat-based infrastructure provisioning experience. We have created a lightweight FastAPI service called translate-service, to call the model, apply a few guardrails, and return structured parameters to Backstage.</p><p>The user request first reaches translate-service, which uses Azure OpenAI for intent extraction and then passes validated structured parameters back into the existing Backstage-to-Crossplane provisioning flow. The only change is the request experience: instead of filling out a fixed form, the user interacts through a free form request interface in Backstage. These flows are represented in Step 6 and 7 in the diagram.</p><h4>High Level Flow of the AI assisted design</h4><p>The standard form based flow remains exactly the same from the point where Backstage has structured parameters available. The only difference is how those parameters are collected.</p><p>The high level AI assisted flow is as follows:</p><ol><li>The user enters infrastructure request through a free form request field style experience in Backstage.</li><li>Backstage sends the request to a lightweight intermediary service called translate-service.</li><li>translate-service calls Azure OpenAI and asks it to extract the intent and relevant provisioning parameters from the free form request.</li><li>translate-service applies a few lightweight guardrails and normalizes the response into a structured parameter object.</li><li>The structured parameter object is passed back to Backstage.</li><li>Backstage uses those returned values to populate the same XR template as in the standard form based workflow.</li><li>The XR is raised as a pull request to GitHub, after which the same GitOps driven flow continues through ArgoCD and Crossplane exactly as explained in Part-1.</li></ol><h4><strong>Implementation of Azure OpenAI Integration</strong></h4><p>Azure OpenAI is only used here for<strong> </strong>intent extraction. The translate-service uses Azure OpenAI through a deployed model endpoint in Azure AI Foundry. To spin this up it is pretty straight forward, once you login to Azure Foundry, you can choose the model you prefer under “Build” section from a wide array of foundation models to choose from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iAhKtgHS29HLqChkL1Vh2A.png" /></figure><p>Azure OpenAI endpoint, deployment name and API key are injected into the pod through Kubernetes secrets and exposed as environment variables. The FastAPI application reads these values at runtime, calls the model using the Azure OpenAI SDK, and parses the returned JSON before handing the response back into the Backstage workflow.</p><p>Speaking of injecting Azure OpenAI credentials into the application is mostly by defining a Kube secret and injecting these secrets into the translate service deployment. The same is read by python and builds the OpenAI client.</p><pre>stringData:<br>  AZURE_OPENAI_API_KEY: &quot;&lt;replace-me&gt;&quot;<br>  AZURE_OPENAI_ENDPOINT: &quot;https://&lt;your-resource&gt;.openai.azure.com&quot;<br>  AZURE_OPENAI_MODEL: &quot;&lt;replace-me&gt;&quot;</pre><p>translate-service deployment calling in the secrets as env variables:</p><pre>env:<br>  - name: AZURE_OPENAI_API_KEY<br>    valueFrom:<br>      secretKeyRef:<br>        name: translator-service-openai<br>        key: AZURE_OPENAI_API_KEY</pre><p>Python reads them and builds the OpenAI client:</p><pre>AZURE_OPENAI_API_KEY = os.getenv(&quot;AZURE_OPENAI_API_KEY&quot;)<br>AZURE_OPENAI_ENDPOINT = os.getenv(&quot;AZURE_OPENAI_ENDPOINT&quot;)<br>AZURE_OPENAI_MODEL = os.getenv(&quot;AZURE_OPENAI_MODEL&quot;)</pre><pre>client = OpenAI(<br>    api_key=AZURE_OPENAI_API_KEY,<br>    base_url=f&quot;{AZURE_OPENAI_ENDPOINT}/openai/v1/&quot;<br>)</pre><h4>Implementation of translate-service</h4><p>Now, to understand why we need this service we need to understand why not call Azure OpenAI directly from Backstage? The answer is mostly about keeping things clean. If Backstage directly handles things like prompt construction, model calling, response parsing, malformed output, retries, guardrails etc .. then Backstage itself starts becoming tightly coupled to model specific logic. I did not want that. In this setup, Backstage should remain the IdP and workflow layer, not the place where AI specific implementation layer.</p><p>So instead, I introduced a small intermediary service called translate-service. It is implemented in Python using FastAPI and has one narrow purpose:</p><ul><li>accept a free form request</li><li>call Azure OpenAI</li><li>extract structured values</li><li>apply a few light checks</li><li>return the output in a format that Backstage can consume</li></ul><p>This also means that if I later decide to change the model, change the prompt or change the extraction logic, I do not have to contaminate the Backstage side of the implementation.</p><p>The service iself exposes two endpoints:</p><ul><li>/health</li><li>/translate</li></ul><p>The /translate endpoint accepts a payload like below:</p><pre>{<br>  &quot;request&quot;: &quot;create a storage account named backstgtstraghav in eastus in resource group myapp-rg with standard_lrs&quot;<br>}</pre><p>The service then:</p><ol><li>passes the free form request to Azure OpenAI</li><li>asks for a strict JSON response in a known structure</li><li>parses the returned output</li><li>validates the response shape</li><li>normalizes values such as SKU and location</li><li>returns a structured response back to Backstage</li></ol><p>The final response looks like this:</p><pre>{<br>  &quot;resource_type&quot;: &quot;storage_account&quot;,<br>  &quot;parameters&quot;: {<br>    &quot;storageAccountName&quot;: &quot;backstgtstraghav&quot;,<br>    &quot;resourceGroupName&quot;: &quot;myapp-rg&quot;,<br>    &quot;location&quot;: &quot;eastus&quot;,<br>    &quot;sku&quot;: &quot;Standard_LRS&quot;<br>  },<br>  &quot;missing_fields&quot;: [],<br>  &quot;needs_clarification&quot;: false<br>}</pre><p>A rough flow of the service logic is shown below:</p><pre>@app.post(&quot;/translate&quot;)<br>def translate(request_body: dict):<br>    if &quot;request&quot; not in request_body:<br>        raise HTTPException(status_code=400, detail=&quot;Missing &#39;request&#39; in body&quot;)<br><br>    user_request = request_body[&quot;request&quot;]<br><br>    extracted_data = extract_intent_from_ai(user_request)<br>    errors = validate_extracted_data(extracted_data)<br><br>    translation_response = None<br><br>    if len(errors) == 0:<br>        translation_response = build_translation_response(extracted_data)<br><br>    return {<br>        &quot;user_request&quot;: user_request,<br>        &quot;extracted_data&quot;: extracted_data,<br>        &quot;errors&quot;: errors,<br>        &quot;translation&quot;: translation_response<br>    }</pre><p>The entire code repo can be found here: <a href="https://github.com/rbharadwaj16/platform-apps/tree/main/translator-service">https://github.com/rbharadwaj16/platform-apps/tree/main/translator-service</a></p><h4><strong>Backstage Integration</strong></h4><p>Once the translator service was working, the next step was to integrate it into Backstage. For the standard template, the user directly filled the parameters in the template form. For the AI assisted version, I created a custom scaffolder action in the Backstage backend that calls translate-service and returns the extracted parameters back into the template flow.</p><p>The custom action is registered in the Backstage backend and exposed under an action ID like:</p><pre>ace:translator:run</pre><p>The action accepts a single input: requestText . Along with that, I also pass expectedResourceType such as storage_account as a lightweight hint so that the translator layer knows what type of platform resource it is expected to interpret.</p><p>Internally, it POSTs the input to the translator service, receives the structured response, and exposes the returned parameters to later scaffolder steps.</p><p>Now, coming to the scaffolder template itself, it is very similar to the “non AI” version of the template except that instead of asking the user to fill storageAccountName, resourceGroupName, location and sku through separate fields, it accepts one free form input such as requestText.</p><p>In the steps section, the first step is translatorRun, which uses the custom scaffolder action ace:translator:run. This is the point where Backstage sends the user’s free form request to translate-service. The translate-service calls Azure OpenAI, extracts the relevant parameters from the request, applies a few lightweight checks, and returns structured values back to Backstage.</p><p>Once translatorRun finishes, the next step, generateXr, works exactly like in the standard template. It uses fetch:template to render the same reusable xr.yaml skeleton, except that the values now come from steps.translatorRun.output.parameters.* instead of directly from fixed form fields.</p><p>So in short, translatorRun is the step that bridges the free form user request to the standard Backstage-to-Crossplane provisioning flow. After that step returns structured values, the rest of the flow remains the same: Backstage generates the XR, raises the PR, ArgoCD detects the change, and Crossplane provisions the actual resource.</p><pre>apiVersion: scaffolder.backstage.io/v1beta3<br>kind: Template<br>metadata:<br>  name: azure-storage-account-ai<br>  title: Azure Storage Account AI Assisted<br>  description: Provision an Azure Storage Account via Crossplane using natural language<br>  tags:<br>    - azure<br>    - storage<br>    - crossplane<br>    - ai<br>spec:<br>  owner: platform-team<br>  type: infrastructure<br><br>  parameters:<br>    - title: Storage Account Request<br>      required:<br>        - requestText<br>      properties:<br>        requestText:<br>          title: Describe what you want<br>          type: string<br>          description: Example - create a storage account named backstgtstraghav in eastus in resource group myapp-rg with standard_lrs<br>          ui:autofocus: true<br><br>  steps:<br>    - id: translatorRun<br>      name: Translate natural language request<br>      action: ace:translator:run<br>      input:<br>        requestText: ${{ parameters.requestText }}<br>        expectedResourceType: storage_account<br><br>    - id: generateXr<br>      name: Generate Crossplane XR Manifest<br>      action: fetch:template<br>      input:<br>        url: ./skeleton<br>        values:<br>          storageAccountName: ${{ steps.translatorRun.output.parameters.storageAccountName }}<br>          resourceGroupName: ${{ steps.translatorRun.output.parameters.resourceGroupName }}<br>          location: ${{ steps.translatorRun.output.parameters.location }}<br>          sku: ${{ steps.translatorRun.output.parameters.sku }}<br><br>    - id: publish<br>      name: Raise PR to Platform Repo<br>      action: publish:github:pull-request<br>      input:<br>        repoUrl: github.com?repo=platform-infra&amp;owner=rbharadwaj16<br>        title: &quot;feat: provision storage account ${{ steps.translatorRun.output.parameters.storageAccountName }}&quot;<br>        branchName: &quot;storage-${{ steps.translatorRun.output.parameters.storageAccountName }}&quot;<br>        description: |<br>          ## New Azure Storage Account Request<br><br>          | Field | Value |<br>          |-------|-------|<br>          | Name | ${{ steps.translatorRun.output.parameters.storageAccountName }} |<br>          | Resource Group | ${{ steps.translatorRun.output.parameters.resourceGroupName }} |<br>          | Location | ${{ steps.translatorRun.output.parameters.location }} |<br>          | SKU | ${{ steps.translatorRun.output.parameters.sku }} |<br>        targetPath: platform-core/crossplane/xrs/dev/${{ steps.translatorRun.output.parameters.storageAccountName }}<br><br>  output:<br>    links:<br>      - title: Pull Request<br>        url: ${{ steps.publish.output.remoteUrl }}<br>        icon: github</pre><p>Now that we have everything ready, let’s look at this flow in action:</p><ol><li>Choose the AI assisted Storage account creation template and I give a casual prompt as below:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9KkiUgUPywLttNiQpSLug.png" /></figure><p>2. The request is translated and the intent is extracted. You can see that the values has been clearly extracted as seen in the Logs below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhV3DZzAbK0osJJtDHwnaw.png" /></figure><p>3. A PR is raised exactly like standard flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*rQWItffquFCxuAFe9elPqQ.png" /></figure><p>4. The provisioning kicks off via ArgoCD:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNOB8d35ydNIw4CK5nEHKA.png" /></figure><p>5. Finally, the resource is provisioned on Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPEHlJfZVpe7ih9WC45ufQ.png" /></figure><p><strong>Things to improve from here</strong></p><p>A few obvious improvements can be made to take this further.</p><p>First, the current translate-service is intentionally kept thin and focused only on extraction plus light validation. Over time, this can be improved to better handle ambiguities, partial requests, and missing values in a more guided manner instead of simply returning a clarification state.</p><p>Second, the current implementation is focused on a small set of infrastructure resources for demonstration. The same pattern can be extended to cover more resource types such as AKS clusters, databases, networking constructs and other opinionated platform APIs exposed through Crossplane.</p><p>Third, the current AI layer is mainly geared towards intent extraction. This can be extended to support richer conversational workflows such as recommending valid options, helping users choose between templates, or pre-validating requests before they enter the standard GitOps flow.</p><p>Fourth, stronger production hardening can be added around the translator layer itself, such as better response validation, improved observability, tighter retry/error handling, and more explicit policy boundaries so that the AI integration remains a thin convenience layer rather than slowly becoming another control plane.</p><p>Lastly, the user experience in Backstage can be improved further by combining both models: standard forms for users who already know what they want, and conversational inputs for users who prefer starting with intent.</p><p>That would make the platform more flexible without compromising the underlying governance model.</p><p>To wrap up this series of articles, like I mentioned earlier, this solution is by no means “perfect” and there is still a lot of room to improve it. As Steve Jobs once said — <em>“You’ve got to start with the customer experience and work backwards to the technology.”</em> In our case, Developers are the customers, and Platform Engineering should always be treated as a true north star in making the SDLC smoother and reduce friction as less as possible for them. Whether it is with AI, without AI, or through the broader set of tools used in this solution, the objective remains the same: Solve real developer problems in a practical way. This series was only an honest attempt to provide a glimpse into the world of building DevEx platforms and what it truly means to bridge the gap between Development and Operations. Platform Engineering, FTW!</p><p>Codebase for Crossplane, ArgoCD and Kustomize manifests: <a href="https://github.com/rbharadwaj16/platform-infra">https://github.com/rbharadwaj16/platform-infra</a><br>Codebase for Backstage and translate-service: <a href="https://github.com/rbharadwaj16/platform-apps">https://github.com/rbharadwaj16/platform-apps</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f97cca660d07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Developer Experience using Backstage, Crossplane and ArgoCD — Part 1]]></title>
            <link>https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argocd-part-1-e7ee03ad54e9?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7ee03ad54e9</guid>
            <category><![CDATA[crossplane]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Mon, 04 May 2026 15:32:02 GMT</pubDate>
            <atom:updated>2026-05-04T15:32:02.362Z</atom:updated>
            <content:encoded><![CDATA[<p>In the previous <a href="https://medium.com/@rbharadwaj16/platform-engineering-the-time-is-now-5666e48584c4">article</a>, we understood different disciplines of Platform Engineering. One of the core disciplines deals with building high quality Developer Experience within the Organisation.</p><p>In this article, I try to give a walkthrough on building an Enterprise grade Developer focused Self service solution using Backstage as the IdP, CrossPlane as Kube managed control plane, ArgoCD as the CD orchestrator and a few other ancillary services such as Azure OpenAI for backing the system to understand conversation type provisioning.</p><p><strong>Our Tech Stack/prereqs:</strong></p><ol><li>ArgoCD: Is continuous delivery tool that follows GitOps methodolgy, wherein it constantly polls Git repo for any changes and immediately syncs the application state to that of git repo, thus using git as the single source of truth.</li><li>Backstage: Is a CNCF incubating (at the time of writing) project that provides an open source framework to create custom IdP. It’s written mostly in typescript allows you to create custom catalogs that can be integrated various tools to create a seamless self service workflow.</li><li>Crossplane: Crossplane is a framework to build control planes for platform engineering. It allows you to define your own Infra stack as custom CRD’s, and expose it for external consumption just like an API.</li><li>AKS Cluster: Is our hosting platform which is Azure Kubernetes service. We host all these above tools/controllers on AKS. For the demonstration purposes of this article, all the apps are hosted on the same AKS cluster.</li><li>GitHub: Is our code repo for this demo.</li><li>Azure OpenAI: Provides OpenAI integration for our solution via Azure’s added Enterprise grade security.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1D0Nw59boeooreORaRS-w.png" /></figure><p><strong>High Level Flow of the Design:</strong></p><p>1) Developer selects/chooses appropriate configurations in the self service self service catalog within Backstage</p><p>2) Backstage takes the user inputs, injects them into the XR template, and generates the final XR manifest. The same is raised as a PR into GitHub. Once the PR is reviewed and approved, ArgoCD takes over.</p><p>3) ArgoCD is configured to poll github repo as an Argo Application. It constantly polls the repo and keeps the target state (crossplane definitions) in sync with git.</p><p>4) Any changes to the repo/specific paths, will force ArgoCD to reconcile crossplane configuration and deploy into target cluster per GitOps principles.</p><p>5) Crossplane deploys desired infrastructure as a managed resource in the target cloud and in this particular case it’s Azure. ArgoCD reconciles drift between Git and the in-cluster desired manifests, while Crossplane reconciles drift between the Kubernetes resource definition and the actual cloud resource in Azure.<strong>Implementation Specifics</strong></p><p>Now that we have a fair bit of idea on how the solution works, let’s dive deep to understand the inner workings of the implementation itself and understand a bit of the code and configurations to get the solution working.</p><p>In the interest of keeping the article crisp, I will focus only on the relevant configurations and will work with the assumption that an intermediate level of Kubernetes, Kustomize and ArgoCD understanding already exists for the readers. As a general guideline to the entire implementation, Kustomize is used as the default manifest CM. The entire codebase repo is share at the end.</p><ol><li><strong>ArgoCD Implementation</strong></li></ol><p>ArgoCD has a rich OOTB support to install and configure it on Kubernetes, in several ways ranging from a multi tenant, HA modes to simple core binary installation. It can also be installed with Kustomize or by using Helm. As mentioned earlier, I have used Kustomize throughout the solution. While you could directly apply the <a href="https://github.com/argoproj/argo-cd/blob/master/manifests/namespace-install.yaml"><em>https://github.com/argoproj/argo-cd/blob/master/manifests/namespace-install.yaml</em></a>, I like to split out configurations explicitly to gain more control over how each component of ArgoCD and to exploit it’s behaviour. The git tree for ArgoCD is as follows:</p><pre>argocd<br>├── apps<br>│   ├── base<br>│   │   ├── argo-projects<br>│   │   │   ├── 01-platform-repository-secret.yaml<br>│   │   │   └── 02-platform-project.yaml<br>│   │   └── kustomization.yaml<br>│   └── overlays<br>│       └── dev<br>│           ├── 01-platform-appset.yaml<br>│           └── kustomization.yaml<br>└── bootstrap<br>    ├── base<br>    │   ├── 01-argo-namespace.yaml<br>    │   ├── 02-argo-crd.yaml<br>    │   ├── 03-argo-sa.yaml<br>    │   ├── 04-argo-role-clusterrole.yaml<br>    │   ├── 05-argo-rolebinding-clusterbinding.yaml<br>    │   ├── 06-argo-cm-secret.yaml<br>    │   ├── 07-argo-service.yaml<br>    │   ├── 08-argo-deployment.yaml<br>    │   ├── 09-statefulset.yaml<br>    │   ├── 10-argo-networkpolicy.yaml<br>    │   └── kustomization.yaml<br>    └── overlays<br>        └── dev<br>            ├── 01-argo-app-root.yaml<br>            └── kustomization.yaml</pre><p>“Bootstrap” folder has everything to create an ArgoCD from scratch while “Apps” folder has what it takes to run an “App of Apps” to maintain the argocd itself. To avoid digressing from the core topic building and IdP, I won’t focus on the “apps” folder but will explain a bit about the “bootstrap” folder.</p><p>My base folder of Kustomize refers to all the ArgoCD manifests that are mostly env agnostic while the overlays folder contains few env specific configurations as show below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/288514c6a0b89dd4ad8f4836fd9f6c04/href">https://medium.com/media/288514c6a0b89dd4ad8f4836fd9f6c04/href</a></iframe><p>In the overlay section, I override one of the base config to expose my ArgoCD server service over a LoadBalancer svc. While as a best practice, I should be using Ingress, for demo purposes, I am direcly exposing the svc as a LB. This should pretty much get the argocd up and running, accessible on a web browser.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ebb860926a3151f10864638fb4ebfaa/href">https://medium.com/media/7ebb860926a3151f10864638fb4ebfaa/href</a></iframe><p>Once the above is done, you should be setting up a hook to the repository, project in your argocd which can be done through argo manifests or CLI or clickOps depending on your preference. In our demo, we have a “dev” project and repository hooked up as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lPWdbNtGm4AEzWYV0jaZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvkw6hEAghJLmip4mYE1EA.png" /></figure><p>This should pretty much complete the basic configurations of ArgoCD needed to get our demo going. Next, we look at Crossplane.</p><p><strong>2. Crossplane Implementation</strong></p><p>Crossplane, as mentioned earlier is the framework to build platform Infrastructure as API’s and manage them through a Kubernetes Control plane just like how you would manage other K8’s resources. Before we get to the implementation part, let’s understand basic abstractions of a crossplane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*dZlMQj9A5-LZrHsBZOMHNQ.png" /></figure><p>The 3 main abstractions to understand are:</p><p><strong>Composite Resource Definition</strong>, in short known as XRD is the skeleton for the API. We define the schema for how the API needs to look like. Think of this as writing your own CRD except not from the ground up but via Crossplane abstraction and a simple YAML file.</p><p><strong>Composition</strong>, as the name suggests is used to compose different resource API’s into one single “stack” of resources. The fundamental idea here is, you deploy small collective stacks of resources within an env, rather than independent deployments. An example to better understand this is: In a scenario where you want to onboard a customer in a multi tenancy architecture, each customer may want their own Nodepools, Databases etc .. and these can be deployed as one single stack.</p><p><strong>Composite Resource, </strong>in short known as XR is the actual target cloud resource itself that is managed as a Kubernetes object within the cluster.</p><p>To summarize, as a platform team, we can define heavily opinionated XRD’s and Composition so that governance and security is built in by design, while allowing the Developers to create Composite resource by selecting appropriate values on the IdP and that payload gets converted into actual XR definition file.</p><p>Now that we have a fair bit of understanding on the Crossplane objects, let’s look at how to set it up.</p><p>Per usual, I’ve used Kustomize and below is the git tree:</p><pre>platform-core/crossplane<br>├── base<br>│   ├── 01-crossplane-ns.yaml<br>│   ├── 02-crossplane-argo-app.yaml<br>│   ├── 03-crossplane-provider-functions.yaml<br>│   ├── compositions<br>│   │   ├── composition-aks.yaml<br>│   │   └── composition-storageaccount.yaml<br>│   ├── kustomization.yaml<br>│   └── xrd<br>│       ├── xrd-aks.yaml<br>│       └── xrd-storageaccount.yaml<br>├── overlays<br>│   └── dev<br>│       ├── 01-crossplane-argo-app-patch.yaml<br>│       ├── 02-crossplane-providerconfig.yaml<br>│       ├── 03-crossplane-xr-argo-app.yaml<br>│       └── kustomization.yaml<br>└── xrs<br>    └── dev<br>        └── backstgtstraghav<br>            └── xr.yaml</pre><p>First, The Crossplane itself is installed via Helm chart which is defined in within as Argo Application:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9ab79a863c096acbdd8c79f71ea701c/href">https://medium.com/media/b9ab79a863c096acbdd8c79f71ea701c/href</a></iframe><p>In this example, let’s look at how to provision an Azure Storage account by defining the XRD, Composition and the XR. The repo also shows definitions of an AKS cluster that we will cover in the later section of the article.</p><p>Before writing the Crossplane definitions, we have to install a few providers into the cluster so that they interpret crossplane definitions into Kube manageble cloud resources.</p><p>If you are someone who has worked on terraform, you would have used cloud specific providers such as “azurerm”. Similarly, in crossplane, we first need to install Azure provider and a few more dependencies before Crossplane starts provisioning resources. They are as follows:</p><p>Azure provider is a generic provider that can be installed to manage Azure resources. It is as shown below:</p><pre>apiVersion: pkg.crossplane.io/v1<br>kind: Provider<br>metadata:<br>  name: upbound-provider-family-azure<br>spec:<br>  package: xpkg.upbound.io/upbound/provider-family-azure:v2.5.4</pre><p>Azure storage provider can be used for more granular access to “storage” focused objects:</p><pre>apiVersion: pkg.crossplane.io/v1<br>kind: Provider<br>metadata:<br>  name: upbound-provider-azure-storage<br>spec:<br>  package: xpkg.upbound.io/upbound/provider-azure-storage:v2.5.4</pre><p>We also need to configure credentials handler so that Crossplane can talk to Azure. We do it via “ProviderConfig” or “ClusterProviderConfig” depending on the scope. First, create a Service prinicpal with contributor access on the subscription and create a Kube secret in the “crossplane-system” namespace as below:</p><pre>{<br>  &quot;clientId&quot;: &quot;service-prinicpal-clientID&quot;,<br>  &quot;clientSecret&quot;: &quot;service-prinicpal-clientID-secret&quot;,<br>  &quot;subscriptionId&quot;: &quot;subscription-id&quot;,<br>  &quot;tenantId&quot;: &quot;tenant-id&quot;<br>}</pre><p>Once the above is done, you can refer the above secret in the “ClusterProviderConfig” as shown below:</p><pre>apiVersion: azure.m.upbound.io/v1beta1<br>kind: ClusterProviderConfig<br>metadata:<br>  name: default<br>  annotations:<br>    argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true<br>spec:<br>  credentials:<br>    source: Secret<br>    secretRef:<br>      namespace: crossplane-system<br>      name: azure-spn-secret   <br>      key: creds  </pre><p>Lastly, we also need a crossplane function that we use in the later section of the article to stitch the inputs of the XR to the actual definition of the resource. We use a function called as “patch-and-transform” and is installed via:</p><pre>apiVersion: pkg.crossplane.io/v1beta1<br>kind: Function<br>metadata:<br>  name: upbound-function-patch-and-transform<br>spec:<br>  package: xpkg.upbound.io/upbound/function-patch-and-transform:v0.10.1</pre><p>The above will give us some bare minimum configurations necessary to operate a crossplane environment successfully. Next, we define our XRD, composition and XR needed to provision a storage account.</p><p><strong>Storage Account XRD:</strong></p><pre>apiVersion: apiextensions.crossplane.io/v2<br>kind: CompositeResourceDefinition<br>metadata:<br>  name : xstorageaccounts.storage.aceplatform.org<br>  # annotations:<br>  #   argocd.argoproj.io/sync-wave: &quot;1&quot;  <br>spec:<br>  scope: Namespaced<br>  group: storage.aceplatform.org<br>  names:<br>    kind: XStorageAccount<br>    plural: xstorageaccounts<br>  defaultCompositionRef:<br>    name: azure-storage-account<br>  versions:<br>    - name: v1alpha1<br>      served: true<br>      referenceable: true<br>      schema:<br>        openAPIV3Schema:<br>          type: object<br>          properties:<br>              spec:<br>                type: object<br>                required:<br>                  - parameters<br>                properties:<br>                  parameters:<br>                    type: object<br>                    required:<br>                      - storageAccountName<br>                      - resourceGroupName<br>                      - location<br>                    properties:<br>                      storageAccountName:<br>                        type: string<br>                        description: Name of the Azure Storage Account<br>                        maxLength: 24<br>                        minLength: 3<br>                        pattern: &#39;^[a-z0-9]+$&#39;<br>                      resourceGroupName:<br>                        type: string<br>                        description: Azure Resource Group to deploy into<br>                      location:<br>                        type: string<br>                        description: Azure region<br>                        enum:<br>                          - eastus<br>                          - westus<br>                          - westeurope<br>                          - uksouth<br>                      sku:<br>                        type: string<br>                        description: Storage account SKU<br>                        default: Standard_LRS<br>                        enum:<br>                          - Standard_LRS<br>                          - Standard_GRS<br>                          - Premium_LRS                      <br><br></pre><p>Just like how any Kube object is defined, the same structure is followed by defining <em>apiVersion, kind, metadata </em>and it’s<em> spec.</em></p><p>The <em>apiVersion, kind, metadata </em>are self explainatory for anyone in Kube world, so I will focus more on the <em>spec</em> itself.</p><p>Starting from V2 Crossplane, a resource can be namespaced, so we define the scope of the object followed by grouping the XRD into “storage” API class by defining it as “storage.aceplatform.org”. This can be anything but it’s important to structure it well. In our case, platform is creating its own Kubernetes API under the storage domain of <em>aceplatform.org</em>. When a user creates a storage account, they do not directly use the Azure provider API. Instead, they use our platform API:</p><pre>apiVersion: storage.aceplatform.org/v1alpha1</pre><p>The apiVersion is built from two parts:&lt;group&gt;/&lt;version&gt;</p><p>So in our case:storage.aceplatform.org/v1alpha1</p><p>This is important because it turns infrastructure into a product-like platform interface. The group tells users: “This resource belongs to the ACE platform’s storage API.” Similarily you can create API’s for “Compute”, “Network” etc .. Also, as you may notice, we have defined our API as “valpha1” which typically represents a very initial version of the API that can be unstable, whereas &quot;v1beta1&quot; represents an existing API that’s considered stable and breaking changes are strongly discouraged. v1 — Is a stable API that doesn’t have breaking changes.</p><p>Now, coming to the schema itself, it follows openAPIV3 standards and we have defined that “name of the SA”, “name of the RG” and “location” are mandatory params and have defined constrains against each of these param such as the data type, length of the string, accepted locations etc ..</p><p><strong>Storage Account Composition:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e3197218dda42cd5821ec87b79f5fb9/href">https://medium.com/media/1e3197218dda42cd5821ec87b79f5fb9/href</a></iframe><p>Like explained earlier, a composition basically stitches together multiple resources into one deployable stack. We first refer the XRD defined in the first step and next we use a “patch-and-transform” function that is installed seperately as we did earlier. The function maps the actual params passed from the XR to the underlying managed resource.</p><p><strong>Storage Account Composite Resource:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57d03daef3e9c41a53fb422b3a35121a/href">https://medium.com/media/57d03daef3e9c41a53fb422b3a35121a/href</a></iframe><p>Last is the actual XR itself and is pretty straight forward. We define the “actual values” that are defined in our XRD and mapped in our composition. In our example, we are passing sa name, rg name, location and the SKU. While the above file can be written like and XRD and composition, we ideally want this file dynamically generated by the IdP based on the values passed in the UI of the IdP and this exactly what we look at next.</p><p><strong>3. Backstage Implementation</strong></p><p>Getting the backstage up and running is a bit trickier than Crossplane/ArgoCD as you have to build the application by making the necessary configurations and customizations. Backstage also needs a Database to be running and for the application to be having an unimpeded connectivity to the DB.</p><p>Per usual, below is the git tree for backstage:</p><pre>platform-apps/backstage/<br>|-- app-config.yaml<br>|-- app-config.production.yaml<br>|-- backstage.json<br>|-- catalog-info.yaml<br>|-- package.json<br>|-- tsconfig.json<br>|-- yarn.lock<br>|-- playwright.config.ts<br>|-- examples/<br>|   |-- entities.yaml<br>|   |-- org.yaml<br>|   `-- template/<br>|       |-- template.yaml<br>|       |-- content/<br>|       |   |-- catalog-info.yaml<br>|       |   |-- index.js<br>|       |   `-- package.json<br>|       `-- azure/<br>|           |-- aks-cluster/<br>|           |   |-- aks-cluster-standard-template.yaml<br>|           |   |-- aks-cluster-ai-template.yaml<br>|           |   `-- skeleton/<br>|           |       `-- xr.yaml<br>|           `-- storage-account/<br>|               |-- storage-account-standard-template.yaml<br>|               |-- storage-account-ai-template.yaml<br>|               `-- skeleton/<br>|                   `-- xr.yaml<br>|-- packages/<br>|   |-- app/<br>|   |   |-- package.json<br>|   |   |-- public/<br>|   |   |-- e2e-tests/<br>|   |   |   `-- app.test.ts<br>|   |   `-- src/<br>|   |       |-- App.tsx<br>|   |       |-- App.test.tsx<br>|   |       |-- apis.ts<br>|   |       |-- index.tsx<br>|   |       |-- setupTests.ts<br>|   |       `-- components/<br>|   |           |-- Root/<br>|   |           |-- catalog/<br>|   |           |   `-- EntityPage.tsx<br>|   |           `-- search/<br>|   |               `-- SearchPage.tsx<br>|   `-- backend/<br>|       |-- Dockerfile<br>|       |-- package.json<br>|       `-- src/<br>|           |-- index.ts<br>|           `-- scaffolderTranslator.ts<br>`-- plugins/<br>    `-- README.md</pre><p>Here is a detailed instruction on getting started with building the app itself:</p><p><a href="https://backstage.io/docs/getting-started/">https://backstage.io/docs/getting-started/</a>. The starter layout seen above gets created when you run:</p><pre>npx @backstage/create-app@latest</pre><p>Once done, setup postgres DB as discussed here: <a href="https://backstage.io/docs/deployment/k8s#creating-the-postgresql-database">https://backstage.io/docs/deployment/k8s#creating-the-postgresql-database</a><br>In order to keep the article simple, I am not going to explain every file, however, understand that <em>app-config-production.yaml </em>has the active configurations for the app and this is where you override the DB credentials created as secret, as shown below:</p><pre>app:<br>  # Should be the same as backend.baseUrl when using the `app-backend` plugin.<br>  baseUrl: http://localhost:7007<br><br>backend:<br>  # Note that the baseUrl should be the URL that the browser and other clients<br>  # should use when communicating with the backend, i.e. it needs to be<br>  # reachable not just from within the backend host, but from all of your<br>  # callers. When its value is &quot;http://localhost:7007&quot;, it&#39;s strictly private<br>  # and can&#39;t be reached by others.<br>  baseUrl: http://localhost:7007<br>  # The listener can also be expressed as a single &lt;host&gt;:&lt;port&gt; string. In this case we bind to<br>  # all interfaces, the most permissive setting. The right value depends on your specific deployment.<br>  listen: &#39;:7007&#39;<br><br>  # config options: https://node-postgres.com/apis/client<br>  database:<br>    client: pg<br>    connection:<br>      host: ${BACKSTAGE_DB_HOST}<br>      port: ${BACKSTAGE_DB_PORT}<br>      user: ${BACKSTAGE_DB_USER}<br>      password: ${BACKSTAGE_DB_PASSWORD}<br>      database: ${BACKSTAGE_DB_NAME}<br><br>integrations:<br>  github:<br>    - host: github.com<br>      token: ${GITHUB_TOKEN}<br><br>scaffolder:<br>  defaultAuthor:<br>    name: Backstage<br>    email: backstage@aceplatform.org<br>  defaultCommitMessage: &quot;feat: provision infrastructure via Backstage&quot;<br><br><br>auth:<br>  providers:<br>    guest:<br>      dangerouslyAllowOutsideDevelopment: true<br><br>kubernetes:<br>  serviceLocatorMethod:<br>    type: multiTenant<br>  clusterLocatorMethods:<br>    - type: config<br>      clusters: []<br><br>catalog:<br>  # Overrides the default list locations from app-config.yaml as these contain example data.<br>  # See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details<br>  # on how to get entities into the catalog.<br>  locations:<br>    # Local example data, replace this with your production config, these are intended for demo use only.<br>    # File locations are relative to the backend process, typically in a deployed context, such as in a Docker container, this will be the root<br>    - type: file<br>      target: ./examples/entities.yaml<br><br>    # Local example template<br>    - type: file<br>      target: ./examples/template/template.yaml<br>      rules:<br>        - allow: [Template]<br><br>    #Azure SA template<br>    - type: file<br>      target: ./examples/template/azure/storage-account/storage-account-standard-template.yaml<br>      rules:<br>        - allow: [Template]<br><br>    # Azure SA AI-assisted template<br>    - type: file<br>      target: ./examples/template/azure/storage-account/storage-account-ai-template.yaml<br>      rules:<br>        - allow: [Template]<br><br>    # Azure AKS standard template<br>    - type: file<br>      target: ./examples/template/azure/aks-cluster/aks-cluster-standard-template.yaml<br>      rules:<br>        - allow: [Template]<br><br>    # Azure AKS AI-assisted template<br>    - type: file<br>      target: ./examples/template/azure/aks-cluster/aks-cluster-ai-template.yaml<br>      rules:<br>        - allow: [Template]<br><br>    # Local example organizational data<br>    - type: file<br>      target: ./examples/org.yaml<br>      rules:<br>        - allow: [User, Group]</pre><p>We focus next on building the scaffolder templates themselves. These are the templates that are defined as a backstage interpretation using YAML. As you can see above, I have referred to <em>/examples/template/azure/storage-account/storage-account-standard-template.yaml </em>which is going to be the actual template that comes up on the UI. Below is the snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d14afbd0380105dfa7f008690940934/href">https://medium.com/media/3d14afbd0380105dfa7f008690940934/href</a></iframe><p>At the top, the template is defined as a scaffolder.backstage.io/v1beta3 Template, which makes it available in Backstage’s Software Templates catalog. Under spec, the template we define that this is owned by the platform team and categorized as infrastructure, which makes it clear that this is not an application bootstrap template but a platform provisioning workflow. The parameters section defines the user input form. This is the part the user sees in Backstage. In this case, the form captures the key inputs required to provision a storage account: the sa name, the target rg, the region, and the SKU.</p><p>The steps section is where the actual scaffolder workflow happens. The first step, generateXr, uses fetch:template to render a Crossplane XR manifest from a <em>skeleton</em> directory. This has to be exactly similar to the XR we defined earlier defined in crossplane section. Rather than constructing the resource inline, Backstage takes the values entered in the form and injects them into a reusable xr.yaml template stored under ./skeleton. Below is the skeleton template:</p><pre>apiVersion: storage.aceplatform.org/v1alpha1<br>kind: XStorageAccount<br>metadata:<br>  name: ${{ values.storageAccountName }}<br>  namespace: default<br>  annotations:<br>    argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true<br>spec:<br>  parameters:<br>    storageAccountName: ${{ values.storageAccountName }}<br>    resourceGroupName: ${{ values.resourceGroupName }}<br>    location: ${{ values.location }}<br>    sku: ${{ values.sku }}</pre><p>As said above, it’s exactly same to the crossplane XR defined earlier, except that we have parameterised the values so that backstage can inject them dynamically by accepting params from the Catalog form.</p><p>The second step, publish, uses publish:github:pull-request to raise a pull request into the platform infrastructure repository. Backstage generates the desired manifest of XR and submits it through Git. This is exactly the GitOps driven workflow we talk about where every change being driven through git thus giving the platform team traceability, and allows Argo CD and Crossplane to handle reconciliation.</p><p>Finally, the output section exposes a link back to the pull request so that the requester can immediately see the result of the scaffolder run.</p><p>Now that we have all the configurations in place, let’s look at the entire workflow in action:</p><ol><li>Backstage Template UI showing the catalogs created, as shown below:</li></ol><p>Note: I also have a few templates driven through chat based interface integrated to Azure OpenAI which we will discuss in Part-3 of this writeup</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*opsQepttTg23XxDJXBUB0g.png" /></figure><p>2. Once you choose the template “Azure Storage Account Standard”, you will be greeted with the below page. As you can see, we can type in the sa name and rg name while location and SKU are drop down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZHtRAQ8ScGHGJ1rzFxnEA.png" /></figure><p>3. A final review page to evaluate the options put in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*28kgldqWuhwGeDmmzihb0w.png" /></figure><p>4. The scaffolder template accepts the params, creates an XR dynamically per out templatized definition and raises a PR against the repo. The PR link is also seen in the below snip:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSIUC1G7stIEvy90XW0HZw.png" /></figure><p>5. It creates a PR against the repo with a clear commit message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*p5z4xJbD5ppS7qymRQzz5A.png" /></figure><p>6. The ArgoCD which is polling for any changes recognizes the change and starts syncing the environment to manifest desired state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-SYmnKUyQfuCv4ujm60yA.png" /></figure><p>7. Storage Account created successfully on Azure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3cEiX5F84wlhV2axeQcpbQ.png" /></figure><p>8. A snip to show all apps deployed via ArgoCD:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4D0eSeCTvumdUVZCLtqYfQ.png" /></figure><p>Now that we have this setup and running, let’s look at how we can integrate Azure OpenAI to bring in a conversational style provisioning instead of statically choosing resources. That’s for Part-2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7ee03ad54e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Platform Engineering — The time is now!]]></title>
            <link>https://medium.com/@rbharadwaj16/platform-engineering-the-time-is-now-5666e48584c4?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5666e48584c4</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[crossplane]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Mon, 04 May 2026 15:30:37 GMT</pubDate>
            <atom:updated>2026-05-07T07:55:50.927Z</atom:updated>
            <content:encoded><![CDATA[<p>About a decade ago, if you asked anyone in the IT landscape what DevOps really was, you would get answers ranging from “Developer + Operations being done by the same person” — to — “Automation + CI/CD pipelines” — to — “enabling a cultural shift by removing silos between Developers and Operations” — depending on the persona you spoke to. For me ? it’s a combination of all of the above, but essentially it’s about People, Process, and Technology coming together with as less fricition as possible. How much of it was truly achieved — or rather, how much of it was truly viable to achieve — has always been a big question that constantly bothers tech leadership, Architects and the broader engineering community in any enterprise.</p><p>Fast forward to today, and I believe we have never been closer to achieving that perfect harmony between Development and Operations than we are right now — and that is exactly where Platform Engineering comes into play!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1GL41f-XuIkydNqQDho4A.png" /></figure><blockquote><em>In my view</em>: Platform Engineering is a style of engineering practice that brings together set of tools, standards and workflows that can be seamlessly self served by Developers to support their entire SDLC and beyond, wherein the entire framework is driven with a “Product mindset”.</blockquote><p>As more cloud native solutions take shape, specially in the world of AI where technology transformation is getting rapidly accelerated, it becomes all the more important to standardize your tech stack, enforce governance at scale, enable software engineering teams to self serve and enhance the overall time to market! Let’s understand how Platform engineering helps achieve all these (and more) by understanding different disciplines of Platform Engineering..</p><ol><li>Infrastructure Platform Engineering (IPE): This discipline of PE focuses on standardizing infrastructure component designs and it’s associated features, a simple yet robust workflow to deploy and configure these infra along with enforcing governance at scale while at it, look at it as building a product.</li><li>DevEx Platform Engineering (DevEx): This discipline of PE focuses heavily on building self service ecosystem, predominantly using Internal Developer Platforms (IdP’s). While IPE team’s build the “backend” of the ecosystem, the DevEx team focuses on building “frontend”, “systems integration” with the backend system. DevEx team also builds measurement mechanisms to improve feedback loop between dev and platform teams.</li><li>Platform Product Management (PPM): This discipline of PE is a classic product management take on platform engineering. This layer is expected to upheld and echo the sentiments of building the overall experience as a “Platform”. This discipline is expected to bridge the gap that generally exists between what the platform team builds vs what the developers actually want! PPM is responsible also for adoption of PE as a practice across organization. This team is supposed to work along with the leadership team to propagate a unified PE voice.</li><li>Platform Engineering Leadership (HOPE): Well, this is more of an individual in most organizations than a whole team, but it can very well be a team too depending on how large the enterprise is. As the name suggests, this is pretty much a leadership role who essentially ties the success of PE to the larger business goals. They work with other Senior leadership in the org such as CxOs, VPs etc .. and work as highest levels of advocates within the org to adopt PE. Beyond this, it is important for this role to focus on ensuring tangible ROI on the overall PE initiative.</li></ol><p>Beyond these core disciplines, as any modern methodology, PE is evolving to adopt and meet the demands of ever evolving IT landscape which has given rise to several other disciplines such as Security Platform Engineering, Observability Platform Engineering, AI Platform Engineering, Data Platform Engineering. All these can be sort of looked at as spin offs of the core disciplines with a more stricter, targeted views towards the landscape it is catering to.</p><p>With this fundamental understanding in mind, let me take you through how to build an IdP using several tools such as Backstage, Crossplane, ArgoCD and also along with it, look at how Azure OpenAI can be integrated with the stack so that the platform can also be enabled to provision infrastructure through conversational AI.</p><p>DevEx Part-1: <a href="https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argocd-part-1-e7ee03ad54e9">https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argoc…</a></p><p>DevEx Part-2: <a href="https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argocd-part-2-integration-with-f97cca660d07">https://medium.com/@rbharadwaj16/building-developer-experience-using-backstage-crossplane-and-argoc…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5666e48584c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shift Left and Scale Right: Enhancing Azure DevOps Terraform Pipelines with Governance and Cost…]]></title>
            <link>https://medium.com/@rbharadwaj16/shift-left-and-scale-right-enhancing-azure-devops-terraform-pipelines-with-governance-and-cost-68215769f5cf?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/68215769f5cf</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Sat, 12 Apr 2025 15:22:43 GMT</pubDate>
            <atom:updated>2025-04-12T15:22:43.646Z</atom:updated>
            <content:encoded><![CDATA[<h3>Shift Left and Scale Right: Enhancing Azure DevOps Terraform Pipelines with Governance and Cost Controls</h3><p>When I speak with individuals or organizations about deploying Terraform through CI/CD pipelines, the conversation typically centers around the core Terraform commands — init, plan, and apply—executed either directly or via wrappers. These commands form the foundation of most pipelines, focusing on packaging and deploying the code.</p><p>However, there’s often less discussion around what comes before and beyond those commands—areas like policy enforcement, cost estimation, and code quality checks. In this article, I’ll share how you can elevate your Terraform pipeline in Azure DevOps by integrating tools that support advanced Infrastructure as Code (IaC) governance and validation strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xo7Onn4Og8VzvH4y" /><figcaption>Photo by <a href="https://unsplash.com/@mbenna?utm_source=medium&amp;utm_medium=referral">Mike Benna</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>HCL (Hashicorp Configuration Language) is a declarative language used to write Terraform modules. When designing any CI/CD pipeline, it is important to incorporate testing/validation, governance frameworks baked into the CI stage. Some of these frameworks/methodologies include (but not limited to):</p><ol><li>Compliance Frameworks</li><li>Integration Testing</li><li>Static Code Analysis</li><li>Shift Left FinOps</li></ol><p>In the next sections, I will highlight a few tools that can help implement strategies in an Azure DevOps pipeline.</p><ol><li><a href="https://www.checkov.io/">Checkov</a></li></ol><p>Is a static code analysis tool that is used for enforcing compliance and security. It scans cloud infrastructure defined using <a href="https://terraform.io/">Terraform</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Terraform%20Plan%20Scanning.md">Terraform plan</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Cloudformation.md">Cloudformation</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/AWS%20SAM.md">AWS SAM</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Kubernetes.md">Kubernetes</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Helm.md">Helm charts</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Kustomize.md">Kustomize</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Dockerfile.md">Dockerfile</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Serverless%20Framework.md">Serverless</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Bicep.md">Bicep</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/OpenAPI.md">OpenAPI</a>, <a href="https://github.com/bridgecrewio/checkov/blob/main/docs/7.Scan%20Examples/Azure%20ARM%20templates.md">ARM Templates</a>, or <a href="https://opentofu.org/">OpenTofu</a> and detects security and compliance misconfigurations using graph-based scanning.</p><p>A detailed list of checkov’s Terraform related policies can be found <a href="https://www.checkov.io/5.Policy%20Index/terraform.html#terraform-resource-scans-auto-generated">here</a>. I find the current OOTB policies comprehensive and it can further be enhanced by writing custom policies that fit your organization&#39;s standards. In my example, I used Checkov to scan a few test Azure Terraform modules against its default policy set.</p><p>Implementing checkov within Azure DevOps is very straight forward and in my implementation, it is just about installing checkov and running the <em>checkov </em>command against the tf modules. Once done, a report of the scan can be generated as a junitxml file and published so that can be viewed as a detailed report on Azure DevOps. Below is the gist for the task:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b6c612fda05f700de9964dff5b0cfbb/href">https://medium.com/media/8b6c612fda05f700de9964dff5b0cfbb/href</a></iframe><p>Under the “Tests” section of the pipeline, you will notice the summary of the tests ran against the checkov test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2rSuFor35_Vuy3Sm_ACQjg.png" /><figcaption>Summary of Test</figcaption></figure><p>In the Analytics section of the pipeline, you will get to see a detailed report of how many test cases have passed/failed along with the test cases themselves:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9xv2zO3OQTSLW6Bw5uHJw.png" /></figure><p>2. <a href="https://github.com/terraform-linters/tflint">tflint</a>:</p><p>Is a framework that will help in enforcing best coding practices within Terraform, naming conventions followed within the organization and in general to maintain good code quality.</p><p>When using tflint, it is important to understand that there are various rulesets that has to be installed as a plugin depending on the provider being used within your tf modules.</p><p>First, there are generic rules for the terraform itself (irrespective of the provider) that ships OOTB along with default tflint installation that will allow you to enforce naming conventions, disallow terraform declarations without “<em>require_version” </em>etc <em>.. </em>A detailed list of rules is documented <a href="https://github.com/terraform-linters/tflint-ruleset-terraform/blob/main/docs/rules/README.md">here</a>. All configurations for TFLint — version, plugins, and rules — are defined in a .tflint.hcl file, such as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3089e36c49550e3a3054db0bf2e0c1f1/href">https://medium.com/media/3089e36c49550e3a3054db0bf2e0c1f1/href</a></iframe><p>To use TFLint beyond generic validations, install the respective provider plugins. You can find them here:</p><ul><li><a href="https://github.com/terraform-linters/tflint-ruleset-aws">Amazon Web Services</a></li><li><a href="https://github.com/terraform-linters/tflint-ruleset-azurerm">Microsoft Azure</a></li><li><a href="https://github.com/terraform-linters/tflint-ruleset-google">Google Cloud Platform</a></li></ul><p>Integrating TFLint is also straightforward. At a high level, it just involves the following:</p><p>a) Installing tflint depending on Build agent’s OS. Various bundles of installation can be found <a href="https://github.com/terraform-linters/tflint?tab=readme-ov-file#installation">here</a>.</p><p>b) Initialize tflint against .tflint.hcl config file along with the tf modules being evaluated. At this stage, it downloads the plugins defined in your config file. Make sure that you either package everything into same path (like I have done in my task) or make sure references to the file is appropriate.</p><p>c) Run tflint recursively (as you will have modules in different subfolders) and generate a report that can be published. For this demo, I used junit format for reporting, but publishing SARIF format reports is preferred for security integrations (requires GitHub Security features in Azure DevOps).</p><p>Here is a snippet of how Azure DevOps task can be written:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/990096805eab439a463e10723c67ffe1/href">https://medium.com/media/990096805eab439a463e10723c67ffe1/href</a></iframe><p>3. <a href="https://www.infracost.io/">Infracost</a></p><p>Is a shift-left FinOps tool that estimates the cost of Terraform resources before deployment. It provides visibility into cost impacts early in the development process and helps enforce financial governance. Integrating Infracost into your terraform workflow will help in enforcing standardized cost policies and and will allow to centrally manage cloud budgets.</p><p>There are two ways in which Infracost can be integrated with Azure DevOps:</p><p>One is a direct integration with Azure Repos and the evaluation of the modules will be run within Infracost infrastructure. This is infracost’s recommended approach for integration and is also easier as it just involves a few clicks. More can be found <a href="https://www.infracost.io/docs/integrations/azure_repos_app/">here</a>.</p><p>Second is by writing Azure YAML pipeline using infracost task. Before setting this up, infracost task needs to be enabled by going to Azure marketplace:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWwIvne-XsCErk7S9D0KAA.png" /></figure><p>Next, you will need an Infracost API key to run this task. Before generating the API key, you will have to sign up for <a href="https://www.infracost.io/">infracost </a>. Create an organisation within infracost, install infracost on your machine and generate the token by running the below command:</p><pre>infracost auth login<br>infracost configure get api_key</pre><p>Once retrieved, you can store the API key in AzDo library so that can be retrieved in the pipeline. Speaking of pipeline, the infracost task can be integrated into the CI stage of terraform pipeline itself or can be a seperate pipeline altogether, while I prefer the latter. This gives enough flexibility that the pipeline runs only during pull requests and not part of every run.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c6816590dd680ac897c5626bf4810fe/href">https://medium.com/media/8c6816590dd680ac897c5626bf4810fe/href</a></iframe><p>The pipeline itself is straight forward wherein we setup the infracost using the API key, clone the base (main/master) branch and compare it against the branch being merged into the base branch via pull request. Once done, it will post PR comments about the cost changes that will be incurred. In order to enable pull request triggers, Build validations need to be enabled for the pipeline as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*Qgiub5bns4SDQu7TWNP7Uw.png" /></figure><p>Lastly, allow build service user named ‘[PROJECT NAME] Build Service ([ORGANISATION NAME])), under Settings → Repositories → Repo → Security Tab → Build Service User → Contribute to pull requests → Allow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*K3XDjqXvg95S38KIdbp_DQ.png" /></figure><p>This will allow the comments to be posted against the PR. Once the above settings are done, Infracost will start posting PR comments when you raise pull requests and will comment on PRs showing the cost difference, recommendations (e.g., using Azure Hybrid Benefit), and insights on budget optimizations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*ykG-zlrSWZzoX6jRMSA9LA.png" /><figcaption>infracost reommending Azure Hybrid benefit to save costs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*au4GDM1P5_js3zykOWuQSA.png" /><figcaption>Infracost providing visibility on the cost increase that will be incurred when the infra is deployed.</figcaption></figure><p>Furthermore, depending upon maturity, adoption appetite and skills, testing of Infrastructure can also be implemented with tools such as <a href="https://terratest.gruntwork.io/">terratest</a>. I will try to cover this in a seperate article and cover best practices when writing test cases for IaC.</p><p>To conclude, the above tools/strategies are just an illustration of how your terraform CI/CD pipeline can be enhanced and adopt advanced strategies to enforce compliance, governance and overall standardization at scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68215769f5cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated TLS Certificate Renewals for Ingress using Let’s Encrypt + Cert Manager with Federated…]]></title>
            <link>https://medium.com/@rbharadwaj16/automated-tls-certificate-renewals-for-ingress-using-lets-encrypt-cert-manager-with-federated-1c37d527da80?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c37d527da80</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Sat, 19 Oct 2024 12:27:38 GMT</pubDate>
            <atom:updated>2024-10-19T12:27:38.308Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automated TLS Certificate Renewals for Ingress using Let’s Encrypt + Cert Manager with Federated Identities on AKS</h3><p>As a Solutions Architect at <a href="https://www.getronics.com/">Getronics</a>, I am constantly on the look out for possible options to automate Infrastructure and Application lifecycle. At Getronics, we use a combination of strategies and platforms to achieve some of these automation use cases.</p><p>One such use case that I am writing about in the article is, how TLS certificate renewals can be automated using a combination of several tools, specifically for container workloads running on Azure Kubernetes Service (<a href="https://azure.microsoft.com/en-in/products/kubernetes-service">AKS</a>)</p><p>Core Components that are part of the solution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0JjVTXtxACyimDJmLJ5KA.png" /></figure><ol><li>Azure Kubernetes Service — Is an Azure Managed Kubernetes service to deploy and manage container workloads.</li><li>Cert-Manager — Is a CNCF graduating project that provides automated TLS certificate management solution, specifically for Kubernetes.</li><li>Let’s Encrypt — Is a free, open source Certificate Authority.</li><li>Federated Identity — Is a relatively new workload identity solution from Microsoft Azure that the applications can leverage to interact with Entra protected resources without needing to manage secrets. (More on this later)</li></ol><p>To begin with, let’s look at setting up our environment…</p><p><strong><em>Note</em></strong><em>: For the sake of keeping this article as short as possible, I will not be discussing much about creating Infrastructure components rather will be focusing more on creating/managing Kubernetes objects that are needed to make this solution work.</em></p><p>Assuming you have an Azure Kubernetes Service running, let’s look at how to setup Cert-Manager service within it.</p><h3><strong>Installing Cert-Manager</strong></h3><p>Cert-Manager in itself is a containerized application that supports most of the deployment models such as Helm, Static manifests and can even be integrated with GitOps for CD using Flux etc ..</p><p>Here is the installation link: <a href="https://cert-manager.io/docs/installation/">https://cert-manager.io/docs/installation/</a></p><p>In this article, I make use of static manifests to gain more visibility of what is happening under the hood.</p><pre>kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.3/cert-manager.yaml</pre><p>When the cert-manager manifests are applied, it creates a namespace called “cert-manager” and creates several resources within the namespace as shown below:</p><pre>PS C:\Users\RBHARADWAJ&gt; kubectl get all -n cert-manager<br>NAME                                           READY   STATUS    RESTARTS   AGE<br>pod/cert-manager-848d9fd7dc-vds66              1/1     Running   0          3d15h<br>pod/cert-manager-cainjector-5fd6444f95-x7c98   1/1     Running   0          3d15h<br>pod/cert-manager-webhook-869674f96f-pt8hd      1/1     Running   0          3d15h<br><br>NAME                           TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE<br>service/cert-manager           ClusterIP   10.0.115.97   &lt;none&gt;        9402/TCP   22d<br>service/cert-manager-webhook   ClusterIP   10.0.132.90   &lt;none&gt;        443/TCP    22d<br><br>NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE<br>deployment.apps/cert-manager              1/1     1            1           22d<br>deployment.apps/cert-manager-cainjector   1/1     1            1           22d<br>deployment.apps/cert-manager-webhook      1/1     1            1           22d<br><br>NAME                                                 DESIRED   CURRENT   READY   AGE<br>replicaset.apps/cert-manager-56cbb5ff6f              0         0         0       21d<br>replicaset.apps/cert-manager-5dc7dd9dc7              0         0         0       21d<br>replicaset.apps/cert-manager-7497f957d8              0         0         0       21d<br>replicaset.apps/cert-manager-848d9fd7dc              1         1         1       21d<br>replicaset.apps/cert-manager-cainjector-5fd6444f95   1         1         1       22d<br>replicaset.apps/cert-manager-d894bbbd4               0         0         0       22d<br>replicaset.apps/cert-manager-webhook-869674f96f      1         1         1       22d<br>PS C:\Users\RBHARADWAJ&gt; NAME                                           READY   STATUS    RESTARTS   AGE<br>pod/cert-manager-848d9fd7dc-vds66              1/1     Running   0          3d15h<br>pod/cert-manager-cainjector-5fd6444f95-x7c98   1/1     Running   0          3d15h<br>pod/cert-manager-webhook-869674f96f-pt8hd      1/1     Running   0          3d15h<br><br>NAME                           TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE<br>service/cert-manager           ClusterIP   10.0.115.97   &lt;none&gt;        9402/TCP   22d<br>service/cert-manager-webhook   ClusterIP   10.0.132.90   &lt;none&gt;        443/TCP    22d<br><br>NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE<br>deployment.apps/cert-manager              1/1     1            1           22d<br>deployment.apps/cert-manager-cainjector   1/1     1            1           22d<br>deployment.apps/cert-manager-webhook      1/1     1            1           22d<br><br>NAME                                                 DESIRED   CURRENT   READY   AGE<br>replicaset.apps/cert-manager-56cbb5ff6f              0         0         0       21d<br>replicaset.apps/cert-manager-5dc7dd9dc7              0         0         0       21d<br>replicaset.apps/cert-manager-7497f957d8              0         0         0       21d<br>replicaset.apps/cert-manager-848d9fd7dc              1         1         1       21d<br>replicaset.apps/cert-manager-cainjector-5fd6444f95   1         1         1       22d<br>replicaset.apps/cert-manager-d894bbbd4               0         0         0       22d<br>replicaset.apps/cert-manager-webhook-869674f96f      1         1         1       22d<br></pre><p>While the above cmd lists standard resources part of the namespace, I would like to point to another critical resource part of this namespace which is a service account by the name “cert-manager”. This is going to play a key role in configuring federated identities in the later stage..</p><pre>PS C:\Users\RBHARADWAJ&gt; kubectl get sa -n cert-manager<br>NAME                      SECRETS   AGE<br>cert-manager              0         22d<br>cert-manager-cainjector   0         22d<br>cert-manager-webhook      0         22d</pre><p>Once the above is verified and the resources are running as expected, let’s move onto configuring the AKS cluster to support federated identities.</p><p><strong>Configure AKS cluster to Support Federated Identity</strong></p><p>Like I mentioned in the earlier section of the article, Federated identity is a relatively new feature in Azure and does not ship out of the box in AKS clusters.</p><p>But before setting up the identity, I will try to provide a simple understanding of what Federated identity really is and why it makes sense ..</p><p>Let’s assume you have an application that needs to access and consume Azure resources, standard ways of allowing app to access Azure resource is is to use a Service Principal (if the app is externally hosted) / Managed Identities (POD Identities) in case if the apps are hosted internally.. In this scenario, POD identities are obsolete and in the case of Service Principal, you need to manage and rotate secrets/certificates frequently which adds significant Operations overhead and risk of secret leak.</p><p>To eliminate the above, Federated identity credential leverages a trust relationship b/w an IdP and Entra ID. After that trust relationship is created, the software workload can exchange trusted tokens from the external identity provider for access tokens from the Microsoft identity platform. The software workload then uses that access token to access the Microsoft Entra protected resources to which the workload has been granted access. This eliminates the maintenance burden of manually managing credentials and eliminates the risk of leaking secrets or having SPN certificates expire. In our use case of AKS and Cert-Manager, below is how Federated Identity flow works:</p><ol><li>Create a Managed Identity</li><li>Map the Service Account of “cert-manager” to the Managed identity thus establishing the trust</li><li>Provide necessary access to the mapped Managed Identity on Azure resource that you want to access.</li><li>Use the Service account in your application to access Azure resources which in turn will invoke Managed identity to access Azure resource.</li></ol><p>For more info, read here: <a href="https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation">https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation</a></p><p>Now, let’s configure the AKS cluster to use FI’s..</p><p>FI is a preview feature for AKS and hence why you need to enable “EnableWorkloadIdentityPreview” feature flag on your AKS cluster with the following command:</p><pre>az aks update --resource-group &quot;rg-name&quot; - name &quot;cluster-name&quot; --enable-oidc-issuer --enable-workload-identity</pre><p>The above command will run almost for a minute and will return a huge output of the configs enabled on AKS.. among which oidcIssuerProfile attribute is important and should be as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*2ONGjHxfZggSIS4zTj16cA.png" /><figcaption>OIDC Url enabled for the given AKS cluster</figcaption></figure><p>Alternatively, you can use the below command to get the exact OIDC URL:</p><pre>az aks show --resource-group &quot;rg-name&quot; - name &quot;cluster-name&quot; - query &quot;oidcIssuerProfile.issuerUrl&quot; - output tsv</pre><p>Now, that we have enabled FI feature on AKS, let’s create a Managed Identity in Azure as shown below to map the same with “cert-manager” SA which will be part of “cert-manager” namespace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*ZYjDewmIMX3szSwQXdzHxw.png" /><figcaption>Managed Identity “az-cert-manager-mi” is created</figcaption></figure><p>Within the Managed Identity (MI) “az-cert-manager-mi” created, go to “Federated Credentials” under settings..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*KToUxun0Ie_d9Mko_ROFNA.png" /></figure><p>Configure the identity as below:</p><ol><li>Choose “Kubernetes accessing Azure resources” under FI Scenario</li><li>Provide the Cluster Issuer URL that was obtained in the previous step along with the namespace and Service account name which is “cert-manager”.</li></ol><p>The above mapping will allow Service account “cert-manager” to access Azure resources via Managed Identity “az-cert-manager-mi”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*-18s9zqkTcq31oEFo1QoLA.png" /></figure><p><strong>Configure Cert-Manager to use Azure DNS for auto certificate issuance from Let’s Encrypt</strong></p><p>Now that we have the means to access Azure resources via Federated Identity, let us try to understand the crucial aspect of this solution, which is how does Cert-manager automatically issue certificate for a domain using Let’s Encrypt ?</p><p>For Let’s Encrypt to issue Certificate for a domain, you need to prove that you control the domain. For this, there are two mechanisms (challenges) in which you can prove that you control the domain..</p><ol><li><a href="https://letsencrypt.org/docs/challenge-types/#http-01-challenge">HTTP-01 Challenge</a> — To simply put, if you want to have a certificate issued for test.com , the HTTP-01 challenge requires your ACME client to place a challenge file at the location http://test.com/.well-known/acme-challenge/&lt;challenge-token&gt;. The ACME server (Let&#39;s Encrypt) then retrieves that file using HTTP thus confirming that someone who controls the domain can complete the challenge.</li><li><a href="https://letsencrypt.org/docs/challenge-types/#http-01-challenge">DNS-01 Challenge</a> — To simply put, if you want to have a certificate issued for test.com, the DNS-01 challenge requires you to prove that you control the DNS for your domain name by putting a specific value as a TXT record under that domain name. After Let’s Encrypt gives your ACME client a token, your client will create a TXT record derived from that token and your account key, and put that record at _acme-challenge.&lt;YOUR_DOMAIN&gt;. Then Let’s Encrypt will query the DNS system for that record. If it finds a match, you can proceed to issue a certificate!</li></ol><p>For this solution, we are using the DNS-01 challenge and as you might have guessed by now, the “cert-manager” deployment needs to access Azure DNS that hosts our domain to prove that it controls the domain to issue a certificate!</p><p>To allow for the “cert-manager” deployment to access the DNS zone, we need to make the following changes in the cert-manager deployment file:</p><p>Edit the “cert-manager” deployment to add label “<em>azure.workload.identity/use: true</em>” under spec.template.metadata.labels to notify cert-manager deployment that it needs to use Federated identity to access Azure DNS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*iK-vRJU1DP8uezBSkwPaxw.png" /><figcaption>Label added to cert-manager deployment</figcaption></figure><p>Also, provide “DNS Zone contributor” role to the MI that will allow the MI to add relevanet txt records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*ctG3XGFQAkmLz4mpzY1vgQ.png" /><figcaption>DNS Zone contributor role applied for MI</figcaption></figure><p>We now have all the configurations in place to test this setup. Let’s proceed and test to check if all is well with the configurations. For this, we will create a sample app and deploy it in our AKS cluster..</p><p>First, let’s deploy a sample app deployment ..</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61f29f89db02bb863c48ec67786ec5e8/href">https://medium.com/media/61f29f89db02bb863c48ec67786ec5e8/href</a></iframe><p>A Service to expose the app..</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b17df32464b0afe2cbe2398671b7afe/href">https://medium.com/media/5b17df32464b0afe2cbe2398671b7afe/href</a></iframe><p>Now that the app is deployed and is exposed via service, let’s create “cert-manager” specific objects.</p><p>Firstly, we need to deploy an Issuer/ClusterIssuer. These are resources that represent certificate authorities (CAs) that are able to sign certificates in response to certificate signing requests.</p><p>For our deployment, let’s create a ClusterIssuer as below. Do fill in the resource group name, subscription ID, zone name and Client ID as applicable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c305f010917940921f62662af336605a/href">https://medium.com/media/c305f010917940921f62662af336605a/href</a></iframe><p><strong>Note: Let’s Encrypt has rate limiters on the actual (production) endpoint used above. The above acme server endpoint is an actual production endpoint. So, it’s a good practice to test the whole configuration with a staging endpoint: </strong><a href="https://acme-staging-v02.api.letsencrypt.org/directory"><strong>https://acme-staging-v02.api.letsencrypt.org/directory</strong></a><strong> to be sure that all the configurations work as expected and then switch over to production endpoint</strong></p><p>You can verify if the ClusterIssuer is running fine by following command:</p><pre>PS C:\Users\RBHARADWAJ&gt; kubectl get clusterissuer<br>NAME                     READY   AGE<br>letsencrypt-production   True    2d3h<br>letsencrypt-staging      True    2d5h</pre><p>Once the ClusterIssuer is “Ready”, we can create a Certificate object as following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b62059552aec6faa36f7f5727ffeeec/href">https://medium.com/media/8b62059552aec6faa36f7f5727ffeeec/href</a></iframe><p>When the above “certificate.yaml” is applied there are two sub resources called “orders” and “challenges” that will be created, in which “challenge” will be visible temporarily. This basically means, when you request for a certificate, it initiates an “order” to Let’s encrypt and that order will create a DNS-01 “challenge”. If challenge is successfully cleared, order will be successfully fulfilled and thus a certificate will be issued. It is important to know this as it helps in troubleshooting in case of issues in the setup.</p><p>Hierarchy of the resource:</p><p>Certificate → Orders → Challenges</p><p>In case of issues, you need to start looking at each of the resource from the ground up (from Challenges to Certificate). You can verify if all is well using the following command:</p><pre>PS C:\Users\RBHARADWAJ&gt; kubectl get orders<br>NAME                          STATE   AGE<br>www-production-1-2562143177   valid   2d3h<br>PS C:\Users\RBHARADWAJ&gt; kubectl get certificate<br>NAME             READY   SECRET                   AGE<br>www-production   True    letsencrypt-production   2d3h<br>www-staging      True    letsencrypt-staging      2d4h</pre><p>Finally, let’s apply this certificate to our ingress and test if the application is indeed accessible over https..</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c2a042b0c434cd56d174266f3dbbc5f/href">https://medium.com/media/2c2a042b0c434cd56d174266f3dbbc5f/href</a></iframe><p>Do note the annotation called “cert-manager.io/cluster-issuer” that is added which points to the cluster issuer to refer to. Also, the secret name of the tls should match that of in the certificate. However, in case of the secret names don’t match, the annotation added shall create appropriate secret on your behalf. In our case, the domain name is “www.cloudrev.tech” and the webpage is displayed as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TVDuWDcGt-_9kDXroKDSkw.png" /></figure><p>And certificate issued is as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*OgGF-E_AwOxlkg-CbBQLwA.png" /></figure><p>As you might have realized by now, there are quite a few moving parts and involves multiple components to get this setup going. However, at Getronics we leverage more Enterprise grade setups such as GitOps with a combination of tools to achieve a robust, reliable solution. When done right, we eliminate the overhead of managing certificate expiries and setting alarms to renew the certificates :)</p><p>At Getronics, we have expertise in managing such complex integrations and automations while allowing our customers to focus more on driving true business value. We have a dedicated service to create and operate Kubernetes service at scale — be it on a Public, Private or Hybrid stack, we can help you manage it. Interested to know more about us ? Visit <a href="https://www.getronics.com/services/cloud-services/">here</a>..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c37d527da80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What does it take to deploy a Kubernetes cluster in Production ?]]></title>
            <link>https://medium.com/@rbharadwaj16/what-does-it-take-to-deploy-a-kubernetes-cluster-in-production-1c2fd8cd1994?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c2fd8cd1994</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 10:54:07 GMT</pubDate>
            <atom:updated>2024-10-02T10:54:07.697Z</atom:updated>
            <content:encoded><![CDATA[<h3>What does it take to deploy a Kubernetes cluster in Production ?</h3><p>Landscape of Containers has changed so rapidly over the last 3–4 years, so much so that, containers is “not just a technology for the future”, but is a technology that has been widely adopted and is redefining multiple large scale business transformations across organizations. Many Enterprises have embraced containers for complex use cases and will continue to do so for years to come ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kbY1qkmsPfHLvZeX" /><figcaption>Photo by <a href="https://unsplash.com/@carrier_lost?utm_source=medium&amp;utm_medium=referral">Ian Taylor</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When we speak containers, a natural extension to that conversation is Kubernetes. Kubernetes is a container orchestration tool that allows to manage containers at scale. But hey, what does it really take for organizations to deploy Kubernetes clusters in Production ?</p><p>While the nature of problem being solved itself is a fundamental question to be answered and weather Kubernetes can solve it is the first question to be answered. For the sake of this article, let’s say Kubernetes is the chosen champion to win your battle, let’s understand some of the crucial aspects that needs to be defined for a “Production Grade” Kubernetes cluster.</p><p><strong>Hosting:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*ZaNoGB5hMCKGL_Q9QOGKgQ.png" /></figure><p>First logical step to take is to determine hosting part of Kubernetes cluster. Kubernetes can be setup and configured on a wide range of compute capabilities. Broadly speaking, it is key to determine weather the cluster needs to be hosted on Private cloud Infrastructure or on Public cloud Infrastructure or if the cluster needs to be a “Hybrid setup”. This is mostly an Enterprise strategy that determines what capabilities/features the Kubernetes cluster needs to have. At <a href="https://www.getronics.com/">Getronics</a>, we have a wide array of <a href="https://www.getronics.com/services/cloud-services/">Cloud hosting services</a> that allow Enterprises to take advantage of Private, Public and Hybrid Infrastructure.</p><p><strong>Managed vs Unmanaged (Self Managed) Clusters</strong></p><p>At a high level, Kubernetes architecture can be divided into two parts:</p><ol><li>Control Plane: This is the core of the Cluster and includes various components such as api-server, scheduler, controller manager, etcd cluster which takes care of various activities of a Kubernetes cluster such as scheduling, managing lifecycle of Kube objects.</li><li>Worker Nodes: This provides the Kube runtime environment and is basically the underlying compute that powers the applications. This has various Kube components such as Kubelet, proxy as a bare minimum.</li></ol><p>A <strong>Managed Cluster</strong> infers that the hosting provider takes the responsibility of creating and managing the Control plane while reducing the overhead on the Internal IT teams.</p><p>An <strong>Unmanaged cluster</strong> also can be called as “<strong>Self Managed</strong>” cluster means the entire responsibility of creating, configuring the Control plane and ensuring all the Kubernetes core components are up and running is the responsibility of the Internal IT teams. While this brings in more responsibility, also gives more granular control over Kubernetes components.</p><p>Managed vs Unmanaged cluster is a crucial decision which needs to be made and determines the path to take forward. Several well known managed clusters are provided by various cloud providers such as <a href="https://azure.microsoft.com/en-us/products/kubernetes-service">Azure Kubernetes Service</a>, <a href="https://aws.amazon.com/eks/#:~:text=Amazon%20Elastic%20Kubernetes%20Service%20(Amazon,and%20on%2Dpremises%20data%20centers.">Amazon Elastic Kubernetes Service</a>, <a href="https://cloud.google.com/kubernetes-engine?hl=en">Google Kubernetes Engine</a>, <a href="https://www.mirantis.com/software/mirantis-kubernetes-engine/">Mirantis Kubernetes Engine</a> etc to name a few.</p><p><strong>Network Topology</strong></p><p>Once the decision has been made on the type of “hosting” as well as management responsibilities of a cluster, the next is to decide the topology of the network in which the cluster sits. When designing the network for Kubernetes cluster there are two different network ranges in play at a high level. One is the top level network in which the hosts (actual servers) communicate and the other is the overlay network in which the containers communicate. It is very important to size these networks appropriately and ensure there are no conflicts of network. One other key point to keep in mind when sizing the cluster is to plan for upgrades and patches. As they say, “no one size fits all”. Here is an interesting IP planning strategy if you plan on running Azure Kubernetes Service (AKS): <a href="https://learn.microsoft.com/en-us/azure/aks/concepts-network-ip-address-planning">https://learn.microsoft.com/en-us/azure/aks/concepts-network-ip-address-planning</a></p><p><strong>Security</strong></p><p>When we talk security, it is important to consider security from the inception stage of the solution itself rather than retro fitting it at a later stage. As with any other platform, the topic of Security for Containers is very vast in itself and I shall try to cover some of the “must haves” in this article.</p><ol><li>RBAC: A Kubernetes cluster needs to have a solid RBAC strategy in place that covers different user personas managing/using the clusters. They can include Cluster admins, Operations team, Developers etc .. It is important to identify a solid Authentication and Authorization mechanism to ensure seamless management of the cluster.</li><li>Cluster and Node Security: It is very important to run the nodes and Kubernetes with latest secure versions based on the providers. Have a solid strategy for vulnerability scanning and patching. One of the things successful Enterprises follow in this regard is they try to adhere to a compliance framework that aligns with the Business regulations. This will serve as a “guiding light” to keep your clusters and workloads secure. An example could be <a href="https://www.cisecurity.org/benchmark/kubernetes">CIS Benchmark</a> and there are various tools in the market that allow you to maintain security posture such as <a href="https://www.accuknox.com/">AccuKnox</a>.</li><li>Network Security: When it comes to NetSec, a holistic approach is a must. Specially in public cloud workloads, determine the network flow between resources and towards on premises (if there is a need). Deploy your clusters into a network topology that has Hub-Spoke Architecture. Enforce network policies within the cluster to restrict network flow and enforce more controls. For mature operators and advanced use cases, consider bringing in a service mesh solution such as <a href="https://istio.io/latest/">Istio</a>, <a href="https://cilium.io/">Cilium </a>etc ..</li><li>Application Security: For the applications running within a Kubernetes cluster, determine scanning procedures and tools to scan container images. Also, bring in a robust secret consumption mechanism to process secure information/configuration needed by Applications. Consider how these considerations can be seamlessly integrated within your DevOps cycle. My personal favorite tool to manage Kube secrets is: <a href="https://bitnami.com/stack/sealed-secrets">https://bitnami.com/stack/sealed-secrets</a></li></ol><p>As I said in the beginning, Kubernetes security/ container security in general can be a book on it’s own and I am just touching upon the tip of the iceberg!</p><p>At Getronics, we follow “<a href="https://www.getronics.com/services/security-services/">Secure By Design</a>” approach and even more so when it comes to containers.</p><p><strong>Scaling</strong></p><p>One of the advantages of using Kubernetes is, it brings in the flexibility to scale across ends to meet application demand, provided the underlying Infrastructure supports dynamic scaling requirements. Determine the requirements of scaling that your application really needs. This will help in determining an appropriate scaling strategy. Several popular strategies include:</p><ol><li>Horizontal Pod Scaling (HPA): This involves scaling the number of pods depending on the varied scaling requirements of the app.</li><li>Vertical Pod Scaling (VPA): This involves redefining/adjusting pod requests and limits that allow pods to optimally consume resources and ensure there are no resource starvation for pods.</li><li>KEDA: A special type of scaler that is more of a subset to HPA. This is an opensource scaler solution that scales in line with different events happening within the ecosystem. It has rich support for integrating with different type of event sources. More here: <a href="https://keda.sh/">https://keda.sh/</a></li><li>Cluster Autoscaler: Different Kubernetes providers also scale the underlying nodes (VM’s) that are part of cluster. When deployed in conjunction with above pod scaling strategies, this can be a very efficient scaling solution.</li></ol><p><strong>Application Deployments</strong></p><p>Within Kubernetes, applications are more commonly deployed as Deployments and for special use cases as Daemonsets, Statefulsets, Jobs etc .. Regardless of the Kubernetes objects that are deployed, there needs to be an efficient strategy to deploy the application. Kubernetes, being a modern technology works very well with the principles of DevOps. Determine an optimal CI/CD strategy to deploy applications into the Kubernetes clusters.</p><p>Consider efficient tagging strategy to tag your container images, bring in advanced package management solutions tool such as <a href="https://helm.sh/">Helm</a>. For matured development environments, consider GitOps using tools such as <a href="https://argo-cd.readthedocs.io/en/stable/">ArgoCD</a> in conjunction with Helm or <a href="https://kustomize.io/">Kustomize</a>.</p><p>Determine the nature of the application and determine how are the applications accessed by consumers of the applications. Applications can be exposed at various levels such as within the cluster or external to the cluster. Consider bringing in a robust Load balancing solution that can distribute traffic efficiently. For advanced use cases that require path based routing etc, Ingress solution such as <a href="https://docs.nginx.com/nginx-ingress-controller/">Nginx Ingress</a> should be considered.</p><p><strong>High Availability and Disaster Recovery</strong></p><p>No matter how many “9s” are promised in the availability SLA, it is never 100%! It is important to plan for Business Continuity (BC) by considering High Availability (HA) and Disaster Recovery (DR). Key factors to consider are:</p><ul><li>Recovery Point Objective (RPO) is the maximum duration of acceptable data loss. RPO is measured in units of time, such as minutes, hours, or days.</li><li>Recovery Time Objective (RTO) is the maximum duration of acceptable downtime. For example, if the acceptable downtime duration in a disaster is <em>eight hours</em>, then the RTO is eight hours.</li></ul><p><a href="https://velero.io/">Velero</a> is a cloud agnostic tool that can provide various backup options. It can backup your Kubernetes resources and volumes for an entire cluster, or part of a cluster by using namespaces or label selectors.</p><p><strong>Operations and Observability</strong></p><p>Due to the opensource nature of Kubernetes, there are various open source logging and monitoring tools available that provides quite an extensive observability of the clusters. While it’s not just about tools, consider various aspects of Day-2 activities such as patching the clusters, deploying the cluster itself as Infrastructure as a Code to begin with, that allows the ops team to seamlessly manage the lifecycle of the cluster.</p><p>As you might have noticed by now, there are various aspects to consider and to make it all the more difficult (interesting ?) there are different tools that achieve more or less similar with little to no differences between them. One of the differentiators for a successful transformation project using Kubernetes can come from deep expertise of managing and handling such platforms. At <a href="https://www.getronics.com/">Getronics</a>, we have people who bring depth and breadth across various Kubernetes platforms and have managed these solutions at scale. We have our own offering called as “Kubernetes as a Service” that simplifies management of Kubernetes cluster and provides an accelerated path towards adopting containers. Significant advantages of adopting Getronics’s Kubernetes as a Service are:</p><ul><li>A truly hybrid approach to application modernization</li><li>Pre-Baked set of application utilities that accelerate application deployment and cluster management.</li><li>A global dashboard view with self-serve capabilities</li><li>CI/CD development — including cloud-native application development</li><li>Security by design</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2F7l9ZCMr%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2F7l9ZCMr&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="794" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d74e1d76639e6588c11013072f12d28/href">https://medium.com/media/8d74e1d76639e6588c11013072f12d28/href</a></iframe><p>Interested to know more about our Kubernetes capability ? Reach out <a href="https://www.getronics.com/the-application-modernisation-journey-with-kubernetes/">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c2fd8cd1994" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To: Hardening Azure Databricks using Terraform]]></title>
            <link>https://medium.com/weareservian/how-to-hardening-azure-databricks-using-terraform-feb23c231080?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/feb23c231080</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[azure-security]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 04:51:26 GMT</pubDate>
            <atom:updated>2022-07-21T04:51:26.231Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To: Create Hardened Azure Databricks using Terraform</h3><p>Azure Databricks is a true, unified data analytics platform catering to different data intensive use cases, for varied personas — be it an analyst, data engineer or a data scientist. Rich out of the box integrations with multiple Azure services, simple “click of a button” setup, are just a few reasons why Azure Databricks tops the list for anyone looking to spin up a Spark cluster within Microsoft Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWrto2YAmeGjEW9sZIkdcg.png" /></figure><p>While it’s simple, easy and straightforward to spin up a Databricks cluster with a click of a button, as far as “Enterprise-grade” environments are concerned, it is very important to consider how the entire platform is secured and protected from Data exfiltration. This article attempts to explain some of the key configurations that will help harden your Azure Databricks environment. Since we are working on setting up the entire infrastructure, we will make use of Terraform as our go to IaC (Infrastructure as a Code) tool to spin up all of our Azure resources.</p><p>To begin with, let’s understand different configurations that are part of our solution and then look at our Terraform modules that we use to deploy the solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/0*E5etDJ5ZjtNaEjYn" /><figcaption>Architecture diagram of our Solution</figcaption></figure><p><strong>VNET Injection</strong></p><p>First major configuration as part of the setup is to make sure Databricks is deployed within your VNET (instead of Azure managed VNET) or in other words called as “VNET Injection”. A Databricks workspace deployment in Azure can be logically divided into Data plane and Control plane. In simple words, the control plane is deployed in Azure managed subscription and consists of Databricks WebApp, cluster management, etc.</p><p>Data plane is deployed within customer subscription and this is where actual data is processed. By default, Azure deploys the entire Infrastructure, including a new VNET and required subnets in a locked resource group which cannot be altered once deployed. However, deploying ADB resources within our own VNET, which is called as <strong>VNET Injection</strong>, provides multiple security flexibilities such as, connecting to other Azure resources via Private endpoints, routing traffic via NVA (network virtual appliance) to scout network traffic, define controls over egress traffic, etc ..</p><p><strong>No Public IP (NPIP)</strong></p><p>Secondly, it is important to understand any public interfaces within any Infrastructure, unless absolutely needed, is a risk. On similar lines, ADB workspace should be limited to private network only. To make sure we don’t have any public ip address and open ports in the ADB infrastructure, we can deploy the workspace with “No Public IP” option enabled. This is called Secure cluster connectivity and also know as No Public IP (NPIP) implementation.When a ADB cluster starts, it initiates connection from data plane to the control plane over secure relay network. As part of our implementation, we club VNET injection with NPIP and as a result both the Databricks subnets will be private.</p><p><strong>Routing requests via Network Virtual Appliance (NVA)</strong></p><p>So far, we have limited our connectivity to private network. But there needs to be a way for initiating public connections for various use cases. For this reason, we have to make sure that there is a stable public IP for egress. There are multiple options that can vary depending on the situation. Our solution makes use of an Azure firewall with custom User defined routes (UDR’s) forwarding requests from subnets. We force the traffic from our Databricks subnets to the Azure firewall, also called as NVA (refer to the diagram). At the firewall level, we have to make sure that there are firewall rules that allow relay endpoints. This is later shown in the Terraform code as well.</p><p><strong>External Hive Metastore</strong></p><p>Lastly, every Databricks deployment has a central Hive metastore accessible by all clusters to persist table metadata. Instead of using the default Azure Databricks Hive metastore, we can make use of External hive metastore. This basically means that, we deploy a database within our own network and point the cluster by defining custom spark configurations to use the internally created database as the Hive metastore. By doing so, Databricks can connect to the database by using private endpoints and also we make sure the metastore is within customer managed subscription and not within Azure managed subscription.</p><p><strong>Terraform modules for all of the discussed configurations</strong></p><p>Now that we have looked at different configurations that help harden our Azure Databricks environment, let’s look at the Terraform code that actually deploys all of these discussed configurations. The Terraform code structure involves child modules for various infrastructure resources that are created and a main root file, that calls all these modules along with provider configuration. Tree structure is as below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0187cc347e9fe74d47a11da6cf8fd2b2/href">https://medium.com/media/0187cc347e9fe74d47a11da6cf8fd2b2/href</a></iframe><p><strong><em>Note</em></strong><em>: The below section only discusses the “main” file of each resource. Also, do note that name and tag for the resources are mostly defined for demo requirement and do feel free to change as needed. To view and use variables and output files, please refer to the github link: </em><a href="https://github.com/rbharadwaj16/adb_bootstrap">https://github.com/rbharadwaj16/adb_bootstrap</a></p><p><strong>Resource Group module</strong></p><p>Let’s start with the most fundamental resource in Azure, which is the resource group. Any resource within Azure is housed within a resource group and we use a single resource group to contain all resources which are part of the solution.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8916a698814e4354733b78a9d2fbb920/href">https://medium.com/media/8916a698814e4354733b78a9d2fbb920/href</a></iframe><p><strong>Network module</strong></p><p>Next, let’s look at the network block. As we have discussed earlier, we deploy our ADB workspace within our own VNET as VNET injection. As part of this, we require two subnets just for ADB deployment — one called as Public subnet (Host subnet) and the other called as Private subnet (Container subnet). Along with the two ADB subnets, we create two additional subnets — one for private endpoints and the other to deploy firewall.</p><p>We make use of “<em>for_each</em>” meta argument to create all four subnets. Do pay attention to the “<em>dynamic</em>” block in the subnets resource configuration, as we delegate two subnets (public and private) for <em>Microsoft.Databricks/workspaces</em>.The deployment also requires a security group associated with each ADB subnet and this NSG is used to create a few ADB specific rules that allow communication between data and control planes. (refer to the pic attached below)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4b3f3201cfcceee41b6d2b4f3482ac6/href">https://medium.com/media/a4b3f3201cfcceee41b6d2b4f3482ac6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ax01u083iYpEo4RI" /><figcaption>These are the rules created by Azure Databricks that allow communication between the data plane and control plane.</figcaption></figure><p><strong>Key Vault module</strong></p><p>In Azure, it’s best practice to store any sensitive keys or secrets in Azure key vault. On similar lines, let’s create a key vault that we can later use to store some of the sensitive data. Along with creating a key vault, we initiate a private endpoint to the key vault and a private DNS zone to resolve the private endpoint. This allows the ADB cluster to access the key vault endpoint via a private endpoint.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56f743a0f9e94bede076cf5dd622c9cd/href">https://medium.com/media/56f743a0f9e94bede076cf5dd622c9cd/href</a></iframe><p><strong>Database module</strong></p><p>Next, let’s look at the db module that creates an Azure SQL server and a database housed inside the SQL server. This database is used as an external hive metastore. The module also creates sensitive information such as db username and db password which we store as secrets in the key vault we previously created. Also, very similar to key vault, we create a private endpoint resource to the database and also a private dns zone to resolve the DB endpoint.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c4d07188a61cee50fd581a09d110865/href">https://medium.com/media/3c4d07188a61cee50fd581a09d110865/href</a></iframe><p><strong>Databricks module</strong></p><p>Now that we have most of the supporting resources, let’s deploy Azure Databricks resource. The ADB resource definition itself consists of two major components. First is the Databricks workspace in which we define sku of the ADB, NPIP configuration along with VNET injection configuration. Second is the Databricks cluster which is deployed within the ADB workspace. Here, we define the spark configurations that are needed to point to the external hive metastore (database that we created in the DB module). Also, “<em>databricks_cluster</em>” resource is part of “<em>databricks</em>” Terraform provider and not part of “<em>azurerm</em>” provider. We can define the source to the Databricks provider as shown below in the snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0c622ae587741fea56dfd28f58f92af/href">https://medium.com/media/e0c622ae587741fea56dfd28f58f92af/href</a></iframe><p><strong>Azure Firewall module</strong></p><p>The last infrastructure component we deploy is the Azure firewall. This module includes multiple resource definitions such as “<em>azurerm_public_ip</em>” which creates a public IP, “<em>azurerm_firewall</em>” which creates the firewall itself. Then, we create azure firewall application rules to allow connections to ADB log blob storage (that stores ADB audit and cluster logs for troubleshooting), to allow connections to Artifact blob storage, to allow root DBFS, to allow ssc relay tunnel connection and finally to allow connection to adb eventhub for workspace health telemetry data. We also create Azure firewall network rules to allow connections to adb webapp and Azure extended infrastructure. These rules vary from region to region and detailed list can be found here: <a href="https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr#--metastore-artifact-blob-storage-log-blob-storage-and-event-hub-endpoint-ip-addresses">https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr#--metastore-artifact-blob-storage-log-blob-storage-and-event-hub-endpoint-ip-addresses</a></p><p>We have to make sure that the requests are forced via the NVA and for this purpose we create route table and associate them with both public and private subnets. There are two routes defined in the route table. First is all connections to “0.0.0.0/0” to go via NVA. Second, any connections to scc relay will traverse via Azure backbone. To retrieve the IP of relay, we can do “<em>nslookup</em>” on the relay endpoint. In our example, we perform nslookup on “<em>tunnel.australiaeast.azuredatabricks.net</em>” as we are deploying resources in Australia east.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9a09ceecaf657fe1aa06593c5c547b7/href">https://medium.com/media/e9a09ceecaf657fe1aa06593c5c547b7/href</a></iframe><p><strong>Root main.tf</strong></p><p>Now that we have defined all of our child modules, let’s look at the root main.tf. This file calls all of the child modules that we have defined in the previous steps and importantly also consists of provider configuration. Do pay attention to the Databricks provider definition block where we pass the adb workspace ID that provides information about the adb workspace in which the adb cluster needs to be deployed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dffdd60781f4fc40ffd35ce86362b39/href">https://medium.com/media/9dffdd60781f4fc40ffd35ce86362b39/href</a></iframe><p><strong>Improvements and Limitations around this solution</strong></p><p>Now that we looked at the entire solution and how to deploy an enterprise grade Azure Databricks this solution is by no means perfect. There are several improvements that can further be made and also there are a few limitations to this solution:</p><ol><li>As an improvement, the solution can be deployed in a Hub-Spoke topology where the Azure firewall (NVA) can sit in Hub VNET while rest of the resources can sit in spoke VNET. This further enhances the stability of the solution.</li><li>The workspace (Databricks webapp) is still accessible via any public network. This can further be restricted by setting “<em>public_network_access_enabled</em>” to false in the “<em>azurerm_databricks_workspace</em>” resource definition. By doing so, workspace would not be accessible over the internet and further make sure to define IP access list to restrict users to a specific cidr of IP’s. Further information can be found here: <a href="https://docs.microsoft.com/en-us/azure/databricks/security/network/ip-access-list">https://docs.microsoft.com/en-us/azure/databricks/security/network/ip-access-list</a></li><li>In the solution, credentials of the database for external hive metastore are passed in the spark configuration. This can further be improved if they are defined as secret scope by creating key vault backed secret scope. This way we can avoid secrets being visible in the spark configuration in the ADB UI. However, there is a limitation with Azure Databricks that key vault backed secret scopes cannot be created by service prinicipal or any Managed Identity and has to be done by a normal user identity. It is important to note that this does prevent a full fledged automation deployment. More information can be found here: <a href="https://github.com/databricks/databricks-cli/issues/338">https://github.com/databricks/databricks-cli/issues/338</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feb23c231080" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weareservian/how-to-hardening-azure-databricks-using-terraform-feb23c231080">How To: Hardening Azure Databricks using Terraform</a> was originally published in <a href="https://medium.com/weareservian">Cognizant Servian</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To: Azure Data Factory CI/CD with  Azure DevOps pipelines — The YAML WAY!]]></title>
            <link>https://medium.com/weareservian/how-to-azure-data-factory-ci-cd-with-azure-devops-pipelines-the-yaml-way-e035c20af275?source=rss-712927172beb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e035c20af275</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[azure-data-factory]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Raghavendra Bharadwaj]]></dc:creator>
            <pubDate>Wed, 29 Sep 2021 06:39:40 GMT</pubDate>
            <atom:updated>2021-09-29T06:39:40.784Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To: Azure Data Factory CI/CD with Azure DevOps pipelines — The YAML WAY!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HsSs3xg2LuONw6-M" /><figcaption>Photo by <a href="https://unsplash.com/@quinten149?utm_source=medium&amp;utm_medium=referral">Quinten de Graaf</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When you consider the vast ecosystem of Azure Data Platform, Azure Data Factory can be considered a de-facto Data integration service that provides rich out of the box support to develop and orchestrate data-driven workflows.</p><p>Although ADF is devised to be a “code-free” tool, under the hood ADF stores all of the configurations (data pipelines, linked services, datasets, etc.) as ARM templates. While it is very important to focus on how this code is packaged and shipped across environments, implementation of CI/CD is quite unique to ADF. In this article, we look at CI/CD workflows of Azure Data Factory</p><p>We leverage these ARM templates and override default values of ARM template parameters with environment-specific values. This helps in moving the code from a lower environment (potentially a dev environment) to a higher environment (UAT, prod, etc.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*6Vh6PYp9gyUVaetl92YAMQ.jpeg" /></figure><h3>CI-Workflow</h3><p>To begin with, we integrate the development environment/the lowermost environment ADF with Azure DevOps repository. In our case, an ADF cluster named “servian-demo-dev-adf” is integrated with Azure DevOps (refer to Pic 1.0). The other environments including production should be updated via the ARM template deployment using Azure DevOps Pipelines.</p><p>While we establish the connection between Azure DevOps and ADF, we notice there are a couple of branches that are defined. Let’s understand what these branches are for:</p><ol><li><strong>Collaboration branch:</strong> As the name suggests, this branch is used to collaborate with other developers working on the environment. From a workflow point of view, developers work on their individual branches and once the task is completed, a pull request is raised to merge the changes from the “feature” branch into the collaboration branch. Once the PR is approved, the code is moved to the collaboration branch.</li><li><strong>Publish branch:</strong> This is a special branch specific to ADF and is automatically created by Azure. Once all the developers have “Collaborated”, code can be published from the Publish branch as ARM templates. These templates can be used to override default values with environment-specific values as you move from a lower environment to a higher environment.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cIHHEb_U_WEmmvRcTJ-Vkw.png" /><figcaption>Pic: 1.0</figcaption></figure><p>Let’s look at the above workflow in action:</p><ul><li>We create a feature branch called “feature/adf-demo” and create a simple pipeline that copies data from one storage account to another with a few linked services associated with it. Be assured, steps remain the same even for the complex of pipelines (refer to Pic 2.0).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwUJkZHUR-eeU88P" /><figcaption>Pic: 2.0</figcaption></figure><ul><li>Once the changes are complete, save and open a pull request to “collaboration branch”. In our example, “master” branch is set as Collaboration branch. However, this can change based on project requirements. Once the merge is successfully completed, the “Publish” button gets activated under collaboration branch within the ADF portal. Click on publish, verify that the right changes are being pushed as templates into “adf_publish” branch (refer to Pic: 3.1–3.5)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*08d8lVE0637vXEzL" /><figcaption><em>Pic: 3.1-Opening a pull request on ADF</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*532VggKuh2rKNXas" /><figcaption><em>Pic: 3.2-Complete the Pull Request</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CoHdprzvph0SHiyM" /><figcaption><em>Pic: 3.3-The Publish button is enabled on the “Collaboration” branch.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c8ZwiHFySEoDavbl" /><figcaption><em>Pic: 3.4-You get to review the changes and also that the code will be published as ARM templates.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5WlNvdo1fQ1WzFtw" /><figcaption><em>Pic: 3.5-On successful publish, ARM templates will be placed under the name of ADF cluster (in our case “servian-demo-dev-adf”) in adf_publish branch.</em></figcaption></figure><h3>CD-Pipeline</h3><p>Now that we have completed the CI phase, let’s look at the CD side of things. We make use of Azure DevOps YAML pipelines to promote changes to another environment. For demonstration purposes, another ADF cluster called “servian-demo-prod-adf” is created which emulates a Prod environment. As explained above, prod ADF is not integrated with any repository and all changes to this environment will be through an ARM template deployment via Azure DevOps pipeline.</p><p>The deployment pipeline has two stages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyRsXKM2JG2Irpk69WEZwg.png" /></figure><ol><li>The first is to generate an Artefact using ARM templates as it allows us to package the code with a version number.</li><li>Second, to use a combination of Azure DevOps tasks such as “AzurePowerShell” and “AzureResourceGroupDeployment” to deploy the ARM templates.</li></ol><p>Of course, this is just to showcase how deployment to ADF works. Multiple stages can be added to the pipeline ranging from pre-deployment tasks like provisioning the Infrastructure to post-deployment tasks like testing the deployment.</p><p>As a prerequisite, have the below components ready in Azure DevOps</p><ol><li>A service connection that has the right privileges to deploy on the ADF.</li><li>An Azure DevOps “environment” to provide approval before deploying.</li><li>An Azure DevOps Library to store variables. It should be backed by a Key vault if sensitive values are being passed.</li></ol><p>The first part of the pipeline involves defining the trigger and choosing the agent pool. Since adf_publish is the branch that gets the final update of the ARM templates, the CI trigger is set to “adf_publish” branch (refer to pic 4.0).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ckwveDdNlRXgNuPb" /><figcaption>Pic: 4.0</figcaption></figure><p>The next stage is to build and generate the Artefacts.</p><p>The first task within this stage is to copy the “servian-demo-dev-adf” folder from “adf_publish” branch into a temporary workspace and switch back to the default branch (in our case it’s the master). If a more Azure DevOps native task is preferred instead of using a bunch of shell commands, “CopyFiles” task can be considered (refer to Pic 5.0).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UG5P-wETsmfClytRhqRZXw.png" /><figcaption>Pic: 5.0</figcaption></figure><p>The next task is to Publish the Artifact using “PublishPipelineArtifact@1” Azure DevOps task. We also use the predefined variable “Build.BuildNumber” to tag a version number to the artifact (refer to Pic 6.0).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*ZNfEHnXyQhrkjkv2QwPJPw.png" /><figcaption>Pic: 6.0</figcaption></figure><p>Moving on to the next stage “ADFDeployment” (refer to pic 7.1), we deploy the ARM templates and deploy them onto the target ADF.</p><p>To begin with, we use a special Azure DevOps job called a “Deployment” job. Among the multiple benefits of using a Deployment job, is that we can use the “Environment” flag to define our target environment to enable approval gates before deployment. Also, the Azure DevOps library that was created as a prerequisite is called “prod-adf-lib” housing all of the variable values used in the deployment stage. This is called a variable group within the stage.</p><p>The first task in this stage is to get the Artifacts that were generated in the previous stage by using “DownloadPipleineArtifact@2”.</p><p>Note: The project ID can be obtained by using https://dev.azure.com/{{project_name}}/_apis/projects?api-version=5.0-preview.3</p><p>Using this task gives us control over which version of the Artefact is deployed and can be further tweaked to be used in rollback strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zV40ssSTZxJ-POFaRt01AA.png" /><figcaption>Pic: 7.1</figcaption></figure><p>The next 3 tasks within this stage are the core tasks of the Deployment (refer to Pic 7.2).</p><p>First is a pre-deployment script that is run using “AzurePowerShell@5” task to stop all the triggers. The script can be found at <a href="https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery#script">Continuous integration and delivery in Azure Data Factory</a>.</p><p>Note that the script is run with the pre-deployment flag set to true and deletedeployment set to false in this task. The script Arguments gets values from the previously defined library variable group.</p><p>The next task is to deploy the ARM templates. All the variables that can be overridden by environment-specific values can be found in ARMTemplateParametersForFactory.json.</p><p>We override these values with environment-specific variables using Azure DevOps library. General practice is to create one library per environment. Even a key vault can be used to pass sensitive values. In the below example, we are replacing ADF cluster name, account key for linked service ADLS storage account and connection strings for the storage account.</p><p>The last task is to run the same script we ran before but with different variations of flags. Here, pre-deployment flag is set to false and deletedeployment set to true. This starts all the triggers as well as deletes the resources that have been removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*22dvCc_j52Sz4JVpt1IuXg.png" /></figure><h3>Testing and Conclusion</h3><p>In our example, the pipeline is placed in the “adf_publish” branch. Create a pipeline by passing the YAML file and run the pipeline. Since the pipeline is in the form of code, incremental changes are possible while improvements to the pipeline can be made by parameterising and templating the pipeline. Each task can be monitored by clicking on individual panes of the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9i-161UACnIGXo6Y" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e035c20af275" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weareservian/how-to-azure-data-factory-ci-cd-with-azure-devops-pipelines-the-yaml-way-e035c20af275">How To: Azure Data Factory CI/CD with  Azure DevOps pipelines — The YAML WAY!</a> was originally published in <a href="https://medium.com/weareservian">Cognizant Servian</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>