<?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 Vimal Vijayan on Medium]]></title>
        <description><![CDATA[Stories by Vimal Vijayan on Medium]]></description>
        <link>https://medium.com/@vvimal44?source=rss-cc4499e0793e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*j9jdnWQCJJLfij7k</url>
            <title>Stories by Vimal Vijayan on Medium</title>
            <link>https://medium.com/@vvimal44?source=rss-cc4499e0793e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 23:39:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vvimal44/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[Set up K3S with Cilium as Core Networking]]></title>
            <link>https://medium.com/@vvimal44/set-up-k3s-with-cilium-as-core-networking-0ea110210592?source=rss-cc4499e0793e------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ea110210592</guid>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[k3]]></category>
            <category><![CDATA[cilium]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Vimal Vijayan]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 10:02:03 GMT</pubDate>
            <atom:updated>2026-01-02T10:02:03.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsQBsK9-p65bDDWOhOu3rA.png" /></figure><p>K3s has become a <strong>popular choice for lightweight Kubernetes setups</strong>, especially for engineers who want to run Kubernetes outside of large cloud environments. Its reduced footprint, simplified installation, and minimal dependencies make it an excellent fit for <strong>home labs, edge deployments, and learning environments</strong>.</p><p>This article was written during the <strong>early phases of my home lab setup</strong>, where I am running <strong>k3s on Proxmox</strong> as the virtualization platform. The goal is to build a realistic, production-style Kubernetes environment at home while still keeping things efficient and manageable. As part of this journey, I chose <strong>Cilium</strong> as the core networking solution to replace traditional kube-proxy and iptables-based networking.</p><p>While this combination is powerful, it also introduces a few <strong>non-obvious requirements</strong>. In particular, <strong>disabling kube-proxy in k3s</strong> and <strong>enabling kube-proxy replacement in Cilium</strong> are not optional — they are fundamental to making the cluster work correctly.</p><p>This article explains <strong>why these steps are necessary</strong>, the problems you will encounter if they are skipped, and how to configure the setup correctly.</p><h3>kube-proxy Is Enabled by Default in k3s</h3><p>By default, <strong>kube-proxy is part of every Kubernetes cluster</strong>, and <strong>k3s is no exception</strong>.</p><p>When k3s is installed without additional flags:</p><ul><li>kube-proxy is automatically deployed</li><li>It programs <strong>iptables-based service routing</strong></li><li>ClusterIP, NodePort, and LoadBalancer services rely on it</li></ul><p>This means that <strong>even if you install Cilium</strong>, kube-proxy will continue to exist <strong>unless it is explicitly disabled</strong> during the k3s installation.</p><blockquote><em>Installing Cilium alone does </em><strong><em>not</em></strong><em> remove kube-proxy.</em></blockquote><h3>Install k3s server</h3><blockquote>Firewall considerations</blockquote><p>For simplicity during initial setup:</p><ul><li>Disable the node-level firewall <strong>or</strong></li><li>Explicitly allow traffic on port <strong>6443/TCP</strong> between all cluster nodes</li></ul><pre>curl -sfL https://get.k3s.io | sh -s - server \<br>  --node-ip=10.50.10.10 \ # Your controlplane IP (private ip)<br>  --advertise-address=10.50.10.10 \ # Your controlplane IP (private ip)<br>  --tls-san=10.50.10.10 \ # Your controlplane IP (private ip) or additional ip<br>  --flannel-backend=none \<br>  --disable-kube-proxy \<br>  --disable=traefik \<br>  --disable=servicelb \<br>  --disable-network-policy</pre><blockquote>Why Traefik and ServiceLB Are Disabled</blockquote><p>Traefik and ServiceLB are disabled, <strong>not because they are unsuitable</strong>, but to keep ingress <strong>decoupled from the cluster bootstrap, </strong>and ServiceLB is not suitable for Cilium EBPF-based service handling, and also lacks advanced load balancing</p><h3>k3s Agent (Worker Node) Installation</h3><p>K3S supports both <strong>single-node</strong> and <strong>multi-node</strong> cluster setups.</p><p>For <strong>home labs and learning environments</strong>, it is very common to start with a <strong>single-node cluster</strong>, where the k3s server acts as both the <strong>control plane and worker node</strong>. In such cases, installing an agent node is <strong>optional</strong>.</p><p>However, when scaling out to a <strong>multi-node setup</strong>, additional nodes can be joined as agents (workers).</p><p>Before installing an agent, retrieve the node token from the control-plane node:</p><pre>sudo cat /var/lib/rancher/k3s/server/node-token</pre><p>On each worker node:</p><pre>curl -sfL https://get.k3s.io | sh -s - agent \<br>  --server https://&lt;control-plane-ip&gt;:6443 \<br>  --token &lt;node-token&gt; \<br>  --node-ip &lt;agent-node-ip&gt;</pre><h3>Installing Cilium as the Core Networking Layer</h3><p>Once k3s is installed and the control plane is reachable, the next step is to install <strong>Cilium</strong> as the <strong>primary CNI and service routing engine</strong> for the cluster.</p><p>Cilium is installed <strong>after</strong> k3s because it depends on a running Kubernetes API server. At this stage, kube-proxy is already disabled, and Cilium will take full ownership of networking.</p><p>Export the KUBECONFIG environment variable for the Cilium CLI to connect to the cluster</p><pre>export KUBECONFIG=/etc/rancher/k3s/k3s.yaml</pre><pre>CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)<br>CLI_ARCH=amd64<br>if [ &quot;$(uname -m)&quot; = &quot;aarch64&quot; ]; then CLI_ARCH=arm64; fi<br>curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}<br>sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum<br>sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin<br>rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}</pre><pre>cilium install --version 1.18.5 \<br>  --set kubeProxyReplacement=true \<br>  --set k8sServiceHost=10.50.10.10 \<br>  --set k8sServicePort=6443 \<br>  --set ipam.operator.clusterPoolIPv4PodCIDRList=&quot;10.42.0.0/16&quot;</pre><p>When <strong>kubeProxyReplacement=true </strong>, Cilium:</p><ul><li>Implements <strong>ClusterIP</strong>, <strong>NodePort</strong>, and <strong>LoadBalancer</strong> services</li><li>Uses <strong>eBPF instead of iptables</strong></li><li>Becomes the <strong>single source of truth</strong> for Kubernetes service routing</li></ul><p>Without this setting, disabling kube-proxy results in broken ClusterIP networking and causes controllers to fail.</p><p>Use the &#39;cilium status&#39; command to view live information about the networking status.</p><pre>root@k8s-controller-01:~# cilium status --wait<br>    /¯¯\<br> /¯¯\__/¯¯\    Cilium:             OK<br> \__/¯¯\__/    Operator:           OK<br> /¯¯\__/¯¯\    Envoy DaemonSet:    OK<br> \__/¯¯\__/    Hubble Relay:       disabled<br>    \__/       ClusterMesh:        disabled<br><br>DaemonSet              cilium                   Desired: 4, Ready: 4/4, Available: 4/4<br>DaemonSet              cilium-envoy             Desired: 4, Ready: 4/4, Available: 4/4<br>Deployment             cilium-operator          Desired: 1, Ready: 1/1, Available: 1/1<br>Containers:            cilium                   Running: 4<br>                       cilium-envoy             Running: 4<br>                       cilium-operator          Running: 1<br>                       clustermesh-apiserver    <br>                       hubble-relay             <br>Cluster Pods:          6/6 managed by Cilium<br>Helm chart version:    1.18.5<br>Image versions         cilium             quay.io/cilium/cilium:v1.18.5@sha256:2c92fb05962a346eaf0ce11b912ba434dc10bd54b9989e970416681f4a069628: 4<br>                       cilium-envoy       quay.io/cilium/cilium-envoy:v1.34.12-1765374555-6a93b0bbba8d6dc75b651cbafeedb062b2997716@sha256:3108521821c6922695ff1f6ef24b09026c94b195283f8bfbfc0fa49356a156e1: 4<br>                       cilium-operator    quay.io/cilium/operator-generic:v1.18.5@sha256:36c3f6f14c8ced7f45b40b0a927639894b44269dd653f9528e7a0dc363a4eb99: 1</pre><p>Validate the cluster networking using the</p><pre>cilium connectivity test</pre><h3>Additional Notes and Troubleshooting Tips</h3><p>If you encounter <strong>any networking-related issues</strong> during or after the setup, always start with the <strong>basics</strong> before diving into deeper debugging.</p><ul><li><strong>Verify that Flannel is disabled</strong></li><li>Flannel is enabled by default in k3s and can silently conflict with Cilium if not disabled.</li><li>This should always be the <strong>first networking check</strong> when troubleshooting unexpected behavior.</li><li><strong>Confirm kube-proxy is disabled and not running</strong></li><li>Running kube-proxy alongside Cilium (with kube-proxy replacement enabled) can lead to unpredictable service routing.</li><li><strong>Check node-to-node connectivity</strong></li><li>Ensure all nodes can reach the Kubernetes API server on <strong>port 6443/TCP</strong>, and that no firewall rules are blocking inter-node communication.</li><li><strong>Validate Cilium health early</strong></li></ul><pre>cilium status</pre><p>Feel free to <strong>raise questions or revisit networking assumptions</strong> as the lab evolves — networking is often the foundation where small misconfigurations can have wide-reaching effects.</p><blockquote>Happy Learning!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ea110210592" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Your Journey: Automating SCIM Configuration for Azure Databricks with Terraform]]></title>
            <link>https://medium.com/@vvimal44/streamlining-your-journey-automating-scim-configuration-for-azure-databricks-with-terraform-e1a1dec21393?source=rss-cc4499e0793e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1a1dec21393</guid>
            <category><![CDATA[azure-ad]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[scim]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[databricks]]></category>
            <dc:creator><![CDATA[Vimal Vijayan]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 15:44:25 GMT</pubDate>
            <atom:updated>2023-10-17T15:54:14.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YCVIXJIrnK5VzRyM.png" /></figure><p>Recently, I embarked on a particularly challenging automation task: automating the SCIM (System for Cross-domain Identity Management) provisioning within the Azure Databricks environment. This journey, spurred by the necessity to efficiently manage user access and identities, highlighted the importance of automation in today’s fast-paced technological arenas. Despite its criticality, I realized that there was a noticeable gap in the comprehensive, step-by-step documentation needed to automate the SCIM setup effectively. This post is inspired by my experience and aims to serve as a practical guide for successfully automating SCIM configuration for Azure Databricks, making this seemingly daunting process more accessible and less prone to manual error.</p><p>Understanding SCIM in the Context of Azure Databricks:</p><p>In the complex world of data analytics, where Azure Databricks has established itself as a frontrunner, managing user access and identities is paramount. SCIM steps into this framework as an open standard designed to simplify user account management and synchronization across identity domains, providing automation for user provisioning that is both reliable and secure.</p><p>Manually configuring SCIM with Azure Databricks typically involves navigating multiple stages, from initial setup in Azure Databricks to intricate identity provider (IdP) configurations and ensuing validation processes. While detailed, the manual approach often proves time-consuming and susceptible to inconsistencies or errors, making the case for automation compelling and rational.</p><p>Let Terraform Automate the SCIM Setup !</p><pre># provider.tf<br><br>terraform {<br><br>  required_providers {<br>    azurerm = {<br>      source  = &quot;hashicorp/azurerm&quot;<br>      version = &quot;3.73.0&quot;<br>    }<br>    azuread = {<br>      source  = &quot;hashicorp/azuread&quot;<br>      version = &quot;2.42.0&quot;<br>    }<br>    databricks = {<br>      source  = &quot;databricks/databricks&quot;<br>      version = &quot;1.26.0&quot;<br>    }<br>  }<br>}<br><br>provider &quot;azurerm&quot; {<br>  features {}<br>}<br><br>provider &quot;azuread&quot; {}<br><br># initiliaze the newly created dbx workspace<br>provider &quot;databricks&quot; {<br>  azure_workspace_resource_id = azurerm_databricks_workspace.dbx_workspace.id<br>}<br><br># initialize provider at Azure account-level for SCIM configuration, The user or the service principal must be added as an account admin if you chose to create the dbx group with the account.<br>provider &quot;databricks&quot; {<br>  alias      = &quot;azure_account&quot;<br>  host       = &quot;https://accounts.azuredatabricks.net&quot;<br>  account_id = &quot;&lt;your databricks account id&gt;&quot;<br>  auth_type  = &quot;azure-cli&quot; # &quot;azure-client-secret&quot; if service principals are used<br>}<br><br></pre><pre>#################################<br>#      SCIM configuration       #<br>#################################<br><br>variable &quot;owners&quot; {<br>  description = &quot;Owners&quot;<br>  type        = set(string)<br>}<br><br>variable &quot;app_name&quot; {<br>  description = &quot;App Name&quot;<br>  type        = string<br>}<br><br>variable &quot;environment&quot; {<br>  description = &quot;Target Environment&quot;<br>  type        = string<br>  default     = &quot;dev&quot;<br>}<br><br>locals {<br>  <br>  dbx_sku = &quot;standard&quot;<br>  scim_groups = {<br>    &quot;co-analytics-dbx-${var.environment}-${var.app_name}-scim&quot; = {<br>      workspace_access      = true<br>      databricks_sql_access = false<br>    }<br>  }<br><br>}<br><br>// Get the owners <br>data &quot;azuread_users&quot; &quot;owners&quot; {<br>  user_principal_names = var.owners<br>}<br><br>data &quot;azurerm_client_config&quot; &quot;current&quot; {}<br><br>resource &quot;azurerm_resource_group&quot; &quot;resource_group&quot; {<br>  name     = format(&quot;rg-%s-%s&quot;, var.environment, var.app_name)<br>  location = &quot;westeurope&quot;<br><br>  lifecycle {<br>    ignore_changes = [tags]<br>  }<br>}<br><br>// Creating the dbx workspace.<br>resource &quot;azurerm_databricks_workspace&quot; &quot;dbx_workspace&quot; {<br>  name                = format(&quot;dbx-%s-%s&quot;, var.app_name, var.environment)<br>  resource_group_name = azurerm_resource_group.resource_group.name<br>  location            = azurerm_resource_group.resource_group.location<br>  sku                 = local.dbx_sku<br><br><br>  lifecycle {<br>    ignore_changes = [tags]<br>  }<br>}<br><br>// Create the ad groups for scim<br>resource &quot;azuread_group&quot; &quot;scim_groups&quot; {<br>  for_each         = local.scim_groups<br>  display_name     = each.key<br>  owners           = data.azuread_users.owners.object_ids<br>  security_enabled = true<br>  members          = data.azuread_users.owners.object_ids<br><br>  lifecycle {<br>    ignore_changes = [owners, members]<br>  }<br>}<br><br>//Get Enterprise application for databricks<br>data &quot;azuread_application_template&quot; &quot;scim&quot; {<br>  display_name = &quot;Azure Databricks SCIM Provisioning Connector&quot;<br>}<br><br>// Random UUID for the application role<br>resource &quot;random_uuid&quot; &quot;uuid&quot; {}<br><br># //Enterprise application<br>resource &quot;azuread_application&quot; &quot;scim&quot; {<br>  display_name = format(&quot;spa-analytics-dbx-%s-%s-provisioning&quot;, var.app_name, var.environment)<br>  template_id  = data.azuread_application_template.scim.template_id<br><br>  app_role {<br>    allowed_member_types = [&quot;Application&quot;, &quot;User&quot;]<br>    description          = &quot;Users can perform limited actions&quot;<br>    display_name         = &quot;User&quot;<br>    enabled              = true<br>    id                   = random_uuid.uuid.result<br>    value                = &quot;User&quot;<br>  }<br><br>  tags = [<br>    &quot;Owner: ${join(&quot;,&quot;, var.owners)}&quot;,<br>    &quot;Description: This SPN is used for databricks SCIM configuration for the app ${var.app_name} ${var.environment}&quot;,<br>  ]<br><br>  lifecycle {<br>    ignore_changes = [owners]<br>  }<br><br>}<br><br>// SCIM SPA<br>data &quot;azuread_service_principal&quot; &quot;scim&quot; {<br>  application_id = azuread_application.scim.application_id<br>}<br><br>// Add SCIM groups to the application<br>resource &quot;azuread_app_role_assignment&quot; &quot;scim&quot; {<br>  for_each            = local.scim_groups<br>  app_role_id         = data.azuread_service_principal.scim.app_role_ids[&quot;User&quot;]<br>  principal_object_id = azuread_group.scim_groups[each.key].object_id<br>  resource_object_id  = data.azuread_service_principal.scim.object_id<br>}<br><br>// Create pat token for the created workspace<br>resource &quot;time_rotating&quot; &quot;scim_pat_rotate&quot; {<br>  rotation_days = 365<br>}<br><br>// The dbx token used in ad applictation provisioner<br>resource &quot;databricks_token&quot; &quot;scim_pat&quot; {<br>  // The pat has a minimum validity of 365Days, until the next terraform run after 365 days<br>  comment = &quot;Terraform created for SCIM with minimum 365 days validity , (created: ${time_rotating.scim_pat_rotate.rfc3339})&quot;<br>}<br><br>// Synchronization job ( Provisioner in Azure AD application)<br>resource &quot;azuread_synchronization_secret&quot; &quot;synchronization&quot; {<br>  service_principal_id = data.azuread_service_principal.scim.id<br><br>  credential {<br>    key   = &quot;BaseAddress&quot;<br>    value = &quot;https://westeurope.azuredatabricks.net/api/2.0/preview/scim&quot;<br>  }<br><br>  credential {<br>    key   = &quot;SecretToken&quot;<br>    value = databricks_token.scim_pat.token_value<br>  }<br><br>  credential {<br>    key   = &quot;SyncAll&quot;<br>    value = &quot;false&quot;<br>  }<br><br>  credential {<br>    key   = &quot;SyncNotificationSettings&quot;<br>    value = jsonencode({<br>      &quot;Enabled&quot; = &quot;true&quot;<br>      &quot;DeleteThresholdEnabled&quot; = false<br>      &quot;Recipients&quot; = &quot;notifyme@targetmail.com&quot; //email to notify<br>    })<br>  }<br><br>}<br><br>// Creat sync job<br>resource &quot;azuread_synchronization_job&quot; &quot;sync_job&quot; {<br>  service_principal_id = data.azuread_service_principal.scim.id<br>  template_id          = &quot;dataBricks&quot;<br>  enabled              = true<br>}<br><br><br>// Create scim group in databricks [ for this approach the user/spa must have account admin role over the databricks account ]<br>resource &quot;databricks_group&quot; &quot;scim_groups&quot; {<br>  provider              = databricks.azure_account //remove provider definition if dbx groups are not needed to inherit from dbx account, so the current workspace provider will be used<br>  for_each              = local.scim_groups<br>  display_name          = each.key<br>  external_id           = azuread_group.scim_groups[each.key].id<br>  workspace_access      = each.value.workspace_access<br>  databricks_sql_access = each.value.databricks_sql_access<br>}</pre><p>The journey to automate the SCIM configuration for Azure Databricks is one filled with technical intricacies. However, the benefits — consistent deployments, minimized manual errors, and valuable time savings, to name a few — are undeniable. The initial investment of resources in developing and testing automation scripts significantly pays off, contributing to a secure and streamlined analytics environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1a1dec21393" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The GitOps Flow to Onboard Users into Terraform Cloud]]></title>
            <link>https://medium.com/@vvimal44/the-gitops-flow-to-onboard-users-into-terraform-cloud-32ae4cce2189?source=rss-cc4499e0793e------2</link>
            <guid isPermaLink="false">https://medium.com/p/32ae4cce2189</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[terraform-cloud]]></category>
            <dc:creator><![CDATA[Vimal Vijayan]]></dc:creator>
            <pubDate>Thu, 18 May 2023 07:53:19 GMT</pubDate>
            <atom:updated>2023-05-18T07:53:19.097Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N82u6eUwI0mQonYWg09TuA.png" /></figure><p>Terraform Cloud is a powerful platform for managing and automating infrastructure deployments. With its state management, collaboration, automation, access controls, and monitoring capabilities, it empowers organizations to implement infrastructure as code practices efficiently. By leveraging Terraform Cloud, teams can collaborate effectively, improve workflow efficiency, and achieve consistent and reliable infrastructure deployments, So it makes sense to use terraform cloud as an all in all solution if you have n number of Terraform projects…</p><p>However, How would you manage the N number of projects and the People and teams who works on these projects.? How would you administer terraform cloud with hundreds of workspaces? Do you really think you can use the click ops here? Grow up! It&#39;s time to do it with GitOps...</p><p>So, what is GitOps? Overall, GitOps simplifies the management and deployment of complex systems by leveraging Git’s version control capabilities, declarative configurations, and automated reconciliation. It offers a robust and efficient approach to achieve continuous deployment and reliable operations.</p><p>Let us get started !!</p><ol><li>Setup your new git repository</li><li>use YAML for setting up the manifest files for the Users, Teams, and Projects and giving access to them...</li></ol><pre>#users.Yaml<br>Users:<br>- john.honai@optimuspro.de<br>- sagar.alias.jacky@optimuspro.de<br>- bilal.k.john@optimuspro.de<br>- pavanai@optimuspro.de<br>- vikram.alias@optimuspro.de</pre><pre>#teams.yaml<br>---<br>Teams:<br>- name: &quot;team1&quot;<br>  members:<br>  - john.honai@optimuspro.de<br>  - bilal.k.john@optimuspro.de<br>  access:<br>    read_workspaces: true<br>    read_projects: true<br><br>- name: &quot;team2&quot;<br>  members:<br>  - sagar.alias.jacky@optimuspro.de<br>  access:<br>    manage_policies: true<br>    read_projects: true<br><br>- name: &quot;team3&quot;<br>  members:<br>  - pavanai@optimuspro.de</pre><pre># projects.yaml<br>---<br>Projects:<br>- name: &quot;Project1&quot;<br>  owner: &quot;john.honai@optimuspro.de&quot;<br>  description: &quot;This is a demo project&quot;<br>  teams:<br>  - name: team1<br>    access: &quot;admin&quot;<br>  - name: team2<br>    access: &quot;read&quot;<br>  - name: team3<br>    access: &quot;write&quot;<br><br>- name: &quot;Project2&quot;<br>  owner: &quot;bilal.k.john@optimuspro.de&quot;<br>  description: &quot;This is a demo project&quot;<br>  teams:<br>    - name: team1<br>      access: &quot;admin&quot;<br><br>- name: &quot;Project3&quot;<br>  owner: &quot;vikram.alias@optimuspro.de&quot;<br>  description: &quot;This is a demo project&quot;</pre><p>Use the below directory structure for your yaml files and terraform code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*0y1ehfT6phMdv-2TgAa77Q.png" /></figure><p>You could use different directory structures such as multiple project files, or a multiple project specific directories and yaml files init.</p><p>As a first iteration, I have used to club all the projects in the same projects.yaml and same for the teams and users.</p><p>make sure the teams names and user names are correctly reffered in each of these files.</p><p>Now let us do it with terraform.</p><pre># provider.tf<br># The backends state are configured to terraform cloud workspace.<br>terraform {<br>  cloud {<br>    organization = &quot;org_name&quot;<br>    workspaces {<br>      name = &quot;terraform-cloud-onboarding&quot;<br>    }<br>  }<br><br>  required_providers {<br>    tfe = {<br>      source  = &quot;hashicorp/tfe&quot;<br>      version = &quot;&gt;= 0.43.0&quot;<br>    }<br>    azuread = {<br>      source  = &quot;hashicorp/azuread&quot;<br>      version = &quot;2.39.0&quot;<br>    }<br>  }<br>}<br><br><br>provider &quot;azuread&quot; {<br>  # Configuration options<br>}<br>provider &quot;tfe&quot; {<br>  # Check the provider configuration <br>  # use tfc variables are environment variable in terraform cloud workspace<br>  # Or directly use the terraform cloud token<br>}</pre><pre># main.tf<br># Organization details<br><br>data &quot;tfe_organization&quot; &quot;this&quot; {<br>  name = local.organization<br>}<br><br># add user to the organization<br>resource &quot;tfe_organization_membership&quot; &quot;members&quot; {<br>  for_each     = local.users<br>  organization = data.tfe_organization.this.name<br>  email        = each.value<br>}<br><br># add users to the sso ad group &quot;co-spa-terraform-cloud-access&quot;<br>data &quot;azuread_group&quot; &quot;sso_group&quot; {<br>  display_name     = local.sso_ad_group<br>  security_enabled = true<br>}<br><br># Get user details ( only users in your Tenant)<br>data &quot;azuread_user&quot; &quot;user&quot; {<br>  for_each            = local.users<br>  user_principal_name = each.value<br>}<br><br># Add user to the sso ad group<br>resource &quot;azuread_group_member&quot; &quot;sso_group_member&quot; {<br>  for_each         = local.users<br>  group_object_id  = data.azuread_group.sso_group.object_id<br>  member_object_id = data.azuread_user.user[each.key].object_id<br>}<br><br># Create teams<br>resource &quot;tfe_team&quot; &quot;teams&quot; {<br>  for_each     = local.team_map<br>  name         = each.key<br>  organization = data.tfe_organization.this.name<br><br>  dynamic &quot;organization_access&quot; {<br>    for_each = can(each.value.access) == true ? [1] : []<br>    content {<br>      manage_policies         = lookup(each.value.access, &quot;manage_policies&quot;, false)<br>      read_projects           = lookup(each.value.access, &quot;read_projects&quot;, false)<br>      read_workspaces         = lookup(each.value.access, &quot;read_workspaces&quot;, false)<br>      manage_modules          = lookup(each.value.access, &quot;manage_modules&quot;, false)<br>      manage_policy_overrides = lookup(each.value.access, &quot;manage_policy_overrides&quot;, false)<br>      manage_projects         = lookup(each.value.access, &quot;manage_projects&quot;, false)<br>      manage_providers        = lookup(each.value.access, &quot;manage_providers&quot;, false)<br>      manage_run_tasks        = lookup(each.value.access, &quot;manage_run_tasks&quot;, false)<br>      manage_vcs_settings     = lookup(each.value.access, &quot;manage_vcs_settings&quot;, false)<br>      manage_workspaces       = lookup(each.value.access, &quot;manage_workspaces&quot;, false)<br>    }<br>  }<br>}<br><br># Add users to the team<br>resource &quot;tfe_team_organization_member&quot; &quot;team_membership&quot; {<br>  for_each                   = {for k, v in local.users_to_team_map : k =&gt; v}<br>  team_id                    = tfe_team.teams[each.value.team].id<br>  organization_membership_id = tfe_organization_membership.members[each.value.name].id<br>}<br><br># Create Project<br>resource &quot;tfe_project&quot; &quot;project&quot; {<br>  for_each     = local.projects_map<br>  organization = data.tfe_organization.this.name<br>  name         = each.value.name<br>}<br><br># Add team &amp; access at project level.<br>resource &quot;tfe_team_project_access&quot; &quot;team_project_access&quot; {<br>  for_each   = {for k, v in local.team_project_access_map : k =&gt; v}<br>  access     = each.value.access<br>  team_id    = tfe_team.teams[each.value.team].id<br>  project_id = tfe_project.project[each.value.project].id<br>}</pre><pre># locals.tf<br>locals {<br>  organization        = &quot;org_name&quot; #&lt;Terraform Cloud Organization Name&gt;<br>  sso_ad_group        = &quot;sso-ad-group&quot; #&lt; Azure AD Security Group for SSO &gt;<br>  project_yaml_decode = yamldecode(file(&quot;../projects.yaml&quot;))<br>  projects            = local.project_yaml_decode<br>  users               = {for k, v in yamldecode(file(&quot;../users.yaml&quot;)).Users : trimsuffix(v, &quot;@optimuspro.de&quot;) =&gt; v}<br>  teams               = yamldecode(file(&quot;../teams.yaml&quot;)).Teams<br>  team_map            = {for k, v in local.teams : v.name =&gt; v}<br>  projects_map        = {for k, v in yamldecode(file(&quot;../projects.yaml&quot;)).Projects : v.name =&gt; v}<br><br>  team_project_access_map = flatten([<br>  for k, v in local.projects_map : [<br>  for a, b in v.teams : {<br>    team    = b.name,<br>    access  = b.access,<br>    project = v.name<br>  }<br>  ] if can(v.teams)<br>  ])<br><br>  users_to_team_map = flatten([<br>  for k, v in local.teams : [<br>  for a, b in v.members : {<br>    name = trimsuffix(b, &quot;@optimuspro.de&quot;), team = v.name<br>  }<br>  ]<br>  ])<br>}</pre><p><strong>Now let us configure the workspace and add VCS Integration to the git repo.</strong></p><ol><li>Create Project/workspace</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5IbCmUDnlzbCEkIHnM259g.png" /></figure><p>2. Choose Version Control workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IjLhIH5kwJo5qK1v-iFwBQ.png" /></figure><p>3. Select your vcs provider and choose the repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*737INVnSdaCBgpwrddGdFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cXnCZ9B278FqkyZhc6WhUg.png" /></figure><p>4. Configure Settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4TB5a-8cHZyq8URIbfwwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*ZrVe6jSQGgqgYrocJJnOpQ.png" /></figure><p>On a succefull configuration, a new plan will be triggered. Tune the VCS configuration on your own requirement.</p><h3>Start working on feature branches and update the YAML files and create pull requests now. A succesfull merge to the main branch should trigger the terraform workspace and onboard users/projects/teams.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32ae4cce2189" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Semantic Versioning with Azure DevOps : An automated solution with standard version]]></title>
            <link>https://medium.com/@vvimal44/semantic-versioning-with-azure-devops-an-automated-solution-with-standard-version-59df77dafde9?source=rss-cc4499e0793e------2</link>
            <guid isPermaLink="false">https://medium.com/p/59df77dafde9</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[releases]]></category>
            <category><![CDATA[semantic-version]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[semantic-versioning]]></category>
            <dc:creator><![CDATA[Vimal Vijayan]]></dc:creator>
            <pubDate>Fri, 18 Nov 2022 20:47:15 GMT</pubDate>
            <atom:updated>2022-11-23T13:03:49.963Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Semantic Versioning with Azure DevOps : An automated solution with standard version</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oG57NB2cpt3vppkj21BiBg@2x.png" /></figure><p>We all always need our code to be versioned irrespective of what type of code it is. even if it is a Bash Script, PowerShell Script and more often a terraform code.</p><p>Most of you must have creating a lot of terraform modules and would like to version them automatically.</p><p>Yes, you could use the conventional git commits and tools like standard version, <a href="https://github.com/googleapis/release-please">release-please</a>, to release new versions and actively use them.</p><p>However my workflow has Azure Repo as my repository and we have branch policies set in between the main branch (At least we have it for fancy 😬). My standard version setup and conventional git commit works charmingly on my feature branches and main branches when there is nothing to block my commits. A pull request to the main branch is a show stopper here 😟. And you cannot really tag the main branch with a release as the branch policies block you directly committing to the main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*HG_6KBV2UUZ7LWnR2ceApw.gif" /><figcaption>No Buddy. You’re at the wrong place!!!</figcaption></figure><p>You could find more ways when you have your code in GitHub, and use release-please instead of standard-version and directly add it with Github actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*IcDo3AJZ-Up6rkSBe9JLHQ.gif" /><figcaption><strong>So, What do we Azure Repo people do ??</strong></figcaption></figure><p><strong>Enough with the long boring story ! Let’s do this with Azure DevOps !!!!</strong></p><h4>Start with a new repository in azure repos ( Yes! you could use your existing repo as well )</h4><p>Let us do some basic local settings before you clone your repository locally!</p><ul><li><strong>Install standard-version globally in your device.</strong></li></ul><pre>npm i -g standard-version</pre><ul><li>Now You could create a new branch out of the main branch and start working on your stuff</li><li>create the file<strong> <em>package.json</em> </strong>and add the below <em>npm run </em>script in to the package.json</li></ul><blockquote>Keep the version to 0.0.0 , as I have seen standard version complaining for an initial version</blockquote><pre>$ git checkout -b feature/feature1<br><br>$ vi package.json</pre><pre>{   <br>  &quot;scripts&quot;: {     <br>    &quot;release&quot;: &quot;standard-version&quot;   <br>  },  <br>  &quot;version&quot;: &quot;0.0.0&quot; <br>}</pre><blockquote><a href="https://github.com/conventional-changelog/standard-version">github.com/</a> visit to know more about standard version</blockquote><ul><li>keep the below pipeline as part of your code repo. You could use the pipeline task as part of your existing build/release pipeline.</li></ul><blockquote>If you are managing multiple repositories and would like to version them all, I would definitely recommend to keep a separate pipeline just for the release versioning part with multiple repo checkout in it</blockquote><pre>trigger:<br>- main<br><br>pool:<br>  vmImage: windows-latest<br><br>jobs:<br>- job: releasePlease<br>  displayName: Release Please 🚀<br>  steps:<br>  - checkout: self<br>    persistCredentials: true<br>    clean: true<br>  <br>  - task: NodeTool@0<br>    inputs:<br>      versionSource: &#39;spec&#39;<br>      versionSpec: &#39;18.x&#39;<br>      checkLatest: true<br>    displayName: Install Node<br>      <br>  - pwsh: |  <br>    npm install -g npm@9.1.1<br>    git config --global user.email &quot;&lt;add user email&gt;&quot;<br>    git config --global user.name &quot;&lt;add user uname&gt;&quot;<br>    $commitMessage = &quot;$(Build.SourceVersionMessage)&quot;<br>    git fetch --all<br>    git switch $(basename $(Build.SourceBranch))<br>    npm i -g standard-version<br><br>    function releasenow {<br>      try {<br>        git push --follow-tags origin main<br>      } catch {<br>        Write-Host &quot;An error occurred:&quot;<br>      }<br>    }<br><br>    if ( $commitMessage -match &quot;BREAKING CHANGE&quot; -or $commitMessage -match &quot;chore!&quot; -or $commitMessage -match &quot;feat!&quot; ){<br>      write-host &quot;Bump major version&quot;<br>      $version = (Get-Content ./package.json | ConvertFrom-Json).version<br>      $currentMajorVersion = $version.Split(&quot;.&quot;)[0]<br>      Write-Host &quot;Current Version : $currentMajorVersion&quot;<br>      $bumpMajorVersion = [int]$currentMajorVersion + 1<br>      Write-host &quot;Bumped Version = $bumpMajorVersion.0.0&quot;<br>      # run npm release to set new version<br>      standard-version --release-as &quot;${bumpMajorVersion}.0.0&quot; --releaseCommitMessageFormat &quot;$commitMessage [skip ci]&quot;<br>      releasenow<br>    } elseif ($commitMessage -match &quot;feat&quot; -or $commitMessage -match &quot;chore&quot; -or $commitMessage -match &quot;fix&quot;) {<br>      standard-version --releaseCommitMessageFormat &quot;$commitMessage [skip ci]&quot;<br>      releasenow<br>    } else {<br>      Write-Host &quot;If you intend to do symantic release, Please follow conventional commits.&quot;<br>      Write-Host &quot;You&#39;re commit is considered as a fix version&quot;<br>      standard-version --release-as &quot;patch&quot; --releaseCommitMessageFormat &quot;$commitMessage [skip ci]&quot;<br>      releasenow<br>    }<br>  displayName: Release<br>  continueOnError: true</pre><blockquote>As you note, the pipeline is using the default windows-agent(It was my personal choice 😊), You can use ubuntu also as the default pool agent.</blockquote><blockquote>Azure devOps uses the azure devOps identities to checkout the code in the pipeline workspace, and a persist credentials flag allows you to contribute to the repo by reusing the credentials by its own.</blockquote><blockquote>We have to make some changes in the repository security settings for the git push to work without any issues. So, Keep reading!</blockquote><h3><strong>Let us follow some discipline now onwards with the commits.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*C7VlF3Hv6gcoKBoLoC_2JQ.gif" /></figure><pre><br><br>$ echo &quot;Here comes the first feature&quot; &gt;&gt; README.md  <br><br>$ git add .  <br><br>$ git commit -m &quot;feat: The feature 1&quot;  <br><br>$ git push --set-upstream origin feature/feature1<br><br>No worries! if you are person who like to do your git stuff along with you&#39;r<br>IDE Just like me !.. Just do it from your favourite IDE.<br></pre><blockquote>I am adding the conventional commits here for your best learning 😇 . You could use tools like <a href="https://github.com/conventional-changelog/commitlint">commitlint</a> to help you with commit conventions</blockquote><blockquote><a href="https://www.conventionalcommits.org/en/v1.0.0/#specification"><strong>Conventional Commits</strong></a></blockquote><p>Ok, Let’s park it here for some time</p><h4>Its time to do some Azure DevOps Administration (You need admin privileges in your project to follow the steps )</h4><blockquote>I am not including the steps to set up the branch policies, as it does not fall under this scope. I hope you have the branch policies set in place. No problem if you don’t have branch policies exist in your project ☺️</blockquote><ul><li><strong>Navigate to the project settings in the left bottom, and select repository settings</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*JGMPVu_PosZ8d0P9PVo4Rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*30ojL2zj-jDw7uR56ClLfA.png" /></figure><ul><li>Select repository of your choice to update the security changes <em>(You could add securities and policies at the project level)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*mvFLVQ2b2gaC8-Qm7XaR-A.png" /></figure><ul><li>Make sure “<strong>Project Collection Service Accounts</strong>” has the permission allowed for <strong>Contribute, Create Branch, Create Tag, Read</strong> set</li></ul><blockquote>The below permission allows the above pipeline code to execute the git commands</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OEX9rYvuMzzFxYbTM00oFQ.png" /></figure><ul><li>Now, if you have branch policies set with the project or to the repository, You will not be allowed to push directly to the main branch. You will experience the same in the pipeline as well if you have not bypass the push</li><li>Set the “<strong>[Project Name] Build Service</strong>” to allow the <strong>bypass policies when pushing , Contribute, Create Tag </strong>permissions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tn1rY0lsTRLRTeoPTYDeOg.png" /></figure><blockquote>The above settings will be inherited to all the branches in the repository. To limit the permissions only to the main branch. select the main branch from the <strong>git refs permissions</strong> from the bottom and apply the same set of permissions</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*0oU-xlra-3dpGMi-wsHwLw.png" /></figure><p>Ok, Now let’s go back to where we pushed our feature branch….</p><h3>Create a pull request to the main branch</h3><ul><li>Make sure the title bar in the pull request form has the conventional commit header (f<em>eat,fix,chore…</em>) in it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DX84Hl6njuTJJ-jDmV6lVg.png" /></figure><blockquote>Azure DevOps always consider the PR title as the commit message, when you do a pull request. if you have not explicitly added a conventional commit header incase the title already doesn’t have it, the pipeline always consider your PR as fix release (Change the logic in the PowerShell script if you wish to 😄).</blockquote><ul><li>Now approve and complete your pull request</li><li>let the build pipeline start running on completion of your PR.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HehtCwYm81qxaFX6Ro46eg.png" /></figure><ul><li>Check the logs of the PowerShell task in the pipeline to see more details,<br>With the example below, I have a new minor version now and it leaves a new tag in the repo</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPE2MeE7rpMZ01QUFytleg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJSTfg1oexUU5HuyyI_oNw.png" /></figure><blockquote>the standard version leaves an extra commit with a release tag on your main branch. I could not say it is a disadvantage (But that is how standard version works)</blockquote><p>Now.. Start releasing your code with azure devOps 😇 😎</p><p>I am adding a <strong>bonus</strong> pipeline for those who wish to have a dedicated pipeline to release multiple repositories in the project</p><pre>trigger:<br>- main<br><br>pool:<br>  vmImage: windows-latest<br><br><br>resources:<br> repositories:<br>  - repository: &quot;terraform-azure-vnet&quot;<br>    type: &quot;git&quot;<br>    name: &quot;vimal Templates/terraform-azure-vnet&quot;<br>    trigger:<br>      - main<br>  - repository: &quot;terraform-azure-subnet&quot;<br>    type: &quot;git&quot;<br>    name: &quot;vimal Templates/terraform-azure-subnet&quot;<br>    trigger:<br>      - main<br># add more repositories like the above ones, Donot forget to add the checkout steps<br><br>jobs:<br>- job: releasePlease<br>  displayName: Release Please 🚀<br>  steps:<br>  - checkout: self<br>    persistCredentials: true<br>    clean: true<br>  - checkout: terraform-azure-vnet<br>    condition: and(succeeded(), eq(variables[&#39;Build.Repository.Name&#39;], &#39;terraform-azure-vnet&#39;))<br>    persistCredentials: true<br>    clean: true<br>  - checkout: terraform-azure-subnet<br>    condition: and(succeeded(), eq(variables[&#39;Build.Repository.Name&#39;], &#39;terraform-azure-subnet&#39;))<br>    persistCredentials: true<br>    clean: true<br># add checkout step for your repository<br><br>  - task: NodeTool@0<br>    inputs:<br>      versionSource: &#39;spec&#39;<br>      versionSpec: &#39;18.x&#39;<br>      checkLatest: true<br>    displayName: Install Node<br>      <br>  - template: steps/release-please.yaml --&gt; the powershell code goes here :)</pre><h3>Enjoy DevOps!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59df77dafde9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>