<?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 Jagdeep Soni on Medium]]></title>
        <description><![CDATA[Stories by Jagdeep Soni on Medium]]></description>
        <link>https://medium.com/@jssoni?source=rss-caf254101b9f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E-zFZ-2ugDviAIUaZ0nafQ.jpeg</url>
            <title>Stories by Jagdeep Soni on Medium</title>
            <link>https://medium.com/@jssoni?source=rss-caf254101b9f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 03:57:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jssoni/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Infrastructure-As-Code for AWS using Azure DevOps, CloudFormation Template, and Terraform]]></title>
            <link>https://faun.pub/infrastructure-as-code-for-aws-using-azure-devops-cloudformation-template-and-terraform-8c3a7500d6e5?source=rss-caf254101b9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c3a7500d6e5</guid>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[azure-devops]]></category>
            <dc:creator><![CDATA[Jagdeep Soni]]></dc:creator>
            <pubDate>Sat, 26 Dec 2020 19:04:28 GMT</pubDate>
            <atom:updated>2021-01-05T11:17:03.419Z</atom:updated>
            <content:encoded><![CDATA[<h4>An approach to set up IaC for AWS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWbB9KFrpa_P64hLUeM-3w.png" /></figure><p>Infrastructure as code is now mainstream for cloud infrastructure provisioning and managing. There is no second argument about the need of setting up IaC as a part of modern application development. There are various frameworks and tools available to setup IaC. <a href="https://www.terraform.io/">Terraform</a> is one of the most popular infrastructures as a code software tool. In this article, we will see how to use Terraform for <a href="https://aws.amazon.com/">AWS</a> cloud.</p><p>You may be wondering why I am using all these tools together. So, here is my explanation.</p><blockquote><strong>1)</strong> Azure DevOps is used as a CI tool to create pipelines. We can also use AWS CI tools or gitlab runners or any other tool.</blockquote><blockquote>2<strong>)</strong> CloudFormation is used to create first VM in AWS that could be registered as an AZ DevOps agent. We can also create this VM using Web Portal or AWS CLI.</blockquote><blockquote>3<strong>)</strong> And finally Terraform, which is my tool of choice for IaC. You can continue to use CloudFormation templates for other infrastructure set up as well.</blockquote><h3>So, what is in it for you?</h3><p>The end goal is to be able to execute the Terraform code to create AWS resources. Usually, we have to deal with the complexity of managing access keys to initiate terraform but we will first create EC2 instance with an Admin role to execute terraform code.</p><p><strong>The whole activity can be split into the following steps:</strong></p><ul><li>CloudFormation template to create a VM</li><li>Register this VM as Azure DevOps agent</li><li>Create an Azure DevOps pipeline to trigger the CloudFormation template</li><li>Terraform sample to create AWS resource</li><li>Azure DevOps pipeline sample to trigger terraform</li></ul><h3>Let’s get started with some code</h3><p>We need a <a href="https://aws.amazon.com/cloudformation/">CloudFormation</a> template to create an <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html">AWS stack</a>. The below gist can be used to create a VM and other required resources.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c40cbfe0af010d6eeeb4433354b6c26/href">https://medium.com/media/6c40cbfe0af010d6eeeb4433354b6c26/href</a></iframe><blockquote>💡 It is important to note role assignment in the above snippet. arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM is required for instance connection and arn:aws:iam::aws:policy/AdministratorAccess to execute terraform code from this agent</blockquote><p>Now that we have the VM in place, we need to configure this VM as a DevOps agent. We can follow the steps described <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops">here</a> to configure this VM as an agent. Some of these steps can be configured in UserData field in the above template. A small snippet is shown below.</p><pre>UserData:<br> Fn::Base64: <em>!Sub</em> |<br>  #!/bin/bash<br>  export PAT_TOKEN=${PatToken}<br>  export POOL_NAME=${PoolName}<br>  export AGENT_NAME=${AgentName}</pre><pre>## Download the Linux agent</pre><pre>/home/ubuntu/buildagent/config.sh --unattended --auth pat --token $PAT_TOKEN --url https://dev.azure.com/ --pool $POOL_NAME --agent $AGENT_NAME</pre><pre>sudo /home/ubuntu/buildagent/svc.sh install</pre><pre>sudo /home/ubuntu/buildagent/svc.sh start</pre><p><strong>Time to put the pipeline in place</strong></p><p>Let’s create an Azure DevOps pipeline to trigger this CloudFormation template. We first need to create AWS <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&amp;tabs=yaml">Service Connection</a> in Azure DevOps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*jDYWEJ1ja03hxyD6sMe5uw.png" /><figcaption>Service Connection in Azure DevOps</figcaption></figure><p>We can then use AWS tasks to configure this pipeline. In this case, we need the AWS CloudFormation Create/Update Stack task. We need to fill in some of the following inputs to use this task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y125HiGhaztQ9XPHEpn-yQ.png" /></figure><p>Finally, the pipeline yaml would look like the below snippet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb26b407f9c1e42abf256419443f221c/href">https://medium.com/media/eb26b407f9c1e42abf256419443f221c/href</a></iframe><h4>Time to create a Terraform script</h4><p>There are a few good scripts in <a href="https://github.com/hashicorp/terraform-provider-aws/tree/master/examples">this</a> repository. For this article, we will take a simple example to create <a href="https://aws.amazon.com/ecr/">Elastic Container Registry(ECR)</a> using terraform.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b655a0d41b825430ef42931af538f34/href">https://medium.com/media/9b655a0d41b825430ef42931af538f34/href</a></iframe><p>Now the final step is to create an Azure DevOps Pipeline to trigger terraform code. Below is the code snippet for Azure DevOps Pipeline.</p><blockquote>We need to make sure that we should use same Agent Pool in which we have registered the instance created in step 1</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a90e4c6e0347699ca7072a5de0d25abe/href">https://medium.com/media/a90e4c6e0347699ca7072a5de0d25abe/href</a></iframe><h3>Conclusion 🎉</h3><p>I hope this article will help you to kick start IaC in your application. Please feel free to share your questions, feedback, and experience in the comments section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c3a7500d6e5" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/infrastructure-as-code-for-aws-using-azure-devops-cloudformation-template-and-terraform-8c3a7500d6e5">Infrastructure-As-Code for AWS using Azure DevOps, CloudFormation Template, and Terraform</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Multiple Ingress Gateways in Istio]]></title>
            <link>https://faun.pub/setup-multiple-ingress-gateways-in-istio-52ad0dc7f99d?source=rss-caf254101b9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/52ad0dc7f99d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[istio]]></category>
            <dc:creator><![CDATA[Jagdeep Soni]]></dc:creator>
            <pubDate>Tue, 11 Aug 2020 08:03:10 GMT</pubDate>
            <atom:updated>2020-08-17T16:37:59.159Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to setup Istio Ingress Gateways with internal and external Loadbalancer in Azure Kubernetes Service</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8lGnT5BAai9fX4eBRK0uw.png" /></figure><p>When I was setting up <a href="https://istio.io/">Istio</a> in my project, I came across a need to set up multiple Ingress Gateways. You may ask WHY?</p><blockquote>If we have multiple VNETS + NSG rules configured for our Kubernetes clusters and other cloud services then we may need Ingress Gateways with Internal and External IPs.</blockquote><p>In my case, I had <a href="https://docs.microsoft.com/en-us/azure/aks/private-clusters">AKS private cluster</a> and <a href="https://docs.microsoft.com/en-us/azure/logic-apps/connect-virtual-network-vnet-isolated-environment-overview">Azure Logic Apps with ISE</a>. I had <a href="https://istio.io/docs/setup/install/multicluster/shared/">Istio Multi cluster</a> installation(refer to my other <a href="https://medium.com/faun/istio-multi-cluster-setup-on-aks-361fb55ee5c0">article</a> for multi-cluster Istio setup), which had Istio Ingress Gateway with an External IP. But later I had to set up another Istio Ingress Gateway with Internal IP to enable connection with logic apps. It is a very practical scenario because we could have cloud services in different VNETs that are peered with each other. And then we need Gateway with Internal IP to enable service connection.</p><h3>What we will learn?</h3><ol><li>In this article, we will see how to customize Istio installation to add a component with custom properties</li><li>We will set up an Ingress gateway with internal IP and standard Ingress gateway with external IP and validate the setup with an example application</li></ol><h3>Let’s start</h3><p>We can install Istio using <a href="https://istio.io/latest/docs/setup/install/standalone-operator/">standalone operator</a> installation. This method gives us a good way to customize the installation. A simple istio configuration may look like a code snippet shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/140010affc2f74199ef84f889fdec58e/href">https://medium.com/media/140010affc2f74199ef84f889fdec58e/href</a></iframe><p>This code snippet will setup istio with the default configuration of its components such as grafana, ingress gateway, etc.</p><blockquote>What if we need to modify the default configuration of istio components?</blockquote><p>The answer is simple — we can add the components configuration to the same yaml configuration that is shown above. We can generate yaml for istio profile using istioctl profile dump default This command will generate the complete profile dump for the default profile. This will be a very long yaml, so we need to search for a specific component to see the configuration.</p><p>💡 Tip! We also dump specific component configuration using istioctl profile dump — config-path components.ingressGateways default</p><h4>Modify default properties of a component</h4><p>We can use overlays object to modify the default properties of a component in istio configuration. For example in the code snippet shown below, we are modifying app labels</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5caf9ca0820bc9fa9f3cf851546e2b14/href">https://medium.com/media/5caf9ca0820bc9fa9f3cf851546e2b14/href</a></iframe><h4>Create additional ingress gateway with internal IP</h4><p>Now it’s time to add ingress gateway with internal IP. As I explained the use-case in the beginning, we need 2 gateways — one that has a public IP address and one that has an internal IP address, which is available only within peered VNETs. For Azure Kubernetes Service we need to use serviceAnnotations — service.beta.kubernetes.io/azure-load-balancer-internal: “true” to get an internal IP. You can read more about AKS internal load balancer from <a href="https://docs.microsoft.com/en-us/azure/aks/internal-lb">this</a> link.</p><p>We also need to modify the default label to have a unique selector for both internal and external gateways. We can modify this using overlays objects described in the previous section.</p><p>The following configuration will create 2 ingress gateways — istio-internal-ingressgateway with internal IP and istio-ingressgateway with external IP.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a9f8009f66feebfe15464989e15a695/href">https://medium.com/media/5a9f8009f66feebfe15464989e15a695/href</a></iframe><p>Now we are all set to use both the ingress gateways. Check the IP address using the following command. You will see the internal IP address from istio-internal-ingressgateway</p><pre>kubectl get svc -n istio-system</pre><p>We can create a gateway object to use this internal ingress gateway</p><pre>apiVersion: networking.istio.io/v1alpha3<br>kind: Gateway<br>metadata:<br>  name: mygateway<br>spec:<br>  selector:<br>    istio: istio-internal-ingressgateway # selector for internal<br>  servers:<br>  - port:<br>      number: 80<br>      name: http<br>      protocol: HTTP<br> secret<br>    hosts:<br>    - &quot;*&quot;</pre><h3>Closing Remarks 🎉</h3><p>I hope this article will help you with the multiple ingress controllers in Istio. Please feel free to share your feedback and experience in the comments section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Subscribe to </strong><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumprebanner"><strong>FAUN topics</strong></a><strong> and get your weekly curated email of the must-read tech stories, news, and tutorials </strong>🗞️</p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52ad0dc7f99d" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/setup-multiple-ingress-gateways-in-istio-52ad0dc7f99d">Setup Multiple Ingress Gateways in Istio</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</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 use secrets from Azure Key Vault in Azure Kubernetes Service]]></title>
            <link>https://faun.pub/how-to-use-secrets-from-azure-key-vault-in-azure-kubernetes-service-704973be5fc1?source=rss-caf254101b9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/704973be5fc1</guid>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[azure-key-vault]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jagdeep Soni]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 14:25:51 GMT</pubDate>
            <atom:updated>2020-06-11T09:53:36.151Z</atom:updated>
            <content:encoded><![CDATA[<h4>Secure way of using secrets from Azure Key Vault in AKS cluster</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szSfus-4uJg7Qc4mAeS3hg.png" /></figure><p>Managing secrets and using secrets in the Kubernetes environment is a very important security aspect. It is very essential for DevOps engineers to properly define an ecosystem for handling secrets during application deployment.</p><p>In this article, we will discuss a secure way of using secrets that are stored in Azure Key Vault into your Azure Kubernetes Cluster(AKS). We will talk about different approaches but will primarily focus on the <a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure">Secret Store CSI Driver</a>.</p><blockquote>The Scenario: You have to deploy an application that needs to connect to database.. hmm, so you need DB user name and password and it has to be securely stored.</blockquote><h4>Standard Approach</h4><p>We can inject sensitive data such as usernames and passwords into pods using the secret object. Let’s take an example, we have db_username as iamdbadmin db_passwrod as supersecret. First, we need to convert these variables into base64 encoded format.</p><pre>echo -n &#39;iamdbadmin&#39; | base64<br>echo -n &#39;supersecret&#39; | base64</pre><p>Then we need to create a configuration file to create a secret</p><pre>cat &lt;&lt;EOF&gt; db-secret.yaml<strong><br>apiVersion</strong>: v1<br><strong>kind</strong>: Secret<br><strong>metadata</strong>:<br>  <strong>name</strong>: db-secret<br><strong>data</strong>:<br>  <strong>username</strong>: aWFtZGJhZG1pbg==<br>  <strong>password</strong>: c3VwZXJzZWNyZXQ=<br>EOF</pre><p>Create the secret</p><pre>kubectl apply -f db-secret.yaml</pre><p>Now we can create a resource, which is using secret values in env</p><pre><strong>apiVersion</strong>: v1<br><strong>kind</strong>: Pod<br><strong>metadata</strong>:<br>  <strong>name</strong>: nginx-pod<br><strong>spec</strong>:<br>  <strong>containers</strong>:<br>  - <strong>name</strong>: nginx-container<br>    <strong>image</strong>: nginx<br>    <strong>env</strong>:<br>    - <strong>name</strong>: DB_USERNAME<br>      <strong>valueFrom</strong>:<br>        <strong>secretKeyRef</strong>:<br>          <strong>name</strong>: db-secret<br>          <strong>key</strong>: username<br>    - <strong>name</strong>: DB_PASSWORD<br>      <strong>valueFrom</strong>:<br>        <strong>secretKeyRef</strong>:<br>          <strong>name</strong>: db-secret<br>          <strong>key</strong>: password</pre><p>Or we can use envFrom to use all the secret’s data in container environment variables.</p><pre><strong>apiVersion</strong>: v1<br><strong>kind</strong>: Pod<br><strong>metadata</strong>:<br>  <strong>name</strong>: nginx-pod<br><strong>spec</strong>:<br>  <strong>containers</strong>:<br>  - <strong>name</strong>: nginx-container<br>    <strong>image</strong>: nginx<br>    <strong>envFrom</strong>:<br>    - <strong>secretRef</strong>:<br>        <strong>name</strong>: db-secret</pre><blockquote>Well, this is simple! But project scenarios are not so simple. Secrets are stored in some sort of a digital vault, and then the DevOps team has to take care of making it available for the applications. To implement all the security best practices we should use Pod identity to access secrets.</blockquote><h4>Security best practice approach</h4><p>Securing private data is a top priority for DevSecOps practitioners. <a href="https://docs.microsoft.com/en-us/azure/key-vault/general/">Azure Key Vault</a>(AKV) is a very good solution to store keys, secrets, and certificates. Once we store secrets in AKV we also need a proper mechanism to use them in our applications.</p><p>If we are using <a href="https://azure.microsoft.com/en-in/services/devops/">Azure DevOps</a> then we can create a secret object in the release stage. We need to create a service connection that can connect with AKV to pull the secrets during pipeline execution.</p><blockquote>In this article, we will discuss another approach that can directly get secret content from AKV and mount in the Pods.</blockquote><h4>Azure Key Vault Provider for Secrets Store CSI Driver</h4><p><a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure">Azure Key Vault provider</a> for <a href="https://github.com/kubernetes-sigs/secrets-store-csi-driver">Secret Store CSI Driver</a> allows us to get secrets from AKV and mounts them in the Pods or sync them in the secret object.</p><ol><li><strong>Installation: </strong>It is very important to use the recommended Kubernetes version ( v1.16.0+) otherwise this driver will not work.</li></ol><p>We will do helm deployment using the following commands</p><pre>helm repo add secrets-store-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/secrets-store-csi-driver/master/charts</pre><pre>helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver -n azure-akv</pre><p>Verify this installation using kubectl get po -n azure-akv . We should see pods for secret store CSI driver</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zw1_sxIUdG0ipho_qPTq7Q.png" /></figure><p>2. Setup Azure Provider using kubectl apply</p><pre>kubectl apply -f https://raw.githubusercontent.com/Azure/secrets-store-csi-driver-provider-azure/master/deployment/provider-azure-installer.yaml --namespace azure-akv</pre><p>Verify usingkubectl get po -n azure-akv , we should see the following output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDmKNa03pYS4Zgtg4qxvug.png" /></figure><p>3. Create an Azure Key Vault Resource — We can use the Azure portal to create AKV. Please refer to <a href="https://docs.microsoft.com/en-us/azure/key-vault/secrets/quick-create-portal">this</a> tutorial to use the Azure portal for AKV. We name this resource as db-keys</p><p>4. Create SecretProviderClass object — This custom resource will provide the required parameters for Secret Store CSI Driver. Update resourceGroup, subscriptionId and tenantId in azure-kv-provider.yaml .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f50380da55b0e4561785d09b70efbb71/href">https://medium.com/media/f50380da55b0e4561785d09b70efbb71/href</a></iframe><p>5. Provide Identity to access KeyVault — there are 4 modes for accessing key vault</p><ul><li><a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure/blob/master/docs/service-principal-mode.md">Service Principal</a></li><li><a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure/blob/master/docs/pod-identity-mode.md">Pod Identity</a></li><li><a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure/blob/master/docs/user-assigned-msi-mode.md">VMSS User Assigned Managed Identity</a></li><li><a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure/blob/master/docs/system-assigned-msi-mode.md">VMSS System Assigned Managed Identity</a></li></ul><blockquote>In this article, we will use the 1st option of using the Service Principal.</blockquote><p>If we have the Service Principle that can access KeyVault then we don’t need to create a new SP. We just have to make sure the SP has permission to read secrets and keys. We can use the following commands to create SP if we don’t have one already.</p><pre># Create SP<br>az ad sp create-for-rbac --skip-assignment --name $SP_NAME</pre><pre># Get client id of SP<br>SP_CLIENT_ID=$(az ad sp show --id $SP_NAME --query appId -o tsv)</pre><pre># Role Assignment for AKV<br>az role assignment create --role Reader --assignee $SP_CLIENT_ID --scope /subscriptions/$SUBID/resourcegroups/$KEYVAULT_RESOURCE_GROUP/providers/Microsoft.KeyVault/vaults/$KEYVAULT_NAME</pre><pre># Set permissions to read secrets<br>az keyvault set-policy -n $KEYVAULT_NAME --secret-permissions get --spn $SP_CLIENT_ID</pre><p>Now we can generate a secret with SP_CLIENT_ID and SP_CLIENT_SECRET This secret is used by pods to get secret from AKV</p><pre>kubectl create secret generic akv-creds -n azure-akv --from-literal clientid=$SP_CLIENT_ID --from-literal clientsecret=$SP_CLIENT_SECRET</pre><p>6. Deploying the sample application — Finally, we can deploy a sample application to verify the setup.</p><p>kubectl apply -f sample-app.yaml</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22e4be3c22b39f45d05812f67a0e1b3f/href">https://medium.com/media/22e4be3c22b39f45d05812f67a0e1b3f/href</a></iframe><p>Wait for the pod to start, once it is running we can verify mounted content at the specified path.</p><pre>#Show secrets<br>kubectl exec -it nginx-secrets-store ls /mnt/secrets-store/</pre><pre># Verify secrets mentioned in provider class<br>kubectl exec -it nginx-secrets-store cat /mnt/secrets-store/db-username</pre><pre>kubectl exec -it nginx-secrets-store cat /mnt/secrets-store/db-password</pre><h3>What Next?</h3><p>There are few good examples in the <a href="https://github.com/Azure/secrets-store-csi-driver-provider-azure">repository</a>. You can try out these examples to understand this plugin in a bit more detail.</p><p>Also, go through <a href="https://docs.microsoft.com/en-us/azure/aks/developer-best-practices-pod-security">Azure’s best practice</a> recommendation for Pod security.</p><p>Stay tuned for my next blog on using Pod identity for accessing KeyValut. Please share your comments or questions in the feedback section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Subscribe to </strong><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumprebanner"><strong>FAUN topics</strong></a><strong> and get your weekly curated email of the must-read tech stories, news, and tutorials </strong>🗞️</p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=704973be5fc1" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/how-to-use-secrets-from-azure-key-vault-in-azure-kubernetes-service-704973be5fc1">How to use secrets from Azure Key Vault in Azure Kubernetes Service</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Istio Multi Cluster setup on AKS]]></title>
            <link>https://faun.pub/istio-multi-cluster-setup-on-aks-361fb55ee5c0?source=rss-caf254101b9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/361fb55ee5c0</guid>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[multi-cluster]]></category>
            <dc:creator><![CDATA[Jagdeep Soni]]></dc:creator>
            <pubDate>Fri, 15 May 2020 07:28:25 GMT</pubDate>
            <atom:updated>2020-06-07T15:49:23.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIqAe9b4A4IPoK0DkxuCOA.png" /></figure><h3>Istio Multi-Cluster setup on AKS</h3><h4>In this article, we will explore the multi-cluster setup of Istio with the shared control plane. We will also set up a sample application to verify this setup.</h4><p><strong>Why I am writing this article?</strong></p><p>While implementing Istio for my project I struggled a lot to find proper reference material for multi-cluster Istio setup. I referred to Istio documentation but it does not provide clear instructions to set up a production-grade system. And I couldn&#39;t find practical examples to test this setup. Hopefully, I can address these issues in this article.</p><p><strong>Who should read this article?</strong></p><p>Solution architects and Kubernetes developers who are planning to use Istio in their projects.</p><p><strong>Istio Background</strong></p><p>Istio is an open source service mesh designed to secure and manage traffic between microservices running in different containers. Core features of Istio are — Traffic management, Security, and Observability.</p><p>Istio offers different deployment models for production deployment. Different combination options are:</p><ol><li>single or multiple cluster</li><li>single or multiple network</li><li>single or multiple control plane</li><li>single or multiple meshes</li></ol><p>In real-world project scenarios, we often need multiple clusters. <em>So in this article, we will focus on multi cluster setup with the shared control plane.</em></p><p><strong>☑️Prerequisites</strong></p><ol><li>Basic understanding of Kubernetes</li><li>Kubectl installed on your development environment</li><li>Two or more clusters running with the supported Kubernetes version. I am using <a href="https://azure.microsoft.com/en-in/services/kubernetes-service/">Azure AKS</a> for this blog post</li></ol><p>Enough talking lets start with the setup.</p><h3><strong>Preparation</strong></h3><p>Download a specific release or the latest release. I am using istio-1.5.2 at time of writing this</p><pre>curl -L https://istio.io/downloadIstio | sh -</pre><p>Copy istioctl client library to user program location path or export istioctl bin path to PATH</p><pre>cd istio-$ISTIO_VERSION <br>sudo cp ./bin/istioctl /usr/local/bin/istioctl <br>sudo chmod +x /usr/local/bin/istioctl</pre><blockquote>There are multiple ways to install Istio on the cluster but we often need to customize the configuration for our needs. <a href="https://istio.io/docs/setup/install/standalone-operator/">Standalone Operator</a> install is easy to customize and integrate with CI pipeline. I believe this is the best option to install Istio.</blockquote><p>Let us create 2 clusters on AKS — app-cluster and processing-cluster . We are not going to discuss AKS setup in this article but you can refer to this amazing <a href="https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal">documentation</a> courtesy Azure.</p><p>Login to app cluster using the following command</p><pre>az aks get-credentials --resource-group $resource-group-name --name app-cluster</pre><p>Deploy Istio operator on this cluster</p><p><strong>Step 1:</strong></p><pre>istioctl operator init</pre><p>Create istio-system namespace and install certificates in both the clusters. These certificates are in istio folder that we downloaded in the beginning.</p><p><strong>Step 2:</strong></p><pre>kubectl create namespace istio-system <br>kubectl create secret generic cacerts -n istio-system \     <br>--from-file=<a href="https://raw.githubusercontent.com/istio/istio/release-1.5/samples/certs/ca-cert.pem">samples/certs/ca-cert.pem</a> \     <br>--from-file=<a href="https://raw.githubusercontent.com/istio/istio/release-1.5/samples/certs/ca-key.pem">samples/certs/ca-key.pem</a> \     <br>--from-file=<a href="https://raw.githubusercontent.com/istio/istio/release-1.5/samples/certs/root-cert.pem">samples/certs/root-cert.pem</a> \     <br>--from-file=<a href="https://raw.githubusercontent.com/istio/istio/release-1.5/samples/certs/cert-chain.pem">samples/certs/cert-chain.pem</a></pre><p>Repeat Step 1 and Step 2 for processing-cluster</p><h3><strong>Deployment</strong></h3><p>Switch context to app-cluster . Let’s consider this as our <strong>main cluster</strong> and processing-cluster as a <strong>remote cluster.</strong></p><p>Create a configuration for the main cluster. We are going to create config with the internal load balancer <a href="https://istio.io/docs/setup/install/multicluster/shared/">option</a>. This option is very useful if we have to handle complex networking.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e40b17d28190e8a7eb90eba347e90f44/href">https://medium.com/media/e40b17d28190e8a7eb90eba347e90f44/href</a></iframe><p>This is a standard yaml that we can use with kubectl apply command and this makes it easy for CI implementation.</p><p>Apply this configuration to the main cluster</p><pre>kubectl apply -f istio.main.yaml</pre><blockquote>We can also use —-context flag if we don’t want to switch context again and again.</blockquote><blockquote>kubectl --context=${MAIN_CLUSTER_CTX} -f istio.main.yaml</blockquote><p>Wait till all the pods are up and running and istiod service gets the EXTERNAL-IP</p><pre>kubectl get po -n istio-system -w<br>kubectl get svc -n istio-system -w</pre><p>Note the value of EXTERNAL-IP of istiod , this is the value of ISTIOD_REMOTE_EP that we need to replace in the remote configuration.</p><p>Create the configuration for the remote cluster. Make sure that the cluster name and network name are the same as mentioned in the main cluster configuration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9618f3085a23d087a6731a4bc7bd60ce/href">https://medium.com/media/9618f3085a23d087a6731a4bc7bd60ce/href</a></iframe><p>Apply this configuration to the remote cluster</p><pre>kubectl apply -f istio.remote.yaml</pre><p>It is practical to have these 2 clusters in different networks, in this case, we need to configure the ingress gateway for cross-cluster load balancing. apply this configuration to <strong>both</strong> the clusters.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c9022fc8a431237601057caf34d9be26/href">https://medium.com/media/c9022fc8a431237601057caf34d9be26/href</a></iframe><p>The last step is to configure the cross-cluster service registry for service discovery. The Istio control plane requires access to all the clusters in the mesh to discover services. To enable this access we need to create a secret with remote cluster credentials in the main cluster.</p><pre>istioctl x create-remote-secret --context=${REMOTE_CLUSTER_CTX} --name ${REMOTE_CLUSTER_NAME} | \     <br>kubectl apply -f - --context=${MAIN_CLUSTER_CTX}</pre><blockquote>This is a very important step, we need to make sure that ${REMOTE_CLUSTER_NAME} is same as mentioned in the istio.main.yaml Otherwise Istio control plane will not be able to discover services deployed in the remote cluster.</blockquote><p>💡We can not use underscore _ in the remote cluster name ${REMOTE_CLUSTER_NAME} . It needs a valid DNS name in the service registry.</p><p>Finally our multi-cluster setup with different networks and shared control plane is ready. Now its time to test this deployment.</p><h3><strong>Sample Application</strong></h3><p>We are not going to test this deployment using <a href="https://istio.io/docs/setup/install/multicluster/shared/">this</a> example. Let’s try to test it using a more practical example. We will use the <a href="https://github.com/Azure-Samples/aks-voting-app">voting app</a> from Azure samples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2kblKPYHyTvPw0OH9Frjw.png" /><figcaption>Sample voting app</figcaption></figure><p>This app has 3 components — voting-app, analytics, and storage. We will deploy voting-app in the app-cluster , which is our <strong>main cluster </strong>and analytics &amp; storage to processing-cluster , which is our <strong>remote cluster.</strong></p><p>Download the artifacts or clone the code</p><pre>git clone https://github.com/Azure-Samples/aks-voting-app.git</pre><p>Switch context to processing-clustr ,and install storage deployment and service.</p><p>Create namespace for this application and label namespace with istio-injection</p><pre>kubectl create namespace voting<br>kubectl label namespace voting istio-injection=enabled</pre><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/kubernetes/voting-storage-deployment-1.0.yaml --namespace voting</pre><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/kubernetes/voting-storage-service.yaml --namespace voting</pre><p>Install analytics deployment and service</p><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/kubernetes/voting-analytics-deployment-1.0.yaml --namespace voting</pre><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/kubernetes/voting-analytics-service.yaml --namespace voting</pre><p>Switch context to app-cluster to deploy voting-app.</p><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/kubernetes/voting-app-deployment-1.0.yaml --namespace voting</pre><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/kubernetes/voting-app-service.yaml --namespace voting</pre><p>To access this app through the ingress gateway, we need to configure VirtualService and Gateway</p><pre>kubectl apply -f aks-voting-app/scenarios/intelligent-routing-with-istio/istio/step-1-create-voting-app-gateway.yaml --namespace voting</pre><p>Obtain IP of the Istio ingress gateway and paste it in browser</p><pre>kubectl get service istio-ingressgateway --namespace istio-system -o jsonpath=&#39;{.status.loadBalancer.ingress[0].ip}&#39;</pre><p>Istio multi cluster deployment and installation of the sample application is successful if we are able to see votes changing on clicking respective buttons.</p><p><strong>Cleaning up</strong></p><pre>kubectl delete istiooperators.install.istio.io -n istio-system main-istiocontrolplane</pre><pre>kubectl delete ns istio-system --grace-period=0 --force</pre><h3><strong>Closing Remarks 🎉</strong></h3><p>I hope this article will help you with the multi-cluster Istio set up and sample application can help to better understand mesh concepts. Please feel free to share your feedback and experience in the comments section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Subscribe to </strong><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumprebanner"><strong>FAUN topics</strong></a><strong> and get your weekly curated email of the must-read tech stories, news, and tutorials </strong>🗞️</p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=361fb55ee5c0" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/istio-multi-cluster-setup-on-aks-361fb55ee5c0">Istio Multi Cluster setup on AKS</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>