<?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 Ankur Singla on Medium]]></title>
        <description><![CDATA[Stories by Ankur Singla on Medium]]></description>
        <link>https://medium.com/@asingla77?source=rss-9bf83e2b9758------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*HhYj55f6A1cv4vWDLPQMgQ.png</url>
            <title>Stories by Ankur Singla on Medium</title>
            <link>https://medium.com/@asingla77?source=rss-9bf83e2b9758------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:17:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@asingla77/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[Overcoming limitations of Service Mesh for the security of distributed app clusters]]></title>
            <link>https://medium.com/volterra-io/overcoming-limitations-of-service-mesh-for-the-security-of-distributed-app-clusters-b0db81a35718?source=rss-9bf83e2b9758------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0db81a35718</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ankur Singla]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 15:28:59 GMT</pubDate>
            <atom:updated>2020-04-13T15:28:59.116Z</atom:updated>
            <content:encoded><![CDATA[<p>Co-Author: <a href="https://www.linkedin.com/in/mittaldevesh/">Devesh Mittal</a></p><p>This is the fourth blog in a series of blogs that cover various aspects of what it took for us to build and operate our <a href="https://www.volterra.io/">SaaS</a> service:</p><ol><li><a href="https://medium.com/@asingla77/e20a82acd6d3">Control plane for distributed Kubernetes PaaS</a></li><li><a href="https://medium.com/p/a487ffe50abc">Global service mesh for distributed apps</a></li><li><a href="https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff">Platform security for distributed infrastructure, apps, and data</a></li><li><strong>App and network security of distributed clusters</strong></li><li>Observability across a globally distributed platform</li><li>Operations &amp; SRE of a globally distributed platform</li><li>Golang service framework for distributed microservices</li></ol><p>In the <a href="https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff">previous blog</a>, we provided insights on the challenge of using cryptographic techniques to secure our platform (infrastructure, apps, and data). This blog will deal with techniques we use to secure the platform against targeted attacks from the network — from the Internet as well as from inside. Since apps are no longer constrained to any physical location, traditional perimeter-based firewalls and signature-based security solutions are no longer effective. We will outline the shortcomings of our initial zero-trust security implementation and why + how we augmented it with machine learning and algorithmic techniques to properly secure our distributed infrastructure + app clusters.</p><h3>TL;DR (Summary)</h3><ol><li>Our app-to-app and user-to-app security requirements were complicated by the fact that our platform is running hundreds of microservices (across many Kubernetes clusters) along with a few monolithic apps across multiple cloud providers (AWS and Azure), our global network, and edge locations.</li><li>We were also asked to build processes and deliver a robust network + app security solution that gave selective access to shared infrastructure to our developers, our operations teams, our customers’ developers, their operations teams, and their end-users. This was necessary to meet compliance requirements like PCI-DSS, SOC, etc.</li><li>While we had already built a zero-trust solution based on our global service mesh and API gateway, it did not solve many security problems like system vulnerability, resource exhaustion, internet attacks from bots/malware, and the needs of a few services that provided unauthenticated access. Also, sometimes it was difficult for our secops team to get API information from the developers — essential for a good zero-trust deployment that relies on access whitelists.</li><li>Delivering to these needs would have required our platform team to either procure services from vendors/cloud providers or augment our L3-L7+ datapath (detailed <a href="https://medium.com/volterra-io/global-service-mesh-for-distributed-applications-a487ffe50abc">here</a>) with additional security features — network firewall, app firewall, DDoS protection, privileged access management, etc. Given the fact no existing vendor/cloud provider could solve these problems with tooling that provided unified policy, observability, and automated API discovery capabilities, we had to make the difficult decision to embark on an internal project to augment our datapath and control plane.</li><li>As part of building the network + app security capabilities into the datapath, we ended up adding many new features — something that has not yet been achieved in any network datapath to date. We fused algorithmic security capabilities with machine learning on network + app traffic alongside a programmable policy engine that works across the stack — network, HTTP and APIs. As a result, we are now able to deliver different security capabilities depending on the deployment environment, traffic model and latency needs. This has made our global service mesh more secure, reduced the number of false positives for our SOC team, and given a significant reduction in latency + compute resources.</li></ol><h3>Limitations of Service Mesh &amp; Zero-Trust Architecture</h3><p>Our platform runs a large number of apps across multiple teams that operate their own clusters in edge, our global network, and AWS and Azure public clouds. While the majority of workloads are microservices-orchestrated using Kubernetes, we have a handful of very large-scale monoliths (eg. elasticsearch) that we manage using terraform. Figure 1<strong> </strong>demonstrates the distributed nature of our platform. For example, in each of our 18+ global network PoPs (with a few tens to slightly more than a hundred physical servers), we run thousands of app pods. However, on the edge, we have individual customer deployments today with 3000+ active locations (each with one to seven computes) running a few tens of app pods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uQK5WUN76W2LqCug" /><figcaption>Figure 1: Distributed Apps and Data across Volterra Platform</figcaption></figure><p>The platform is fully multi-tenant with each node running workloads from different customers (and our own). Since some of these apps are exposed to the public Internet, we need to ensure that all communication to/from the apps is secured. As we had outlined in the previous two blogs, we built a robust identity, authentication + authorization system along with our own L3-L7+ network datapath (VoltMesh) that is used to power <strong>our service mesh</strong> and <strong>API gateway</strong>. As shown in Figure 2, this has allowed us to deliver transport-level security across app clusters (mTLS), from users (TLS/mTLS), and employees (mTLS) as well as access control based on authentication+authorization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/0*m5tnxjbjF0qgwLyt" /><figcaption>Figure 2: Transport Security with Service Mesh and API Gateway</figcaption></figure><p>While this zero-trust implementation provides a lot of benefits, it did not automatically solve several security problems:</p><ol><li><strong>System Vulnerability</strong> — An app may get compromised because of system vulnerability or an authorized but malicious employee — there needs to be a mechanism to detect such situations, automatically take remedial actions, and alert our SRE teams.</li><li><strong>Resource Exhaustion</strong> — There are many situations where even legitimate and authorized client access can slowly exhaust app resources because of poor design. These situations can significantly degrade performance for other users.</li><li><strong>Internet Attacks — </strong>Since a lot of our (and our customer) infrastructure and apps are directly exposed to the public Internet, these resources get continuous attacks from bad users, bots, and malware. We need to detect and protect these resources against denial of service, volumetric, and intrusion attacks in order to provide good response time to other users.</li><li><strong>Unauthenticated Services</strong> — While the majority of the apps require authentication (also needed for zero-trust), there are cases where an app cannot be restricted. As a result, these apps require additional protection using network-based solutions.</li></ol><p>Over the last 2.5 years of development on this platform, we also realized that often our developers will incorporate open source apps, containerize them and ask our DevOps team to deploy them on the platform. However, they often lack details on API-level interactions within these apps that are needed by our security team to create policies to whitelist the communication. This is a big roadblock for our zero-trust security implementation as it mandates whitelist policies that only allow APIs used by the apps and block all other traffic. Whenever we made exceptions to this requirement, it left some apps with very basic network-level segmentation, thereby increasing the attack surface.</p><h3>Augmenting our Zero-trust Service Mesh</h3><p>As a result, we needed to augment our existing zero-trust security solution with additional security capabilities to handle the issues listed above. We identified a list of additional security capabilities that we had to build into the platform:</p><ol><li><strong>API Discovery &amp; Control</strong> — Build the ability to learn APIs in running apps and automate the generation of app/API whitelist policies without reliance on developers</li><li><strong>Anomaly Detection</strong> — Ability to detect and protect against anomalous behavior for traffic from any source type ( trusted or untrusted user/app)</li><li><strong>Behavior Profiling</strong> — Protect apps against resource exhaustion, app/API attacks (Internet or from internal network), and protect against volumetric attacks from the Internet to the infrastructure and/or apps</li><li><strong>Logging and Visualization — </strong>Ability to log and trace all access for future forensics and/or compliance needs</li></ol><p>We decided to use a combination of traditional signature-based techniques, statistical algorithms, and more dynamic machine learning approaches to solve these problems. This required us to make changes to our SaaS backend as well as add new capabilities in our network datapath.</p><h3>Deep Learning for API Discovery &amp; Control</h3><p>In order to lock-down the platform, we only allow network connections based on the whitelist of APIs for every app. This requires our security team to coordinate with developers and ensure that our programmable policy engine is fed with the right API information. We quickly realized that it was impossible for our developers to provide this information for apps that were not built using our service framework.</p><p>Since our service mesh proxy is in the network path of every access to the app, we decided to learn APIs and static resources that are exposed by the app by doing run-time analysis of every access that goes through the proxy. The challenge with this approach is to identify API endpoints by inspecting URLs and separating out components that are dynamically generated. For example, for an API “api/user/&lt;user_id&gt;/vehicle/&lt;vin&gt;”, the proxy will see accesses like:</p><pre>/api/user/ec3cff89-e804–4c88-a515-a6c412355a71/vehicle/3D7KU28C04G254161</pre><pre>/api/user/f075fe11-af27–4883–913f-0d4f45f6ebd9/vehicle/4S3BK4355T6319316</pre><pre>...</pre><p>There can be millions of such requests, making it very challenging to decipher. As a result, the identification of dynamic components in these related requests is done using deep learning and graph analysis. We represent the entire URL component set as a graph and then perform graph clustering to find sub-graphs with similar properties using feature sets that capture specific properties of dynamically generated components such as:</p><ul><li>Structural properties</li><li>Entropy of nodes</li><li>Jaccard similarity between various parts of the graph</li><li>Simple string classification using well understood deep learning methods</li></ul><p>As a result, the dynamic components get classified and output from the system looks like:</p><pre>/api/user/DYN/vehicle/DYN</pre><p>Using this machine learning of APIs, we can easily and automatically generate a policy that can be enforced by our service mesh proxy. Based on the API endpoints discovered, we also learn other properties like what apps use what APIs to talk with other apps, the typical behavior of these APIs, etc. This allows us to build a service graph that helps our security team to visualize service-to-service interaction for forensics, discovery and API-level micro-segmentation.</p><h3>Identifying Shortcomings in Firewalls</h3><p>Before we embarked on adding the remaining two capabilities (anomaly detection and behavior profiling), we decided to see if existing solutions could help us. While there are many perimeter firewalls and web app firewall products in the market, the majority of these solutions are geared towards protecting Internet-facing apps. They make certain assumptions that the traffic being serviced is web traffic and provide targeted protection for HTML, javascript, sql, CMS, etc — making it relatively easier to write signatures and rules to catch vulnerabilities and known exploits.</p><p>While this capability is important for our web traffic, we need to also serve a growing amount of API and machine-to-machine traffic in our environment. To solve this, our security team would have to write app-specific rules that don’t fall under known typical web rules (like OWASP CRS). Usually security administrators know little about the apps and with the dynamic nature of the environment, it becomes even harder to keep track of the app types and structure to write those app-specific rules. As a result, while our platform team provides this capability in our network datapath, it is not often used by our security team.</p><p>Another problem for which we have a significant amount of data from our network is that app attacks are becoming a lot more sophisticated over time. The attacker spends days performing reconnaissance to determine the nuts and bolts of the APIs, the app, underlying infrastructure, and OS type by looking at HTTP/TCP signatures, etc. Traditional signature and rules-based approaches are of very limited use in these situations and we decided to continue with our AI-based approach to automatically learn user behavior and enforce good vs bad behavior.</p><h3>Machine Learning for Behavior Profiling</h3><p>Most apps have certain workflows (sequence of APIs) and context (data within the APIs) to which different use cases/deployments are designed and typically followed by the users of the apps. We exploit these properties and train our machine learning algorithms to model “valid” behavioral patterns in a typical user interaction with the app.</p><p>Our datapath samples requests/responses for each API along with associated data and sends it to our central learning engine as shown in Figure 3. This engine continuously generates and updates the model of valid behavioral patterns that is then used by the inference engine running in the datapath to alert/block suspicious behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*inv3k3z4WtgUXzUU" /><figcaption>Figure 3: Interaction between Learning Core and Distributed Inference Engines</figcaption></figure><p>The learning engine looks at many metrics like the sequence of APIs, gaps between requests, repeated requests to the same APIs, authentication failures, etc. These metrics are analyzed for each user and on an aggregate basis to classify good vs bad behavior. We also perform behavior clustering to identify multiple different sequences of “good behavior.” Let’s take an example to illustrate this:</p><ul><li>The model does an analysis across many users to define a sequence of good behavior. Each color represent individual different API calls:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_TLH9ejhJ3XI1h72" /><figcaption>Figure 4: Normal sequence of APIs</figcaption></figure><ul><li>The following sequence of APIs will get flagged by the system as suspicious/bad behavior that will be automatically mitigated by the system or generate an alert for an admin to intervene</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*2_p70QAnlmR4C2U1" /><figcaption>Figure 5: Suspicious sequence of APIs</figcaption></figure><p>As we put this system into production over a year back, we have continuously refined the model based on usage and customer feedback. We have been able to successfully identify the following types of attacks:</p><ul><li>Crawlers/scanners doing reconnaissance of an app to find vulnerabilities and also to create a map of all APIs exposed by the app</li><li>Sustained malicious activity by launching multiple attack vectors to vulnerable APIs</li><li>HTTP-level denial of service attack that leads to resource exhaustion (eg. multiple attempts to login APIs)</li><li>Data leakage by bots that are designed to scrape for information (eg. pricing information from an e-commerce site by competitors)</li><li>Brute force attacks — dictionary attacks for login/passwords</li><li>Identification of good bots (e.g. Google, Bing crawler)</li></ul><p>That said, we also realized that there are some problems with this approach — it cannot uncover low and slow attacks (brute force, app denial of service, scanner) for which we need to apply anomaly detection techniques.</p><h3>Algorithmic + AI-based Anomaly Detection</h3><p>Sometimes, we see highly sophisticated attacks that use large distributed botnets that pass under the radar of our behavior analysis technique. Examples of such attacks are:</p><ul><li>Distributed brute force attack</li><li>Distributed dictionary-based account takeover attacks</li><li>Distributed scanner to find vulnerabilities and exploit them from multiple clients</li><li>HTTP DoS attack from a highly distributed botnet</li><li>Botnet targeting a small subset of compute-heavy APIs</li><li>Botnet targeting a large set of data-heavy APIs to exhaust resources</li></ul><p>Since our network datapath is collecting information from each node across our global network, it becomes relatively easy to perform analysis on a particular app’s aggregate metrics like request rate, error rate, response throughput, etc. This analysis allows us to detect distributed attacks and mitigate them (at every node) by identifying the users that could be part of such botnets. Let’s take an example where we are trying to detect anomalies across different time windows (last 5 mins, 30 mins, 4 hours, 24 hours) by looking at request rates and if the request rate is high within a given time window, then the following deeper analysis of access logs will be performed by the system:</p><ul><li>Analyze if source IP address spread is higher or lower than typical. If requests came from a large number of unique source IPs, then it indicates a highly distributed attack that will trigger a more aggressive version of user behavior analysis on each source IP.</li><li>Run a more aggressive version of user behavior analysis on each of the source IP addresses to assign suspicion scores and take the configured mitigation actions.</li><li>If most requests went to a smaller number of API endpoints (than usual), it indicates a brute force attack or DoS attack. If the APIEP spread was larger than usual, it indicates a distributed crawler, scanner or DoS attack</li></ul><p>While anomaly detection has always been an important technique for intrusion detection and prevention (IDS/IPS) in firewall appliances, these appliances are unable to mitigate global app-layer attacks. With our ability to perform API markup and learning across our global platform, we are now able to suppress attacks at the source across our distributed network.</p><h3>Gains from Machine Learning for App + Network Security</h3><p>While we were extremely satisfied with our zero-trust implementation based on service mesh and API gateway, we realized that it was not comprehensive to secure distributed app clusters from vulnerabilities and malicious attacks. We had to augment it with machine learning for behavior analysis + anomaly detection alongside traditional signature + rule-based techniques to provide a better security solution.</p><p>We have seen three significant gains from the addition of distributed inferences in our L3-L7+ network datapath along with learning core running in our centralized SaaS:</p><ol><li><strong>End-to-end zero-trust network</strong> — we now have the ability to enforce API-level micro-segmentation across the entire platform (100% without any gaps) — the entire network is a globally distributed proxy with API-level access and zero network-level access.</li><li><strong>Reduction in false positives (by &gt;82%)</strong> through ability to continuously tune our models, we have significantly reduced the number of false positives that our NOC and SOC teams have to deal with. This was a big concern with traditional tools given the number of alarms they raised, making them entirely useless.</li><li><strong>Significant reduction in latency and compute utilization</strong> by slowly migrating more tasks that were performed by traditional rules and signature-based algorithms to our new machine learning core.</li></ol><p>Network and app security is a never-ending runway and it looks like we still have a long backlog of new features to add. We will come back in the near future to share additional insights into the incremental algorithms and techniques we have implemented.</p><h3>To be continued…</h3><p>This series of blogs will cover various aspects of what it took for us to build and operate our globally distributed SaaS service with many app clusters in public clouds, our private network PoPs, and edge sites. Next up will be “Observability across our Globally Distributed Platform” (coming soon)…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0db81a35718" width="1" height="1" alt=""><hr><p><a href="https://medium.com/volterra-io/overcoming-limitations-of-service-mesh-for-the-security-of-distributed-app-clusters-b0db81a35718">Overcoming limitations of Service Mesh for the security of distributed app clusters</a> was originally published in <a href="https://medium.com/volterra-io">volterra.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing a Distributed Platform — Identity, Secrets, and Key Management]]></title>
            <link>https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff?source=rss-9bf83e2b9758------2</link>
            <guid isPermaLink="false">https://medium.com/p/3772484815ff</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[key-management-service]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[secrets]]></category>
            <dc:creator><![CDATA[Ankur Singla]]></dc:creator>
            <pubDate>Wed, 11 Dec 2019 08:14:57 GMT</pubDate>
            <atom:updated>2020-04-18T20:57:47.871Z</atom:updated>
            <content:encoded><![CDATA[<h3>Securing a Distributed Platform — Identity, Secrets, and Key Management</h3><p><strong>Co-Author</strong>: <a href="https://www.linkedin.com/in/manishmehta/">Manish Mehta</a></p><p>This is the third blog in a series of blogs that cover various aspects of what it took for us to build and operate our <a href="https://www.volterra.io/">SaaS</a> service:</p><ol><li><a href="https://medium.com/@asingla77/e20a82acd6d3">Control plane for distributed Kubernetes PaaS</a></li><li><a href="https://medium.com/p/a487ffe50abc">Global service mesh for distributed applications</a></li><li><strong>Platform security for distributed infrastructure, apps, and data</strong></li><li><a href="https://medium.com/volterra-io/overcoming-limitations-of-service-mesh-for-the-security-of-distributed-app-clusters-b0db81a35718">Application and network security of distributed clusters</a></li><li>Observability across a globally distributed platform</li><li>Operations &amp; SRE of a globally distributed platform</li><li>Golang service framework for distributed microservices</li></ol><p>My initial <a href="https://www.volterra.io/resources/applications-driving-the-need-for-distributed-cloud-services">blog</a> provided some background on the needs that led us to build a new platform for distributed clouds. Using this platform, our customers build a complex and diverse set of applications — like smart manufacturing, video forensics for public safety, algorithmic trading, and telco 5G networks.</p><p>Since many of these applications are mission-critical, our customers expect that we not only deliver multi-layer security but also have the ability to make continuous improvements to keep their distributed clusters secure. This specific blog will tackle the challenges of securing infrastructure, applications, and data across multiple clusters.</p><h3>TL;DR (Summary)</h3><ol><li>While it is relatively well understood how to provide secure access for users and employees to applications (we do this every day when we access our bank accounts or our corporate emails), it is not as straightforward to do the same for app-to-app or app-to-data access as there is no human involved in the verification process.</li><li>Securing apps and data in a heterogeneous environment (edge, multiple clouds, and network PoPs) required us to solve a multi-layer problem — <strong><em>identity, authentication &amp; authorization, secrets, and key management</em></strong></li><li>Even though there are many point solutions available (eg. multiple services from individual cloud providers, Hashicorp Vault, SPIFFE/Spire etc) to these four problems — there does not exist an integrated solution that works across cloud providers or seamlessly combines each of these services for ease of use.</li><li>Given a lack of expertise within our developer and DevOps teams on how to bring these pieces together, it became essential for our platform team to deliver these capabilities as an integrated solution that was easy to use. The evolving security landscape and new technologies make it even harder for these teams as they don’t have the necessary expertise or the bandwidth to keep up with all the changes.</li><li>As part of delivering multi-layer platform security, we built new software components that solved three critical problems in an entirely new way — securely bootstrapping a universal identity that does not suffer from the problem of “<a href="https://en.wikipedia.org/wiki/Turtles_all_the_way_down">turtles all the way down</a>”, secrets that can be stored and disbursed without ever worrying about compromise of a central vault (goldmine problem), and distributed key management to ease security of data-at-rest.</li></ol><h3>Background on the Security Problem</h3><p>As stated in the above — the problem of securing user access to applications (for example, access to our bank accounts or our emails) is well understood. However, it is not as straightforward to do the same for app-to-app or app-to-data access as there is no human involved in the verification process.</p><p>For an application to access another resource in a secure manner — for example, data stored in an object store or make an API call to another application, etc — the following needs to happen:</p><ol><li><strong>Identity</strong> — the requestor needs to securely acquire a verifiable identity that can be used for Authentication and Authorization purposes when accessing the required resources. The requestor also needs to be securely provisioned with necessary trust anchors that can be used to verify peers’ identities.</li><li><strong>Authentication</strong> — In the process of accessing a given resource, the requestor and the resource owner need to securely verify each other’s identity. The process of verifying a peer’s claimed identity against the presented identity is called Authentication.</li><li><strong>Authorization</strong> — once the requestor is authenticated, the process of checking whether it is allowed to access the resource (or not) is called Authorization.</li></ol><p>As part of the authentication process, the requesting application can present its identity in the form of a PKI certificate or a secret (e.g. a password) or a key. There are two issues that need to be addressed when using secrets or a key for identity:</p><ul><li>The secrets and keys should not be stored directly in the code, as that is an easy attack vector and leaked keys can be a big problem.</li><li>If the secrets are stored in an external vault, then what identity (usually another secret) should be used to obtain the secret and how do we secure this identity to obtain the secret?</li></ul><p>Performing these security operations (for app-to-app interaction) in a reliable and repeatable manner is a non-trivial problem. There are many reasons why this is non-trivial:</p><ol><li>Applications can be easily cloned and spawned (e.g. microservices). How to assign a unique identity to each clone that may be required for forensics, auditing or observability purposes?</li><li>Application identity will be different depending on the environment it is running in. For example, in development vs. production, the application is the same, but it needs a different identity in each environment.</li><li>How to build trust that the infrastructure in which the application is being spawned will not steal the identity or secrets and keys without being noticed?</li><li>How to secure the central vault against attacks and secure all the secrets and keys stored in this vault?</li></ol><p>As a result, securing infrastructure, applications and data across a dynamic environment is a very challenging problem. While cloud providers have risen up to this challenge and provided a lot of tooling to deal with these problems, integrating and maintaining these is not easy for the following reasons:</p><ul><li><strong>Complexity — </strong>Each cloud provider requires the customer to configure and manage multiple services. For example in AWS - metadata service, IAM roles, service account, RBAC, KMS and secrets manager. Each of these services is very different in each cloud provider — both in their semantics, APIs, and monitoring.</li><li><strong>Interoperability — </strong>Even when cloud provider services are configured and operationalized, none of these allow for interoperability. For example, a VM running in GCP cannot access a resource in AWS because the identity assigned using the GCP service account is not understood by an AWS resource.</li><li><strong>Heterogeneous Environments — </strong>If the environment is spread across public and private clouds, or multiple public clouds, or — worse — at the edge, the challenge will be how and where to store secrets like passwords, keys, etc — centrally or distributed.</li><li><strong>Environment specific </strong>— The solution for credentials rotation and/or revocation is very different in each of the cloud providers while none of this exists for edge clusters.</li></ul><p>While many enterprises are a single cloud provider and it may be good enough for them to invest resources in managing and enhancing the security primitives from that provider, we operate in a heterogeneous environment (hybrid-cloud and edge) and had to build a new solution to solve these problems.</p><h3>Solution for Securing a Distributed Platform</h3><p>Our team was tasked with providing security for the applications, infrastructure, and data that may reside across a distributed infrastructure as shown in Figure 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hziN6kanHGKQ-Lru" /><figcaption><strong>Figure 1: Securing Distributed Platform — Identity, Secrets, and Key Management</strong></figcaption></figure><p>As a result, our platform team decided to build new software services that integrated the following four aspects to deliver platform security across the edge, any cloud and our network PoPs:</p><ol><li><strong>Identity Management</strong> — we will describe how we deliver cryptographically secure and unforgeable PKI-based identity to not only applications, but also the infrastructure that is distributed across a heterogeneous environment (multiple clouds, our global PoPs, and geographically spread out edge locations) and operating as multiple environments (eg. developer machine, unit test, production, etc)</li><li><strong>Authentication and Authorization</strong> — our infrastructure is built on microservices that make use of a PKI-based identity and mutually authenticate all communications regardless of the communication protocol in use. We also decoupled authorization from authentication so that a common authorization engine can be used for a variety of authorization decisions and the policy structure can be unified.</li><li><strong>Secrets Management System</strong> — there are many types of secrets (like TLS certificates, passwords, tokens, etc) that are needed by our software, as well as customer workloads. The simplest method could have been to adopt a centralized vault where all the secrets are stored, but this approach had the downside that any compromise will reveal all the secrets. We will describe a different approach that we implemented to achieve a higher level of security by giving up some simplicity.</li><li><strong>Key Management System (KMS)</strong> — data security is critical for our distributed system and the team had to deliver a KMS that works seamlessly across cloud providers. The KMS has to manage, version and rotate keys that are used for symmetric encryption and decryption of data-at-rest, HMAC of CSRF tokens, and digitally sign binaries. We will discuss how we provide capabilities for both security-sensitive operations using this KMS and latency-sensitive operations using the secrets management system.</li></ol><h3>Unforgeable Identity for Infra and Apps</h3><p>Identity is a fundamental issue as many security challenges can be tackled more easily once the identity problem is solved. However, to solve for identity, we need to define what we mean by it and how to issue identity in a reliable manner. Crypto geeks like to have their own spin on everything, and the definition of identity is no exception:</p><blockquote>The unique and entire set of <strong>unforgeable</strong> and <strong>cryptographically verifiable</strong> characteristics cryptographically certified via an undelegated and secure protocol by a trusted authority that make up what a person or thing is known or considered to be.</blockquote><p>In essence, what is needed is an unforgeable and cryptographically verifiable identity delivered securely. Issuing such an identity is challenging for two reasons: 1) <strong><em>bootstrapping of identity</em></strong><em> </em>and 2) <strong><em>root-of-trust</em></strong></p><p>There are a few approaches that get discussed often in relation to identity — SPIFFE and Hashicorp Vault. We would clarify that SPIFFE is a naming scheme that could be used in our system as an identity document (X.509 certificate) — however, the format is not suitable for some identity attributes that contain binary data. While Vault can be used to issue an identity document, it does not solve the challenges of Bootstrapping of Identity and Root of Trust problem:</p><ol><li><strong>Bootstrapping of Identity</strong> — in real life, when a person is born, his/her identity is established by the birth certificate. This logically bootstraps the identity of the person and using this certificate the person can derive/request more identity certificates such as passport, driver’s license, etc. Similarly, in the computing world, every launch of an application (or a microservice) needs to bootstrap an identity. The establishment of identity is one of the first steps any running code needs to perform in order to be able to interact with other services. In addition, since the same application code may be launched multiple times and in different environments `(developer laptop vs. unit test vs. production), it is also required that each of these launches establish a separate bootstrap identity.</li><li><strong>Root of Trust</strong> — while issuing a bootstrap identity may seem like a straightforward process, the problem is who gets to provision this identity. For example, in the real world, provisioning of identity begins with the hospital asserting the fact that a child was born on a given date+time to a particular person and an assumption is made that the hospital is minting the birth record with proper checks and cannot be forged. As a result, the birth record document can be used as a source-of-truth (or root-of-trust). Similarly, when an application is launched by a human or automated code, there needs to be a root-of-trust that can verifiably assert the identity of the application that was launched. This assertion can then be used to generate a subsequent identity document for the application.</li></ol><p>For example, when a VM is launched in AWS it is provided with a bootstrap identity and the metadata service of AWS acts as the root-of-trust. The identity document (that is signed by AWS using their own cryptographic key) looks something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77e300815aad6322e2be0934997f16df/href">https://medium.com/media/77e300815aad6322e2be0934997f16df/href</a></iframe><p>While the <strong>instanceId</strong> may denote the unique identity of the application instance that was launched, it needs to be chained up to some well-known name (myserver.acmecorp.com) that other applications will use to communicate to this particular instance. As a result, even this AWS bootstrap identity document is insufficient, but can be used to issue another identity that can be used by the applications to communicate with another application.</p><p>As stated earlier, it was critical for us to deliver an identity that allows applications to communicate and share information across cloud providers and/or edge locations (Figure 2). This meant that we had to build a system for both identity bootstrapping and root-of-trust that works across all of these environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zn9tHdSzhSOhRh5VlcMs1g.png" /><figcaption><strong>Figure 2: Communication across Cloud Providers, Network PoPs, and Edge</strong></figcaption></figure><p>Since we use Kubernetes to manage and orchestrate applications (both microservices and VMs), this meant that the <strong>bootstrapping</strong> of a unique identity for every pod launched had to be hooked into the Pod creation process of Kubernetes. Figure 3 shows how we hook into the pod creation process using the K8s webhook mechanism. This webhook, called <strong>Voucher</strong>, injects a security sidecar, called <strong>Wingman</strong>, into all Pods created in the cluster and also provides necessary cryptographically signed information that can be used as the <strong>root-of-trust</strong>. This webhook provides a short-lived signed token that is used by Wingman to request an X.509 certificate from Identity Authority in Volterra’s SaaS backend.</p><p>The Identity Authority enforces the rules of minting the identity in a way that minimizes the “blast radius” in case one of the K8s clusters is compromised. Many other solutions that rely on a common root CA or federation of K8s clusters cannot limit the blast radius, which was a major input into our design decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BiiAqYwHqEToAtR84ypkaQ.png" /><figcaption><strong>Figure 3: Root-of-trust in each Kubernetes Cluster</strong></figcaption></figure><p>For a given Pod in K8s, the attributes can change after the creation of the Pod — For example, a Pod can be attached to a new service after its creation. This meant that identity certificates had to be updated with the new service. Wingman continuously watches the Voucher that tracks the K8s API server for any such updates.</p><p>This mechanism delivers a unique and universal global identity to every application instance running across our platform, irrespective of whether it is our own workload or customer workload. This unique identity and sidecar (Wingman) are then used to secure all communication, access and keys/secrets across a distributed system.</p><h3>Authentication and Authorization</h3><p>Having a unique identity per Pod is a great start as it eases the task of implementing mutual authentication among communicating services. Our underlying infrastructure is made up of many different services that run on different protocols such as gRPC, REST, IPSec, BGP, etc. Since the early days, the team set a goal of achieving mutual authentication and communication security (encrypted channel) for all communicating parties regardless of the protocol. This also meant that we couldn’t tie our identity to a solution (e.g. Istio) that limits itself to a particular set of protocols (e.g. HTTP/TCP vs. IP-based).</p><p>Since our platform also allows customers to run workloads of their choice, we expect that these workloads could run a variety of protocols and the platform should not limit their ability by providing an identity that is limited to a particular set of protocols. Instead, the authentication is decoupled from the identity (via Wingman) and this makes hooking into various service mesh technologies possible. Our service mesh sidecar/dataplane (covered in a previous blog) uses this identity to deliver mTLS for customer workloads.</p><p>Since many of our own infrastructure services were written using Volterra Golang Service Framework (to be discussed in a future blog), we decided to build the logic of consuming identity (from Wingman) directly into the framework. This has helped our developers secure their service to service communications out of the box without relying on service mesh sidecar for mTLS.</p><p>The next logical step after achieving a mutually authenticated secure channel is Authorization — a process for the receiver of the request (server) to determine whether or not to allow the request coming from the identified caller (client). The reasons to not allow the request could be many — quota limitations, permissions, etc. Since these reasons and their thresholds are dynamically changing, a hard-coded set of rules (policy) for authorization was a non-starter for our platform.</p><p>We decided to use Open Policy Agent’s engine as a starting point and built a wrapper for authorization within Wingman sidecar. This wrapper code fetches the relevant policies dynamically and keeps them hot for fast evaluation. Similar to Authentication, decoupling the Authorization engine from identity (and Authentication) has allowed us to enforce authorization policies at multiple stages of request processing, including deep down in the business logic and not just immediately after authentication.</p><p>Since Wingman is inserted in all workloads, including the customer’s workloads, our platform provides an Authorization engine as a built-in feature. Even though Open Policy Agent (OPA) is built on a powerful language called Rego, we wanted to hide its complexity from our developers and customers. All policies on our platform can also be defined using a much easier to understand and intuitive policy structure that does not require the users (DevOps) to learn Rego and therefore avoid mistakes. Similar to authentication configuration, our Golang Service Framework was hooked into Wingman’s authorization engine by automatically calling Wingman for authorization and hiding the complexity of authorization from the developers.</p><p>Using a unique identity (issued using Wingman) for authentication and a programmable policy engine (within Wingman) for authorization, we are able to secure communication using mTLS and control every access using a robust and programmable policy.</p><h3>Secrets Management without a Centralized Vault</h3><p>Every day, engineers make inadvertent mistakes by storing keys and passwords in their code and it somehow makes its way to public code or artifact repositories. Managing secrets is hard and without an easy to use toolkit and a well defined process, developers are expected to follow the shortest path forward. As a result, from the very beginning of the company, our platform security (different from network and app security) team’s mission was to ensure that developers don’t have to ask questions like “Where do I store secrets — source code or artifacts or …?”</p><p>We evaluated two common approaches that were available to us for secrets management when we started building our platform, and both of them had certain shortcomings:</p><ol><li><strong>Kubernetes Secrets</strong> — While we use Kubernetes and it comes with its secrets solution, it is not particularly useful for various reasons — secrets are not encrypted-at-rest, policy constructs are not comprehensive, and it does not solve multi-cluster scenarios.</li><li><strong>Centralized Vault (e.g. Hashicorp or Cyberark Vault)</strong> — Another approach could have been to use a Vault where the secrets are stored centrally and are handed out to authorized requestors. The secrets are protected by a single encryption key that is used for encrypted storage of Vault. The problem with this approach, however, is that the secret management system has access to clear secrets (even if they are stored in encrypted form) and any compromise of the system could reveal all the secrets.</li></ol><p>In our case, being a SaaS service, we had to come up with a more robust method to secure our customers’ secrets, as any compromise should not reveal their secrets.</p><p>As a result, we decided to implement a new technique that we call <strong>Volterra</strong> <strong>Blindfold </strong>(trademark), which works in conjunction with our security sidecar, Wingman, as shown in Figure 4. This approach allows the owner of the secret to lock (encrypt) the secret in such a way that the secret is never revealed in clear to any undesired party (including the decryption server). The secret is not even stored in a central decryption server and this design, in some respects, dramatically simplifies the server design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*VN80hw4_eYqnUUnH" /><figcaption>Figure 4: Blindfold and Wingman for Secrets Management</figcaption></figure><p>We provide users with a blindfold tool that can be used in a completely offline setting to encrypt the secret (S) which can then be distributed — for example, the secret can itself be stored with the workload and uploaded to the registry. Once this is achieved, the following steps need to happen:</p><pre>1. The distributed control plane calls the site K8s API to create a Pod (deploy app)</pre><pre>2. The site control plane fetches the container that contains the encrypted secret (E)</pre><pre>3. As part of launching the Pod, Wingman is inserted by the control plane and establishes identity</pre><pre>4. Workload calls Wingman API to decrypt the secret</pre><pre>5. Wingman performs a <strong>blinding operation</strong> on E → W</pre><pre>6. Key-server in our centralized control plane decrypts the encrypted+blinded secret W → X</pre><pre>7. Wingman performs unblinding operation to transform X → S</pre><p>This ensures that the centralized control plane never gets access to the secret in clear (S) and also the secret is only available in the runtime memory of the Pod for the duration of the access. In addition, access policy can be applied to define who gets access to a secret. The policy can be defined based on the identity attributes such as application name, location, compliance level etc. This way any complex subset of workloads can be carved out and precise access control can be achieved. The policy is cryptographically woven into the encryption, blinding, decryption and unblinding process — it is computationally infeasible to defeat the intent of the policy.</p><p>Using our unique Blindfold technique to lock each secret and Wingman to unseal each secret based on policy and unforgeable identity, we are able to overcome the problems with existing solutions and deliver secrets management in a distributed environment without ever worrying about compromise of the central goldmine.</p><h3>Key Management for Distributed Systems</h3><p>Although secrets and key management may sound like two different names for the same problem, there are subtle (but important in practice) differences between the two depending on who you ask and how one may want to implement the solutions.</p><p>Secret refers to any information that is supposed to be secret and not available to unauthorized parties. In a way, cryptographic keys are a specific case of secrets. Key Management, on the other hand, generally refers to a system that securely stores sensitive cryptographic key material and controls the use of the material. In some cases, the key management system may hand out raw bytes of the key to authorized parties and therefore may get confused with a secret management system. In most cases however, the key management system does not actually hand out raw bytes of the key material and instead performs operations for authorized requestors and sends only the output of the operation. Many key management systems are also backed by hardware storage (eg. HSM) for the key material such that the key is never exposed in clear to the software.</p><p>In distributed environments, even for a single cloud provider, the problem of managing, syncing and rotating cryptographic keys is very challenging and current solutions are error-prone, inefficient and even insecure. For example, if one uses 3 AWS regions today and wants to use the same crypto key in all 3 regions, they will have to manually sync and rotate the keys. The problem becomes even worse when the environment spans across multiple cloud providers ( public and/or private). Even after all this is said and done, the application owners still have to write complex code to make use of these KMS capabilities.</p><p>Our platform hides all the complexities of key management from the application by making Wingman sidecar do all the heavy-lifting and provide simple interface(s) to the application to make the key management requests including encryption, decryption, HMAC, HMAC verify, digital signature, signature verification, fetch key (when allowed) etc. This makes key management not at all daunting for our own infrastructure services as well as customer workloads.</p><p>The following diagram (Figure 5) shows how Volterra’s KMS works across environments and helps workloads to offload their key management and crypto operations to the Wingman sidecar. Depending on the configuration, Wingman is able to cache keys and refresh the cache without the application even knowing it. The enabling factor here is the universal and unforgeable identity that we introduced earlier. Since each Pod, regardless of its location, gets a globally unique identity, it is easy for the Volterra KMS system to apply access policies to crypto keys and specific operations like encryption, decryption, HMAC, HMAC verify, digital signature, and signature verification in a very accurate manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*adk2OOrv2C8L2RDq" /><figcaption>Figure 5: Wingman and KMS Server in our SaaS Backend</figcaption></figure><p>Since all the keys are managed via Volterra’s SaaS backend, the workloads running in heterogeneous environments do not have to deal with key sync, rotation, revocation etc — they just have to know simple Wingman APIs for all their data-at-rest security needs.</p><h3>Gains Delivered by Our Platform Security Solution</h3><p>Using multi-layer platform security, we have been able to deliver a comprehensive solution to three critical problems in an entirely new way! Our system is able to securely bootstrap a universal identity that does not suffer from the problem of “<a href="https://en.wikipedia.org/wiki/Turtles_all_the_way_down">turtles all the way down</a>”, manage secrets that can be stored and distributed without ever worrying about the goldmine problem, and provide key management to ease security of data-at-rest in a distributed environment. This has led to the following gains for our internal teams as well as our customers:</p><ol><li><strong>Security and Compliance — </strong>unforgeable and universal identity, Blindfold, and security sidecar (Wingman) that is fully integrated and automatically managed by the platform to secure all communication, authorize every access, and manage keys/secrets across a distributed system. Using these advances, we are able to deliver a more robust security solution that has eased our and our customers’ ability to meet compliance.</li><li><strong>Productivity Improvements</strong> — using a security solution that is integrated in our DevOps process and service framework, it is easy for developers and DevOps teams to focus on their deliverables without worrying about key aspects of application and data security.</li><li><strong>Continuous Evolution</strong> — the evolving security landscape and new technologies lead to continuous evolution of Blindfold, Wingman and our Golang Service Framework. As a result, new capabilities get automatically rolled out by the platform without any changes to application logic.</li></ol><h3>To Be Continued…</h3><p>This series of blogs will cover various aspects of what it took for us to build and operate our globally distributed SaaS service with many application clusters in public cloud, our private network PoPs and edge sites. Next up will be Application and Network Security (coming soon)…</p><p><em>We are seeking a few volunteer developers and solution architects to help us bring this capability to broader community as an Open Source Project, please reach out directly to asingla@volterra.io if there is interest to be part of something fun!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3772484815ff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff">Securing a Distributed Platform — Identity, Secrets, and Key Management</a> was originally published in <a href="https://medium.com/volterra-io">volterra.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Global Service Mesh for Distributed Applications]]></title>
            <link>https://medium.com/volterra-io/global-service-mesh-for-distributed-applications-a487ffe50abc?source=rss-9bf83e2b9758------2</link>
            <guid isPermaLink="false">https://medium.com/p/a487ffe50abc</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[service-mesh]]></category>
            <dc:creator><![CDATA[Ankur Singla]]></dc:creator>
            <pubDate>Mon, 25 Nov 2019 17:21:01 GMT</pubDate>
            <atom:updated>2020-10-01T14:35:18.102Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog is the second in a series of blogs that cover various aspects of what it took for us to build and operate our <a href="https://www.volterra.io/">SaaS</a> service:</p><ol><li><a href="https://medium.com/@asingla77/e20a82acd6d3">Control plane for distributed Kubernetes PaaS</a></li><li><strong>Global service mesh for distributed applications</strong></li><li><a href="https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff">Platform security of distributed infrastructure, apps, and data</a></li><li><a href="https://medium.com/volterra-io/overcoming-limitations-of-service-mesh-for-the-security-of-distributed-app-clusters-b0db81a35718">Application and network security of distributed clusters</a></li><li>Observability across a globally distributed platform</li><li>Operations &amp; SRE of a globally distributed platform</li><li>Golang service framework for distributed microservices</li></ol><p>In an <a href="https://www.volterra.io/resources/applications-driving-the-need-for-distributed-cloud-services">earlier blog</a>, we had provided some background on our needs that led us to build a new platform. Using this platform, we enable our customers to build a complex and diverse set of applications — like smart manufacturing, video forensics for public safety, algorithmic trading, telco 5G networks.</p><p>The <a href="https://medium.com/@asingla77/e20a82acd6d3">first blog</a> in this series covered a distributed control plane to deliver multiple multi-tenant Kubernetes based application clusters in public cloud, our private network PoPs, and edge sites.</p><p>This specific blog will tackle the challenges of connecting and securing these distributed application clusters from three points of view — application to application, user (internet) to application, and application to the public internet. We will introduce a brand new and fully integrated L3-L7+ datapath, a globally distributed control plane, and our high performance global network. These three things combine to deliver a comprehensive set of network and security services in edge, within any cloud VPC, or in our global network PoPs. After running in production with 35+ customers for over 1-year, we have started to scale the deployment and felt that now is a good time to share our journey.</p><h3>TL;DR (Summary)</h3><ol><li>Delivering high-performance, reliable and secure connectivity for distributed application clusters required us to build a new global network. While there are many service providers for connecting and securing consumers to applications (Akamai, Cloudflare, etc) and employees to applications (eg. Zscaler, Netskope, etc), there isn’t a service provider that delivers on the need for application to application connectivity and security.</li><li>In addition to a global network to connect distributed applications, these application clusters require networking, reliability, and security services — API routing, load balancing, security, and network routing — with a consistent configuration and operational model. These services need to run within multiple cloud provider locations, in resource-constrained edge locations, and/or our global network.</li><li>To deliver these networking and security services, we decided to build a new and fully integrated L3-L7+ network datapath with consistent configuration, policy, and observability irrespective of where it ran — in our network, in many public clouds, or edge locations. Since many of these datapath can be deployed across multiple sites, it also required us to build a globally distributed control plane to orchestrate these datapaths.</li><li>The combination of a global network, a new network datapath, and a distributed control plane has given us a “globally distributed application gateway” that delivers zero-trust security, application connectivity, and cluster reliability without giving network access across this global network — a “global service mesh” that delivers simplification for our security and compliance team.</li></ol><h3>Where are the Cables? Why did we build a Global Network?</h3><p>As our customers are building fairly complex and mission-critical applications — like smart manufacturing, video forensics for public safety, algorithmic trading, telco 5G transition — we need to deliver an always-on, connected, and reliable experience for the applications and the end-users of these applications. Some of these applications run data pipelines across clusters within a cloud, or need to backup data across cloud providers, or need reliable delivery of requests from a global user-base to app backends, or need high-performance connectivity from their machines to the backends running in centralized clouds.</p><p>In order to meet these needs, there were two requirements from the physical network:</p><p><strong>R1 — Cloud to Cloud</strong> — High performance and on-demand connectivity of applications across public or private cloud locations across the globe</p><p><strong>R2 — Internet to Cloud</strong> — In order to get devices and machines in edge locations to connect reliably to the application backend, we needed to provide multiple redundant paths as well as terminate connections as close to these users instead of backhauling traffic all the way to the backends using the internet.</p><p>We could have solved the requirement R1 and R2 by going to a network service provider like AT&amp;T but they couldn’t have provided us with a seamless network experience and integration with our application services — API-based configuration, streaming telemetry, ability to easily add our own or our customers’ IP prefixes, API-based network services, etc . In addition, getting global coverage from service providers is very difficult or prohibitively expensive. We could have gone with two or three different service providers to solve all these problems but then we would have ended up with a mess of different systems that behave differently, have different failure modes, different SLAs, support systems, and have different (or none) APIs.</p><p>So we ended up needing to build our own network and this meant that the network needed to have three properties:</p><ol><li>Solving R1 meant that we needed to build a private network across multiple cloud providers and across the globe to connect all the regions — and the best approach to do this is to peer with cloud providers in major cloud regions as well as use a mix of direct connect links at major colocation facilities. Peering does not guarantee the best SLAs whereas direct connect links do provide SLA guarantees within a cloud region.</li><li>Solving R2 for machines in edge locations meant that we needed to support multiple active-active links from each edge location where the links can be low-cost internet links (over cellular or cable/fiber) and/or higher-cost dedicated links (over fiber/ethernet). In order to get performance and reliability, traffic needs to be load balanced and terminated as close to the edge location as possible instead of hauling over unreliable internet. In industry parlance, this feature is also called SD-WAN.</li><li>Solving R2 for internet users and edge applications meant that we needed to perform edge termination of TLS traffic and this needs to also happen as close to the user as possible. This meant that we needed to build network edge locations with dense peering with mobile operators, content providers, and also bring traffic using multiple transit providers to ensure the most optimal routing.</li></ol><p>To meet these three properties, we needed to do many things. However, we will highlight five big bucket items:</p><ol><li><strong>Global Network PoPs</strong> with our Network Gear — we ended up having to build multiple network PoPs in major metro markets — we started with multiples cities in Europe with Paris, London, Amsterdam Luxembourg and one PoP in the US with NYC during the early days of our platform build and then expanded to Seattle, San Jose, Ashburn, Frankfurt, Singapore, and Tokyo — as this gave us global coverage and we were close to all major cloud providers. We chose Equinix as our global partner and augmented with Interxion and Telehouse/KDDI, Westin for locations where Equinix is not the most optimal choice. Because we believe in automation, we ended-up picking Juniper Networks for switching/routing gear and Adva for metro fiber interconnectivity of 400G and 100G links.</li><li><strong>Private Backbone</strong> — In order to connect all of these PoPs with high performance and reliability, we decided not to build an overlay network on top of multiple transit providers and instead chose to build a global private backbone using a combination of multiple 100G waves from providers like Zayo, Centurylink, EuNetworks, etc. While many CDN (eg. Cloudflare, Fastly) and Security providers (eg. Zscaler) rely entirely on Transit and Peering connections as they are serving downstream traffic, we believe there are good reasons to use a combination of private backbone and transit as we are dealing with east-west application to application traffic. This is not unique to us — all major cloud providers have a global private backbone connecting their cloud locations.</li><li><strong>Internet Peering and Transit Providers</strong> — In order to increase the diversity and achieve the best performance to reach users and content or SaaS providers, an ideal solution is to peer with as many operators and content providers directly. We peer at multiple exchanges as outlined in PeeringDB (<a href="https://www.peeringdb.com/net/10569">ASN-35280 in PeeringDB</a>). Not all traffic can be serviced through the peering connections and that is where transit connections come to play. Transit links and peering ports need to be monitored very carefully to maintain quality — we ended up selecting the best Tier-1 providers such as NTT, CenturyLink, and Telia to serve us at various global locations.</li><li><strong>Cloud Peering and Interconnects</strong> — We recently started peering directly with cloud providers but they don’t guarantee any SLAs for these connections — for example, at our peering connection in Seattle (Westin facility), we are able to reach all three major cloud providers directly. Even though these connections are better than just going over transit providers, we started to augment our network with direct connections (called AWS Direct Connect, Azure Express Route, and GCP Dedicated Interconnect) to these cloud providers, as these come with SLAs and additional features. While these links are expensive and only allow access to internal VPC/VNET subnets, they provide the best connectivity.</li><li><strong>Software Gateways</strong> — In the cloud or edge locations that are not directly connected to our PoP locations, we install our software gateways. We will cover advanced functionality provided by these gateways in a later section of this blog, but one of the functionality that pertains to the transport layer is that these gateways automatically create secure VPN (IPsec or SSL) tunnels to multiple network PoPs for redundancy and load balance traffic to the PoPs. In addition, in a cloud deployment, these gateways create an outbound connection to our nearest PoP across cloud providers NAT gateways and an on-ramp to our global private network — no need to traverse public networks and/or connect application clusters across cloud locations using public IP addresses.</li></ol><p>We realized very early in our development that building and operating a global network requires time and skills and we needed to bring this expertise. After months of discussions with the founders of Acorus Networks (security provider based of Paris, France), we ended up merging Acorus with Volterra. This helped us solve the problem of our global infrastructure and network rollout. Acorus had bootstrapped a great network and an operations team that had fully automated physical network configuration using Ansible and built external APIs for telemetry and configuration that could be used by our software team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*qWPXpUW52NmWzec9" /><figcaption>Figure 1: App to App or User/Machine to App Traffic over our Global Network</figcaption></figure><p>Now that we had a team focused on building out a global private network with high reliability and performance, we could easily solve the problems of both application to application and user/machine to application traffic across edge or cloud locations as shown in <strong>Figure 1</strong>. In addition, compute and storage infrastructure in our Network PoPs also allowed us to add API termination, app security, and workload offload (from edge or cloud) to our network. This will enable us to continue to evolve our capabilities for a long time to come and easily expand our network footprint and service catalog based on demand.</p><h3>Network Services for Applications — Multi-Cloud, Private, Edge?</h3><p>Once we had a functioning global network, we needed to start adding application clusters and our workloads. These workloads need their own set of application-level connectivity and security services.</p><p>As we explained in our <a href="https://www.volterra.io/resources/applications-driving-the-need-for-distributed-cloud-services">earlier blog</a>, our goal with the platform was to improve productivity and reduce complexity for our teams that are managing workloads running across multiple environments (cloud, edge, and our network PoPs).</p><p>Every cloud provider requires configuring, managing, and monitoring many different cloud resources for secure connectivity to application clusters. For example, in Google Cloud, to configure an end-to-end network service for an application cluster, it will require us to manage many different sets of services:</p><p><strong>Wide Area Network (WAN) Services</strong></p><ul><li><a href="https://cloud.google.com/vpn/docs/">Virtual Private Networks (VPNs)</a> and/or <a href="https://cloud.google.com/interconnect/docs/">Interconnects</a></li><li><a href="https://cloud.google.com/dns/docs/">DNS Servers</a></li><li><a href="https://cloud.google.com/armor/docs/">DDoS and WAFS</a></li></ul><p><strong>Application Networking Services</strong></p><ul><li><a href="https://cloud.google.com/load-balancing/docs/https/">Application Load Balancers</a>, <a href="https://cloud.google.com/load-balancing/docs/network/">Network Load Balancers</a> (Public APIs)</li><li><a href="https://cloud.google.com/load-balancing/docs/l7-internal/">Application Load Balancers</a>, <a href="https://cloud.google.com/load-balancing/docs/internal/">Network Load Balancers</a> (Internal)</li><li><a href="https://cloud.google.com/istio/docs/istio-on-gke/installing">Service Mesh</a> (App to App)</li></ul><p><strong>Network Routing and Isolation Services</strong></p><ul><li><a href="https://cloud.google.com/vpc/docs/vpc">Virtual Private Cloud Network (VPC Network)</a></li><li><a href="https://cloud.google.com/vpc/docs/vpc#vpc_networks_and_subnets">Subnets</a>, <a href="https://cloud.google.com/vpc/docs/vpc#manually_created_subnet_ip_ranges">IP Ranges</a>, <a href="https://cloud.google.com/vpc/docs/routes">Routes</a></li><li><a href="https://cloud.google.com/nat/docs/">NAT Gateways</a>, <a href="https://cloud.google.com/vpc/docs/firewalls">Firewall Rules</a></li></ul><p>Great, while it would be a big challenge, we could have decided to tackle this by building a configuration and operations layer to harmonize across each cloud provider. However, we knew that it would not have solved our problems as the services from cloud providers did not meet all our needs (eg. ability to perform application and API security is missing at CSPs), they are not the best of the breed, and are continuously changing.</p><p>In addition, what about our Network PoPs and edge sites? We would have to go and get similar capabilities from hardware or software vendors and integrate them all together — eg. Cisco/Juniper for routing+nat+vpn, F5 for load balancing and firewall, etc. At the edge locations, the problem is compounded as neither the cloud providers nor the large network vendors could solve the network services problems for a resource-constrained environment. Another potential option for the edge could have been to move all the application connectivity, security, and network services to our global network — but it was clear that will not work as app-to-app traffic within the same edge site needed some of these services also.</p><p>After doing a lot of discussions and surveying the landscape, we realized that doing integration across many service providers and vendors — configuration, telemetry, monitoring, alerting — and keeping up with their roadmap and API changes ran counter to our goal of simplicity and speed.</p><p>Another problem that we needed to solve across the platform was multi-tenancy — this was easier to do for WAN services and network routing, but challenging for application networking services given that most of the load-balancers on the market have none to very limited support for multi-tenancy.</p><h3>A New L3-L7+ Network Datapath</h3><p>As a result, we decided to take on this challenge and build a high-performance network data path that not only provides network routing service but also application, security, and wide-area services. This would allow us to unify the service portfolio across our hybrid and distributed cloud environment and require us to depend on a minimal set of native services in public clouds.</p><p>Given that the team had good networking experience and that we had dealt with such problems in our previous lives with Contrail/Juniper, we thought the best route to solve this problem will be to start with a clean slate and build a brand new networking solution that integrates L3 to L7+ services in a single datapath that can run in any cloud or edge while being managed centrally by our platform.</p><p>We picked the best projects to start the design of this new datapath — OpenContrail vRouter (for L3-L4) that we had already spent 6 years developing and Envoy for L7 as it has huge community backing. That said, we had to make several changes and additions to build a new unified L3-L7+ datapath — multi-tenancy for Envoy, dpdk for Envoy, user-space dpdk TCP stack, network policy, SSL/IPSec VPNs, http connect, dynamic reverse proxy, transparent forward proxy, API gateway, programmable application policy, fast ACLs for DDoS protection, PKI identity integration, Chrome v8 engine, application and network security, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4nCxhq81HzdXN4wn" /><figcaption>Figure 2: Network Datapath</figcaption></figure><p>This datapath (as shown in <strong>Figure 2</strong>) is deployed as ingress/egress gateway for our application clusters, software gateway in edge, deliver service-mesh capability within a cluster or across multiple clusters, or to deliver network services from our global PoPs.</p><p>In order to align with our need for multi-tenancy for the platform (covered in the previous blog), we also needed to deliver full multi-tenancy for this network datapath. This was relatively straightforward for the routing layer as the vRouter already supported <a href="https://en.wikipedia.org/wiki/Virtual_routing_and_forwarding">VRFs</a>, however, we had to make changes in Envoy to make it multi-tenant. Since we were not using the kernel TCP stack, we changed Envoy’s TCP socket interface and added VRF awareness.</p><p>This datapath also needed to perform API security, application firewalls, and network security — we used a combination of algorithmic techniques and machine inference for this and will cover this topic in an upcoming blog post.</p><p>We got many advantages by building this network datapath:</p><ol><li>Complete L3-L7+ capabilities with uniform configuration, control, and observability</li><li>Support for Scale-out within a single cluster allows us to support a range from a very small footprint and lower performance edge devices up to 100Gbps+ or more capacity in our network or public cloud locations</li><li>Rapidly add new capabilities to the network datapath without depending on any network vendor and/or cloud provider</li><li>Common solution with similar failure and performance characteristics across any environment — very important for our operations teams.</li></ol><p>Now that we could deploy multiple app clusters with this new network datapath, it was critical to build a globally distributed control plane to configure, control, and monitor them.</p><h3>Purpose-built Control Plane for Distributed Network</h3><p>There are multiple issues that our platform team had to tackle as part of building a distributed control plane to manage a large number of distributed datapath processing nodes. Since we built a new datapath, there was no out-of-the-box control plane that could be leveraged and we had to write our own:</p><ol><li>Local Control Plane to manage multiple datapath running within a single cluster (cloud, edge, or network PoP). These datapath nodes needed a local control plane to manage configuration changes, route updates, perform health-checks, perform service discovery, peer with other network devices using a protocol like BGP, aggregate metrics and access logs, etc.</li><li>Distributed Control Plane to manage multiple local control planes — There is a distributed control plane running in our global network PoPs (<strong>Figure 3</strong>) and this control plane is responsible for configuration management of the local control planes, operational state distribution across each of the local control planes, and data collection from each of the nodes. To distribute operational state — we decided to use BGP as it is eventually consistent and robust. Since we had built a very high-scale and multi-threaded implementation of BGP as part of OpenContrail, we leveraged it and added extensions for load balancing — health-check distribution, http/api endpoints, policy propagation, etc.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/0*5X0cfnhe8hTpY8RB" /><figcaption>Figure 3: Distributed and Local Control Planes</figcaption></figure><p>In addition, there is a centralized management plane running in two cloud regions — AWS and Azure — that gets used alongside the distributed control plane to deliver multi-tenancy as shown in <strong>Figure 4</strong>. Our SRE team can create multiple tenants and each tenant is completely isolated from another tenant across our global network. They can only route to each other using “public network”. Within a tenant, services across namespaces can talk to each other based on http/api/network routing and security rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MLMfFUfGd1TICzKA" /><figcaption>Figure 4: Multi-tenancy in the Network</figcaption></figure><p>The control planes run as Kubernetes workloads in a separate tenant and isolated namespace that is under the control of only our SRE teams. As a result, no developer and/or customer can disrupt this service. In addition, since the control plane is distributed, an outage of a control plane in one location does not impact the overall service.</p><h3>Globally Distributed Application Gateway?</h3><p>Once we had figured out the needs for our global network and had defined the requirements for L3-L7+ network services for app clusters (a new datapath and distributed control plane), our product team came up with more requirements that made our life even more exciting. Basically, they wanted us to deliver a global, inter-cluster service mesh with the following features:</p><ol><li>Deliver application connectivity (routing, control, and observability) across the global network but not network connectivity (at-least not by default) — The reason was simple, connecting networks creates all kinds of security vulnerabilities that can only be solved by creating complex firewall rules and this makes it harder to perform change management.</li><li>Improve edge load balancers in the network PoPs with endpoint health and reliability — Currently, edge load balancers (eg. AWS global accelerator or Akamai global load balancer), the routing decision from the edge location to the backend is based on the health of the origin server (in most cases, the origin server is yet another load balancer and not the actual serving endpoint). Our team wanted the capability of each of our edge load balancer to manage traffic based on the health of all the endpoints across all clusters and not just the health of origin load balancers.</li><li>Improve edge site (network PoP) selection as part of GSLB decision-making — Currently, anycast or GSLB will route the user/client to the closest edge site for ingress. However, for various reasons (load on the backbone and/or transit providers), it might be better to send the user to a different ingress edge site.</li></ol><p>With requirement #2 and #3, the goal was to improve the response time and performance of client to server connectivity and this is really critical in application to application communication or for large scale SaaS applications. In order to meet requirement #2 and #3, it was clear that the best approach was to build a distributed proxy (<strong>Figure 5</strong>) — an ingress proxy and egress proxy and route based on application addressing and not network addressing. In addition, we decided to distribute the health of serving endpoints (or servers) by leveraging the distributed control plane and BGP extensions (as described earlier). This implementation of the distributed proxy is shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRrDJ0-jhrs9c-_HWFLKhw.png" /><figcaption>Figure 5: Distributed Application Gateway</figcaption></figure><p>Since it became a distributed proxy with a complete L3-L7+ network stack, we call this as a globally distributed application gateway. All the functionality that is available in our network datapath is now available across our global network — for example, load balancing and routing based on HTTP or APIs, policy enforcement at the edge, API transformation, TLS termination closer to the user, etc.</p><h3>Gains delivered by Distributed Application Gateway</h3><p>There are multiple gains that the team was able to realize with the implementation of a globally distributed application gateway. These gains were in the areas of operational improvements, security, performance, and TCO:</p><ol><li><strong>Security and Compliance</strong> — Ability to provide application access across sites without network access has significantly improved the security and compliance across application clusters in edge or cloud locations. This has also reduced the need for complex firewall configuration management as there is no network access across sites and the application clusters can be connected but completely behind NAT in each site.</li><li><strong>Operational Overhead</strong> — Common set of network services across our Network PoPs and edge/cloud sites has removed the need for our SRE or DevOps to do integration of configuration and observability across different sets of services.</li><li><strong>Performance and Reliability Improvements</strong> — Since we route from our network PoP to most optimal and healthy endpoint and not the most optimal load-balancer, the platform is able to deliver much higher performance for application to application or user to application traffic than any other solution on the market.</li><li><strong>TCO gains</strong> — For large scale SaaS applications, it is common to have hundreds of replicas of the service being served from multiple data-centers across the globe. In order to do this effectively, the SaaS provider has to build complex capabilities that are now available to all our customers with this distributed application gateway.</li></ol><h3>To Be Continued…</h3><p>This series of blogs will cover various aspects of what it took for us to build and operate our globally distributed SaaS service with many application clusters in public cloud, our private network PoPs, and edge sites. Next up is <a href="https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff">Platform and Data Security</a>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a487ffe50abc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/volterra-io/global-service-mesh-for-distributed-applications-a487ffe50abc">Global Service Mesh for Distributed Applications</a> was originally published in <a href="https://medium.com/volterra-io">volterra.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control Plane for Distributed Kubernetes PaaS]]></title>
            <link>https://medium.com/volterra-io/control-plane-for-distributed-kubernetes-paas-e20a82acd6d3?source=rss-9bf83e2b9758------2</link>
            <guid isPermaLink="false">https://medium.com/p/e20a82acd6d3</guid>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ankur Singla]]></dc:creator>
            <pubDate>Fri, 15 Nov 2019 15:11:29 GMT</pubDate>
            <atom:updated>2020-04-18T20:56:30.873Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Authors</strong>: <a href="https://www.linkedin.com/in/ankur-singla-4863801/">Ankur Singla</a>, <a href="https://www.linkedin.com/in/harshad-nakil-aba2b52/">Harshad Nakil</a></p><p>This blog is first in a series of blogs that cover various aspects of what it took for us to build and operate our <a href="https://www.volterra.io/">SaaS</a> service:</p><ol><li><strong>Control plane for distributed Kubernetes PaaS</strong></li><li><a href="https://medium.com/p/a487ffe50abc">Global service mesh for distributed applications</a></li><li><a href="https://medium.com/volterra-io/securing-a-distributed-platform-identity-secrets-and-key-management-3772484815ff">Platform security of distributed infrastructure, apps, and data</a></li><li><a href="https://medium.com/volterra-io/overcoming-limitations-of-service-mesh-for-the-security-of-distributed-app-clusters-b0db81a35718">Application and network security of distributed clusters</a></li><li>Observability across a globally distributed platform</li><li>Operations and SRE of a globally distributed platform</li><li>Golang service framework for distributed microservices</li></ol><p>As we described in our <a href="https://www.volterra.io/resources/applications-driving-the-need-for-distributed-cloud-services">earlier blog</a>, our customers are building complex and diverse sets of business solutions — like smart manufacturing, video forensics for public safety, algorithmic trading, telco 5G networks — and thus we need to deliver an always-on, connected, and reliable experience for these applications and their end-users.</p><p>Since these applications could be running in multiple clusters across cloud providers or customers’ edge locations, our platform team had to build a distributed control plane and a PaaS service to deploy, secure, and operate multiple multi-tenant Kubernetes clusters. This distributed control plane has delivered many operational, scaling, and performance benefits that we will cover in our <a href="https://speakerdeck.com/pupapaik/managing-thousands-of-edge-k8s-clusters-with-gitops">presentation</a> (<a href="https://youtu.be/tw6O2nigVTk?t=5880">video link</a>) — e.g. how to manage thousands of edge K8s clusters with GitOps — and also as a separate blog post in the coming weeks.</p><h3>TL;DR (Summary)</h3><ol><li>We could not find a simple to use solution in the market that could solve the problem of deploying, securing, and operating multiple application clusters that are distributed across cloud providers, private clouds or multiple edge locations.</li><li>We could not find a robust Kubernetes distribution or PaaS (eg. OpenShift, Cloud Foundry, etc) that provided a comprehensive set of security and operational services needed for distributed clusters — for example PKI-based identity, RBAC and user-access management, secrets and key management across cloud providers, multi-cluster service mesh, observability and audit logs, or application and network security.</li><li>Anthos (Google), Azure Arc (Microsoft), and Rancher are multi-cluster management stations and packaging of multiple different services; our analysis was that these would not have solved the operational, scaling, security, and multi-tenancy requirements that we had for application and infrastructure services across multiple clusters.</li><li>We had to build our own distributed control plane for our managed PaaS that is built on top of Kubernetes. We started with vanilla Kubernetes and then made significant changes to deliver platform services needed by our DevOps and SRE teams. In addition, we had to build a control plane to manage large numbers of distributed clusters and deliver multi-tenancy across heterogeneous infrastructure (in edge, our network, and multiple cloud providers).</li></ol><h3>Kubernetes for App Management: Why &amp; How</h3><p>We chose Kubernetes (K8s) to be the core of our platform for managing distributed applications as it provides a rich set of functionality without being overly prescriptive — giving us flexibility on innovating on things that we believe matter to our customers. We used this as a foundation on which to start building our service and with the growing popularity of K8s, it is also easier to find developers and operators who are familiar with it.</p><p>That said, deploying and managing a large number of production-grade Kubernetes clusters across a hybrid environment (multiple clouds, network POPs, and edge locations) is not very easy as there are no out-of-the-box solutions for Kubernetes that can:</p><ol><li>Harmonize heterogeneous infrastructure resources with automated clustering, scaling, and zero-touch provisioning; this was especially painful at the edge and in our network PoPs</li><li>Provide high-performance and reliable connectivity across disparate locations — especially when crossing cloud providers and coming from edge locations</li><li>Solve the security problem of data-in-transit, data-at-rest, secrets, keys and network…all backed by a uniform PKI identity that works across edge, network and cloud</li><li>Provide true multi-tenancy — tenant isolation and security guarantees — with the ability to run production and development workloads for internal and customer needs on the same clusters</li><li>Provide observability and operations across distributed clusters that ties into centralized policy and intent, without the need for building complex logs and metrics collection</li></ol><p>After several proofs-of-concept with multiple cloud providers and open-source platforms like GKE, AKS, EKS, and RKE as well as OpenShift and Cloud Foundry — we realized that none of them could meet all of the five requirements above. As a result, we decided to build our own PaaS — starting with “vanilla” Kubernetes and made several additions — for identity, networking, security, multi-tenancy, logging, metrics, etc. While we use Kubernetes to meet our internal needs, we had to make some hard decisions like not exposing these Kubernetes clusters directly to our internal users and/or customers to run their workloads (more on that later, as multi-tenancy was a key objective for us).</p><p>In addition to multiple new features that we needed to add, there was also a need to run our workloads/services alongside customer workloads in many locations across the edge, our network, and public/private clouds. This meant that we had to build additional capabilities to manage multiple clusters in multiple environments…all connected using our global network and our distributed application gateways to provide zero-trust and application-level connectivity across these clusters.</p><h3>The Hard Part: Multi-Tenancy and Multi-Cluster for Kubernetes</h3><p>Building and operating applications running in a single Kubernetes cluster is a non-trivial task, even if consuming a cloud provider-managed cluster. This is why it is common for DevOps and SRE teams to minimize their overhead and not deal with the complexities of many clusters. It is quite common to see teams build one large Kubernetes cluster and put all types of resources within the same cluster. While this seems great because they can simplify operations and run the cluster for maximal compute efficiency and cost, this is not the best idea for several reasons. First, the needs for production workloads are very different from dev-test and from staging — unstable development workloads can potentially cause problems for more stable production workloads.</p><p>In addition to the needs of varied workloads, K8s security and isolation limitations is another driver for multi-cluster. A typical approach to solve for K8s security and resource isolation is to spin-up independent clusters for each tenant using a multi-tenant model. While this may be feasible to do in the cloud, it is not possible at the edge to run multiple clusters. Edge sites have compute and storage resource limitations and constrained network bandwidth to send logs and metrics for each additional cluster to the central cloud.</p><p>To deal with the problem of multiple Kubernetes clusters, we evaluated Rancher for centralized management of our Kubernetes clusters (when we started, Anthos and Azure Arc did not exist) and KubeFed. The two approaches available at that time were (and still the same situation today):</p><ol><li>Multi-cluster management (eg. Rancher) from a central console would have given us the ability to deploy multiple clusters in any location and perform lifecycle management operations like upgrades, rollback, etc. Some of these systems also gave the ability to address an individual cluster with automation for configuration and deployment of applications</li><li>Another approach is to deploy a Kubernetes cluster federation (KubeFed) control plane and it can make multiple physical clusters look like one cluster. This project was just getting started at the time we looked and even today is only in alpha stage.</li></ol><p>After the recent announcement of GCP Anthos and Azure Arc, we re-evaluated our original decision to build a distributed control plane and the conclusion was that even these two new offerings could not have solved two critical problems with distributed clusters. These two key capabilities that we needed for our platform were:</p><ol><li>Managing multiple clusters as-a-fleet to solve the problem of performing operations across all or a logical group of clusters — operations like configuration, deployment, metrics, etc. This is critical as we want to reduce operations overhead for our SRE teams, improve debug-ability for our DevOps, and improve the scalability of our system</li><li>Ability to carve up an individual physical Kubernetes cluster for multi-tenancy without needing to spin up physical clusters — this is especially critical in resource-constrained environments where we don’t want to add new physical clusters just for multi-tenancy</li></ol><p>To solve these two problems, we had to come up with a new technique — <strong>distributed control plane</strong> — to solve the operational overhead of “multiple” clusters and provide an equivalent of “multiple clusters” for multi-tenancy in resource-constrained environments.</p><h3>Distributed Control Plane: How We Achieved Multi-Cluster Kubernetes</h3><p>Our platform team decided to build a distributed control plane for Kubernetes that exposes Kubernetes APIs for our team’s use, however, these APIs are coming from “virtual” clusters that only exist in our control plane — a virtual K8s (vK8s) API server for a virtual K8s cluster (as shown in <strong>Figure 1</strong>). This control plane maps the intent of the user to multiple physical Kubernetes clusters running in our edge, our network POPs, and public cloud locations. These physical clusters are only accessible to our distributed control plane, and not to any individual tenant/user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBqfwkdJVk-PiKjionkZwQ.png" /><figcaption>Figure 1: Distributed Control Plane</figcaption></figure><p>This control plane provides each tenant with one or more “virtual” application clusters where they can deploy their application(s) and based on configuration, the control plane will replicate and manage it across multiple physical Kubernetes clusters. In addition to configuration and deployment operations, monitoring operations also follows this “virtual” cluster without the need to build tooling to collect and dissect data from multiple physical clusters.</p><p>Let’s take a sample UI application called productpage, where user intent is to run it distributed across 3 locations — pa2-par, ny8-nyc and ams9-ams with 2 replicas in each of them. As the user creates a vK8s object and attaches it to a virtual cluster, which immediately provisions a vK8s API server that can be used with standard kubectl.</p><p>As the next step, the user downloads the kubeconfig for this virtual cluster and creates standard yaml to describe a K8s deployment for productpage.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5f19b46d0eaa259da34422d47ae556e/href">https://medium.com/media/c5f19b46d0eaa259da34422d47ae556e/href</a></iframe><p>Following the creation of deployment spec, the user can proceed to create a deployment on this virtual cluster:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fe1e365ea2f62fe250e5ac847794f2c/href">https://medium.com/media/2fe1e365ea2f62fe250e5ac847794f2c/href</a></iframe><p>Now if the user checks his deployment he sees 6 replicas has been started with 2 in each location (pa2-par, ny8-nyc and ams9-ams).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f95370563908783164044200d5276b37/href">https://medium.com/media/f95370563908783164044200d5276b37/href</a></iframe><p>The following output shows 2 pods running in each location with mapping to particular physical node</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/368dc708ee1037a16dd47196cccf39f4/href">https://medium.com/media/368dc708ee1037a16dd47196cccf39f4/href</a></iframe><p>This simple example demonstrates how trivial it is to get multi-cluster replication of any app in minutes without any installation and management burden. In addition to mapping the intent, the distributed control plane also delivers observability for the virtual cluster and not on an individual cluster basis.</p><h3>Distributed Control and Centralized Management for Multi-Tenancy</h3><p>As you can see in <strong>Figure 2</strong>, our centralized management plane is running across two public cloud providers (one region each) — one in AWS and one in Azure (for redundancy). This management plane allows our SRE to create tenants with hard multi-tenancy — e.g. a development team working on our VoltMesh service can be a tenant and a customer solutions team working on customer POCs can be its own tenant with its own set of users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6UOLYw_rFniMirvnZwcCg.png" /><figcaption>Figure 2: Multi-Tenancy and Multi-Cluster</figcaption></figure><p>Each of these tenants can create many namespaces and assign a group of users to collaborate on these namespaces. These namespaces are not Kubernetes namespaces — they are an isolation boundary in our platform with RBAC rules and IAM policies for users.</p><p>When a user within a namespace wants to create an application cluster, they create a vK8s object and that in-turn creates a vK8s API server in our management plane. Using this vK8s object, the user can create deployments, stateful sets, PVCs, etc and the control plane will ensure that these operations happen on one or many physical clusters, based on sites that are associated with the vK8s object.</p><p>Since each tenant and user is using standard K8s operations without any modifications, it allows the system to be compatible with a number of tools that are popular with operators — e.g. Spinnaker, Helm, Jenkins, etc.</p><h3>Gains Realized from a Distributed Control Plane</h3><p>The big advantage of a distributed control plane is that it has solved the operational overhead for our SRE and DevOps teams. They can now perform operations (configuration, deployment, monitoring, policy, etc) across a virtual cluster and the control plane will automatically map it across multiple physical clusters. In addition to operational simplification for multiple clusters, the control plane has also solved the security and isolation problem for multi-tenancy.</p><p>This distributed control plane has also improved the productivity of developers that want to add new features to our platform — they don’t have to build new automation every time they add new features that impact configuration or operations across multiple clusters. They use the intent-based configuration model and the control plane knows what needs to be done. In addition, they can continue to interact with this distributed and multiple cluster object — virtual kubernetes — using kubectl and not yet another CLI.</p><p>After running this in our dev-test, staging, and production environments for more than a year now, we realized that this globally distributed control plane (running in our network POPs) also provides significant scale, performance and reliability advantages — something that we had not completely imagined during our early days. We will cover this finding in our upcoming KubeCon presentation and as a separate blog post in the coming weeks.</p><h3>To be continued…</h3><p>This series of blogs will cover various aspects of what it took for us to build and operate our globally-distributed SaaS service with many application clusters in the public cloud, our private network PoPs, and edge sites. Next up is <a href="https://medium.com/volterra-io/global-service-mesh-for-distributed-applications-a487ffe50abc?">Global Service Mesh for Distributed Apps</a>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e20a82acd6d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/volterra-io/control-plane-for-distributed-kubernetes-paas-e20a82acd6d3">Control Plane for Distributed Kubernetes PaaS</a> was originally published in <a href="https://medium.com/volterra-io">volterra.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>