<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ray Edwards</title>
    <description>The latest articles on DEV Community by Ray Edwards (@rayedwards).</description>
    <link>https://dev.to/rayedwards</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1172691%2Ff27cfe76-8f2a-452b-b7df-82efe4b9d29c.png</url>
      <title>DEV Community: Ray Edwards</title>
      <link>https://dev.to/rayedwards</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rayedwards"/>
    <language>en</language>
    <item>
      <title>7 Considerations for Multi-Cluster Kubernetes</title>
      <dc:creator>Ray Edwards</dc:creator>
      <pubDate>Tue, 16 Jan 2024 21:06:01 +0000</pubDate>
      <link>https://dev.to/rayedwards/7-considerations-for-multi-cluster-kubernetes-44gb</link>
      <guid>https://dev.to/rayedwards/7-considerations-for-multi-cluster-kubernetes-44gb</guid>
      <description>&lt;p&gt;In the IT space today, customers often intermix Multi Cloud and Hybrid Cloud terms without necessarily understanding the distinction between them.&lt;/p&gt;

&lt;p&gt;A hybrid cloud is a cloud computing environment that combines public and private (typically on-premise) clouds, allowing organizations to utilize the benefits of both. In a hybrid cloud, an organization can store and process critical data and applications in its private cloud, while using the public cloud for non-sensitive data, such as testing and development.&lt;/p&gt;

&lt;p&gt;The hybrid cloud model is becoming increasingly popular among organizations because it enables them to optimize their IT infrastructure, while keeping costs under control. Additionally, hybrid cloud environments can provide a more seamless and integrated user experience, with the ability to move workloads between public and private clouds based on business needs.&lt;/p&gt;

&lt;p&gt;Multi-cloud on the other hand, is a setup that involves the use of multiple cloud computing platforms from different vendors. This approach enables organizations to use the best cloud services and features from different providers to create a more optimized and customized IT environment.&lt;/p&gt;

&lt;p&gt;Both these approaches provide IT groups with flexibility and certain benefits.&lt;/p&gt;

&lt;p&gt;In a multi-cloud environment, an organization can leverage the strengths of different cloud providers, such as AWS, Azure, Google Cloud, and others, to achieve a range of benefits such as increased scalability, flexibility, resilience, and cost-effectiveness. Multi-cloud also enables businesses to avoid vendor lock-in and achieve greater redundancy, as data and applications can be distributed across multiple cloud platforms.&lt;/p&gt;

&lt;p&gt;Hybrid cloud for its part, enables businesses to have greater flexibility in their IT infrastructure, allowing them to leverage the scalability and cost-effectiveness of the public cloud for non-critical workloads, while keeping sensitive data and applications within their own private cloud, which provides greater control, security, and compliance.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Google Internet searches of Hybrid Cloud and Multi Cloud&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1i5j2cvv40wdgcf3u2p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1i5j2cvv40wdgcf3u2p.png" alt="Google Searches"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hybrid Cloud and Multi Cloud adoption is growing rapidly. Flexera 2023 State of the Cloud Report highlights the fact that a vast majority of enterprises have adopted a hybrid cloud model, and almost 87% have a Multi Cloud approach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1l4k369s74o7vwbqodh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1l4k369s74o7vwbqodh.png" alt="flexera report"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While both of these approaches have inherent benefits, this blog raises a number of challenges that organizations should consider in advance, along with some possible solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Complexity of Cloud Orchestration&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Managing multiple cloud environments, each with its own unique nuances, is a significant challenge. Even Kubernetes, which was envisioned as a way to abstract away from infrastructure dependency, is implemented differently by different cloud providers. EKS, AKS, Rancher, Mirantis Tanzu, Openshift are only a few of the major distributions of Kubernetes (and managed Kubernetes) that IT leaders have to contend with. Each one has some specific configuration that presents a challenge when moving workload from one platform to another. Even if one decides to deploy the same distribution, say a private Rancher cluster, onto all the platforms, the end result is the headache of now having to get into business of managing Kubernetes platforms across providers. You could farm that role out to one of the multi-cloud management providers, but they too have their own deficiencies.&lt;/p&gt;

&lt;p&gt;This approach also shifts dependence from one vendor to another, but nevertheless, presents the very reason to move to multi-cloud, that of avoiding a single vendor lock-in.&lt;/p&gt;

&lt;p&gt;A novel approach that is emerging, and something that IT leaders should consider is the idea of virtualizing applications themselves. By virtualizing or isolating at the application or microservice (namespace) level; users free themselves from the underlying platform, or even Kubernetes distribution, and can instead run the application or microservice seamlessly anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Interoperability&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Aside from the orchestration itself, IT managers must also contend with application interoperability across their deployments. This is where the cloud provider’s interest and the customers interest don’t always align.&lt;/p&gt;

&lt;p&gt;AWS for example, wants to provide a service to its customers as the most cost effective and efficient way possible. They will frequently customize the service, say a Redis database, to run efficiently on AWS infrastructure. This hyper-customization can provide a competitive advantage to AWS vs. other platform but also has a downside.&lt;/p&gt;

&lt;p&gt;Customers who deploy on this hyper-customized version on Redis may find that their database is no longer easily ported out to say Azure cache (Azure’s deployment of Redis). Once again, the customer may find themselves back where they started - ie locked in to a specific provider.&lt;/p&gt;

&lt;p&gt;So the challenge the customers must solve is how to ensure data applications in different cloud environments be distributed and synchronized?&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Data Portability&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;There is another nasty little surprise that hits some customers when it comes to their data. Cloud providers make it fairly easy to upload data into their platform, most times with no extra fees, but if a customer wants to move data out of the platform, they can get hit with hefty ‘data egress’ fees. This ‘data tax’ can be quite expensive depending on the amount of data that is moved out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuul4tbqbzotabub16xnv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuul4tbqbzotabub16xnv.png" alt="data egress fees"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is better known as the “Hotel California Effect” [ You can checkout anytime you want, but you can never leave]&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Security &amp;amp; Governance&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Of course, security and governance concern is paramount to any application deployment. The situation is compounded manyfold when leaders have to plan for hybrid cloud and multi cloud deployments.&lt;/p&gt;

&lt;p&gt;A thorough discussion around security and governance for hybrid cloud and multi-cloud deployments will be covered in a future blog, but for now customers should consider a few items as essential to ensure success.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encryption of all traffic&lt;/li&gt;
&lt;li&gt;Monitoring and audits of clusters and nodes&lt;/li&gt;
&lt;li&gt;Locking down and security end-points&lt;/li&gt;
&lt;li&gt;Vulnerability scanning and regular patching&lt;/li&gt;
&lt;li&gt;Enforce zero Trust security posture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The steps above help provide security at the platform level or at the cluster level but practitioners need to pay particular attention to individual application level security issues.&lt;/p&gt;

&lt;p&gt;Since a single cluster may host many applications, it will also likely have multiple namespaces set up within the cluster. Each application may have its own set of security policies and user access that need to be enforced. Tools such as Kubeslice are indispensable for this, by allowing managers to set namespace level policies and propagate these seamlessly across all platforms where the slice (namespace) is running.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resource Optimization&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One major reason companies cloud deployments is to reduce operating costs; by reducing or eliminating on-premises infrastructure. But a multi-cloud environment can easily become a costly exercise without effective management.&lt;/p&gt;

&lt;p&gt;My previous blog covered cost optimization considerations for Kubernetes clusters in depth. In Multi Cloud environments, customers may find that a single autoscaling process does not work the same way for every cloud vendor. This is yet another reason to consider an automated tool such as SmartScaler. In addition to right sizing the Kubernetes deployments, SmartScaler utilizes Reinforced Learning to understand the specific characteristics of each cloud provider’s autoscaling process and optimizes the deployment accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Talent shortage&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;One reason enterprises are hesitant about hybrid cloud or multi cloud setups is the lack of skills in such projects. There is dearth of architects who have the expertise and deep know how to properly manage and run multicloud or hybrid environments. Business leaders have to find and retain these practitioners before embarking on a hybrid journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resiliency&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It is rather surprising how many businesses migrate workloads to the cloud without really planning for resiliency. Any simple search will provide multiple instances where one of the major cloud providers suffered outages that impacted businesses. Simply putting one's trust in the distributed cloud instance does not protect an application. Businesses should implement a resiliency strategy that includes load balancers that route traffic to an active cluster seamlessly in cases of failure.&lt;/p&gt;

&lt;p&gt;Since cloud vendors are not going to encourage workloads to be routed to a competitor, IT leaders should implement solutions such as Kubeslice that abstracts the workload from the underlying infrastructure, ensuring the specific application is always available via intelligent routing.&lt;/p&gt;

&lt;p&gt;It is also important not to over engineer resiliency to the other extreme.          \&lt;br&gt;
Some IT leaders leave it to the individual application teams to craft their own disaster recovery strategy. This can lead to multiple conflicting DR setups which in turn introduce more complexity into the environment.&lt;/p&gt;

&lt;p&gt;At an enterprise level, businesses should adopt a Cloud Native Disaster Recovery strategy that provides a baseline for Kubernetes applications and databases, and allow individual teams to tweak it to their specific needs.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
   &lt;td&gt;
&lt;strong&gt;Focus Items&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;strong&gt;Traditional Disaster Recovery approach&lt;/strong&gt;
   &lt;/td&gt;
   &lt;td&gt;
&lt;strong&gt;Cloud Native Disaster Recovery approach&lt;/strong&gt;
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Failure detection and trigger
   &lt;/td&gt;
   &lt;td&gt;Human
   &lt;/td&gt;
   &lt;td&gt;Fully autonomous
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;DR actions / Procedure
   &lt;/td&gt;
   &lt;td&gt;A mixture of human action and automation
   &lt;/td&gt;
   &lt;td&gt;Fully Automated
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Recovery Time Objective (RTO)
   &lt;/td&gt;
   &lt;td&gt;From Minutes to hours
   &lt;/td&gt;
   &lt;td&gt;Near zero
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Recovery Point Objective (RPO)
   &lt;/td&gt;
   &lt;td&gt;From zero to hours
   &lt;/td&gt;
   &lt;td&gt;Zero
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Process Owner
   &lt;/td&gt;
   &lt;td&gt;Mostly Storage team
   &lt;/td&gt;
   &lt;td&gt;Application itself / team
   &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Technical components
   &lt;/td&gt;
   &lt;td&gt;From Storage products (backups, volume, sync)
   &lt;/td&gt;
   &lt;td&gt;From Networking products, (east west communication, global load balancer)       
&lt;p&gt;
&lt;em&gt;[Note: Kubeslice enables adoption of this approach for all K8s apps]&lt;/em&gt;
   &lt;/p&gt;
&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>kubernetes</category>
      <category>cloud</category>
      <category>devops</category>
      <category>data</category>
    </item>
    <item>
      <title>Kubernetes resiliency (RTO/RPO) in Multi-Cluster deployments</title>
      <dc:creator>Ray Edwards</dc:creator>
      <pubDate>Thu, 07 Dec 2023 21:24:39 +0000</pubDate>
      <link>https://dev.to/rayedwards/kubernetes-resiliency-rtorpo-in-multi-cluster-deployments-32be</link>
      <guid>https://dev.to/rayedwards/kubernetes-resiliency-rtorpo-in-multi-cluster-deployments-32be</guid>
      <description>&lt;p&gt;Ah Kubernetes! The panacea to all our DevOps challenges.&lt;/p&gt;

&lt;p&gt;Kubernetes is the open source container orchestration tool that was supposed to speed up software delivery, secure our applications, lower our costs and reduce our headaches, right?&lt;/p&gt;

&lt;p&gt;Seriously though, Kubernetes has revolutionized how we write and deliver software. And with the proliferation of EKS, AKS, GKE, Red Hat OpenShift, Rancher and K3s, Kubernetes has truly won the container orchestration battle. As we expand our applications, cloud platforms, and data, we start to identify areas where Kubernetes is not quite fulfilling the requirements for security and ease of use. Therefore, we need to find ways to help Kubernetes in order to keep up with our growth.&lt;/p&gt;

&lt;p&gt;Kubernetes practitioners have turned to third-party tools for networking, security, and resiliency for stateful apps. This helps to make their deployments more reliable.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll delve a little deeper into data resiliency for Kubernetes apps.&lt;/p&gt;

&lt;p&gt;Kubernetes was designed to solve the challenges of application orchestration - the assumption is that Kubernetes nodes are ephemeral. In reality however, applications do consume and/or produce data. This is referred to as StatefulSets in Kubernetes. Additionally, Kubernetes objects, CRDs, artifacts etc are all details that need to be available in cases of cluster failure - hence the realization that even Kubernetes deployments need a DR strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Rise of StatefulSets&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;StatefulSets are designed to handle stateful workloads that require unique network identifiers and stable storage. Each instance of Databases, message queues, or distributed file systems, typically requires stable network identity and persistent storage. StatefulSets address this challenge by providing ordered, unique network identifiers and persistent storage for each pod in the set. There are of course a large contingent of Kubernetes storage deployments that rely on static volume attachments of course, but they do not have the horizontal scaling capabilities, and thus are not part of this blog discussion for now.&lt;/p&gt;

&lt;p&gt;In addition to providing uniqueIDs and scaling, StatefulSets provide the ability to mount persistent volumes to each pod. This allows stateful applications to store and access data that persists across pod restarts or rescheduling. Each pod in a StatefulSet receives its own unique persistent volume, enabling data locality and minimizing the impact on other pods.&lt;/p&gt;

&lt;p&gt;The Container Storage Interface (CSI) standard is the most widely used API standard. It enables containerized workloads in Kubernetes to access any block or file storage system. Released at the end of 2019, the Container Storage Interface driver with snapshot opened the doors to StatefulSets. See &lt;a href="https://kubernetes-csi.github.io/docs/introduction.html" rel="noopener noreferrer"&gt;Kubernetes CSI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Cloud Native Computing Foundation (CNCF) framework includes various projects to meet the storage requirements of Kubernetes. However, practitioners must be knowledgeable in storage fundamentals. This is not a skill usually associated with DevOps.&lt;/p&gt;

&lt;p&gt;Companies like&lt;a href="https://portworx.com/" rel="noopener noreferrer"&gt; Portworx by Pure&lt;/a&gt;,&lt;a href="https://www.rancher.com/products/longhorn" rel="noopener noreferrer"&gt; Rancher Longhorn&lt;/a&gt; , &lt;a href="https://rook.io/" rel="noopener noreferrer"&gt;Rook &lt;/a&gt;and &lt;a href="https://linbit.com/kubernetes/" rel="noopener noreferrer"&gt;LINBIT &lt;/a&gt;are setting a new standard for container storage. (in addition to vendor offerings from &lt;a href="https://www.netapp.com/cloud-services/astra/" rel="noopener noreferrer"&gt;NetApp &lt;/a&gt;and &lt;a href="https://www.hpe.com/us/en/storage/containers.html" rel="noopener noreferrer"&gt;HPE&lt;/a&gt;). They are providing several enterprise features to make container storage more efficient.&lt;/p&gt;

&lt;p&gt;With that background, we turn to the considerations for Multi-cluster database resiliency in Kubernetes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Single Cluster Apps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For applications running in a single cluster, Kubernetes (together with the CSI storage component) provide a feature for volume replication. Each persistent volume can be set to have a number of replica copies (typically 3) locally.&lt;/p&gt;

&lt;p&gt;Kubernetes will take action if a node fails. It will restart the service on a new node and attach it to a replicated version of the volume. This helps to prevent data loss. (Setting aside static CSI or NFS drivers for now)&lt;/p&gt;

&lt;p&gt;For tools that replicate data locally, the data is copied synchronously, as it is a single local cluster. Restarting the node is done instantly with the Kubernetes control plane. Therefore, the recovery time is considered zero.&lt;/p&gt;

&lt;p&gt;From a recovery point of view, this is considered to be ZERO Recovery Time Objective (RTO). The Recovery Point Objective (RPO) may also be ZERO in this case, but this of course would depend on mitigating for data corruption, journaling etc.&lt;/p&gt;

&lt;p&gt;Zooming out to complex environments reveals a murkier picture. These environments include clusters that span multiple clusters, platforms, and even cloud providers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Multi-cluster database resiliency&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Understanding the why and how of Multi Cluster Kubernetes can be difficult. Fortunately, &lt;a href="https://traefik.io/glossary/understanding-multi-cluster-kubernetes/" rel="noopener noreferrer"&gt;this article by our friends at Traefiklabs &lt;/a&gt;provides a clear explanation of Kubernetes Multi Clusters in detail.&lt;/p&gt;

&lt;p&gt;The architecture of a multi cluster Kubernetes is depicted in the diagram below :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4dew9xr7rtlciyhxifna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4dew9xr7rtlciyhxifna.png" alt="multi cluster Kubernetes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is pertinent in our discussions is the traffic route between these clusters. From a user perspective, application requests are routed to their US cluster or EU cluster by the global load balancer.&lt;/p&gt;

&lt;p&gt;What happens when a pod from Node 1 in US-Cluster needs to communicate to Node 1 on the EU-Cluster? This could present a challenge due to the distance and complexity between the two clusters. At a minimum, data must travel through at least two network boundaries, exiting the US cluster, crossing the Atlantic, and entering the EU cluster.&lt;/p&gt;

&lt;p&gt;This network traffic flow between a local network and external networks is referred to as North South traffic. "North" refers to outbound traffic from the local network to external networks. "South" refers to inbound traffic from external networks to the local network.&lt;/p&gt;

&lt;p&gt;From a data plane perspective, the North/South traffic between clusters introduces a higher level of latency and reduced reliability when compared to traffic within a local cluster. Whereas traffic within a cluster is synchronous (fast, reliable) ; traffic between remote clusters is thus asynchronous (slower, less reliable).&lt;/p&gt;

&lt;p&gt;For those wishing to learn more about synchronous and asynchronous traffic may want to review this &lt;a href="https://www.holloway.com/g/remote-work/sections/synchronous-vs-asynchronous-communication" rel="noopener noreferrer"&gt;article&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How does North/South traffic and synch/asynchronous communications relate back to Kubernetes Multi-cluster database resiliency?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A CSI storage connector in Kubernetes uses synchronous communication for traffic within a local cluster. This means that data is written simultaneously to the primary and replica data volumes.&lt;/p&gt;

&lt;p&gt;Data for remote clusters is written locally first. Then, a snapshot copy of the data is shipped to the second cluster on a regular schedule. This is done asynchronously.&lt;/p&gt;

&lt;p&gt;This difference in approach also has implications for data resiliency and how data is recovered after a failure.&lt;/p&gt;

&lt;p&gt;Kubernetes recovery in a disaster recovery scenario within a local cluster is instantaneous. This is due to data being simultaneously copied to the local replica. As a result, data availability is also instantaneous.&lt;/p&gt;

&lt;p&gt;In technical terms, there are two metrics that we track. Recovery Time Objective (RTO) is the time it takes to recover from a failure. Recovery Point Objective (RPO) is the maximum allowable data loss.&lt;/p&gt;

&lt;p&gt;Thus, DR within a local Kubernetes cluster can be said to have Zero RPO / Zero RTO&lt;/p&gt;

&lt;p&gt;(For an insightful discussion about RPO and RTO considerations in Kubernetes, I highly recommend this post by &lt;a href="https://medium.com/@bijit211987/approaching-zero-rto-rpo-architectural-considerations-and-best-practices-3848e7252894" rel="noopener noreferrer"&gt;Bijit Ghosh&lt;/a&gt; and another one by &lt;a href="https://www.linkedin.com/pulse/data-protection-kubernetes-matt-leblanc/" rel="noopener noreferrer"&gt;Matt LeBlanc&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;In a remote cluster situation however, the picture is somewhat different. When assessing a multi-platform or multi-cloud application, a Cloud Architect or SRE should consider how asynchronous replication impacts the Recovery Time Objective (RTO). Shipping the replica copy, traveling North/South and restoring it on the active cluster at the recovery site all take time. This means that DR operations have a time lag.&lt;/p&gt;

&lt;p&gt;This time lag can be significant. Conservative estimates show that CSI solutions can reduce the RTO to 15 minutes. This means we can have a RPO of zero and a RTO of 15.&lt;/p&gt;

&lt;p&gt;Most DevOps teams and Cloud Architects focus on single cluster, single region and single platform deployments. They may not consider DR architectures and requirements. As a result, many early adopters may be satisfied with an RTO of 15 minutes.&lt;/p&gt;

&lt;p&gt;Traditional infrastructure architects and data owners may want to explore new solutions on the market. These solutions can help them reach a close-to-zero recovery time objective and disaster recovery across multiple Kubernetes platforms.&lt;/p&gt;

&lt;p&gt;Tools such as &lt;a href="https://kubeslice.io/documentation/open-source/1.0.0" rel="noopener noreferrer"&gt;KubeSlice &lt;/a&gt;can lower RTO thresholds by establishing a low latency data plane interconnect between multiple clusters or platforms. This helps to enable faster recovery for Kubernetes applications and data.&lt;/p&gt;

&lt;p&gt;KubeSlice converts North/South traffic into East-West network traffic via application level virtualization across a secure/encrypted connection, thereby eliminating the need to traverse network boundaries. This creates a lower latency connection for the data plane, and enables **synchronous **replication of data to the DR site.&lt;/p&gt;

&lt;p&gt;KubeSlice makes the remote cluster seem local to the primary cluster. This enables recovery that is close to having Zero Recovery Time Objective (RTO).&lt;/p&gt;

&lt;p&gt;Regardless of which recovery scheme is employed, application owners should carefully consider their application and data resiliency needs and plan accordingly.&lt;/p&gt;

&lt;p&gt;As the &lt;a href="https://dok.community/data-on-kubernetes-2022-report/" rel="noopener noreferrer"&gt;Data on Kubernetes&lt;/a&gt; report points out, a full one-third of organizations saw productivity increase twofold by deploying data on Kubernetes, with gains benefiting organizations at all levels of tech maturity. Kubernetes Zero RTO resiliency in MultiCluster deployments&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Summary&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Container Storage Interface (CSI) standard and projects like Portworx and Rancher Longhorn are a great start towards a Software Defined Storage approach for Kubernetes persistent apps.&lt;/p&gt;

&lt;p&gt;The article explores Multi-cluster database resiliency in Kubernetes, starting with the resiliency of single-cluster applications. It explains how Kubernetes handles volume replication in case of node failures, ensuring zero recovery point objective (RPO) and zero recovery time objective (RTO) within a single cluster. However, the complexity arises when dealing with multi-cluster environments spanning multiple platforms and cloud providers. The challenges of North/South traffic and asynchronous communication between remote clusters are discussed, and the implications for data resiliency and recovery in disaster scenarios are explained.&lt;/p&gt;

&lt;p&gt;The article introduces KubeSlice as a tool that can lower RTO thresholds by establishing a low latency data plane interconnect between multiple clusters or platforms. It converts North/South traffic into East-West network traffic, enabling faster recovery for Kubernetes applications and synchronous replication of data to the disaster recovery (DR) site. The importance of carefully considering application and data resiliency needs is emphasized, and the benefits of deploying data on Kubernetes are mentioned.&lt;/p&gt;

&lt;p&gt;Overall, the article focuses on the challenges and solutions related to data resiliency in Kubernetes, particularly in multi-cluster deployments, and highlights the role of tools like KubeSlice in achieving faster recovery times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Credits:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/michael-courcy/" rel="noopener noreferrer"&gt;Michael Courcy&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/technicalwritertau/" rel="noopener noreferrer"&gt;Tau M.&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/brendanpascale/" rel="noopener noreferrer"&gt;Brendan Pascale&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/michaellevan/" rel="noopener noreferrer"&gt;Michael Levan&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cloud</category>
      <category>deployment</category>
    </item>
    <item>
      <title>7 Common mistakes in a Multi-Cloud Journey</title>
      <dc:creator>Ray Edwards</dc:creator>
      <pubDate>Fri, 17 Nov 2023 16:00:00 +0000</pubDate>
      <link>https://dev.to/rayedwards/7-common-mistakes-in-a-multi-cloud-journey-lo9</link>
      <guid>https://dev.to/rayedwards/7-common-mistakes-in-a-multi-cloud-journey-lo9</guid>
      <description>&lt;p&gt;Your executive leadership launched a ‘Cloud First’ strategy with much fanfare a few months ago. At first it was simple and seemed inexpensive to move workloads to your primary cloud service provider. But now, you feel the cloud provider is taking you for granted - you’ve lost all price negotiation power, and SLAs and response levels are not what it used to be. To make matters worse, your new cloud service bill seems to be out of control.&lt;/p&gt;

&lt;p&gt;You are confronted with what is known as the “Cloud Paradox” - the very benefits that made the move to the cloud as a compelling strategy are now causing costs to spiral, stifling innovation and making it near impossible to repatriate workload from the cloud.&lt;/p&gt;

&lt;p&gt;Most large enterprises have started cloud adoption and now find themselves in the trough of cloud paradox where their cloud bills are starting to bite. They are facing margin pressures of their cloud infrastructure. Trying to optimize cloud costs in turn is reducing their ability to innovate freely.&lt;/p&gt;

&lt;p&gt;The folks at &lt;a href="https://www.azul.com/"&gt;Azul Systems&lt;/a&gt; have published a very interesting Cloud Adoption Journey chart that highlights the technology maturity curve as customers adopt cloud platforms. Similar in concept to the Gartner Hype cycle, technology leaders have to be mindful of the various challenges and pitfalls of cloud adoption before they can truly realize the value optimization of cloud computing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1NkuKzwx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zenb3t6hjivgir6t6euz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1NkuKzwx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zenb3t6hjivgir6t6euz.png" alt="Image description" width="500" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For those that find themselves in the trough of the journey, and are thinking of ways to maintain control of your cloud strategy; and break out of the cloud paradox, you are not alone.&lt;/p&gt;

&lt;p&gt;Here, I will share several initiatives that can help IT leaders avoid getting stuck in the Cloud Paradox, and move further along the curve. Only then can enterprises realize the true benefits of cloud adoption all while optimizing their cloud spend.&lt;/p&gt;

&lt;p&gt;Before we delve into that however, it is useful to understand why a Multi-Cloud deployment may be a worthwhile strategy in the first place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guard against Vendor Lock In&lt;/strong&gt;&lt;br&gt;
The number one reason business leaders consider a Multi-vendor multi-cloud adoption is to avoid putting all their ‘eggs’ into one basket. Amazon, Azure, GCP and others continue to enhance their cloud services and any enterprise that wants to stay at the forefront of technology improvements needs the flexibility to utilize the platform that best suits their needs. Not to mention the obvious loss of negotiation power when one is beholden to any single cloud provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compliance and Data sovereignty&lt;/strong&gt;&lt;br&gt;
Companies doing business globally may be subject to rules and regulations that require customer data to be located in a particular region or country. The flexibility to choose a vendor that enables such data localization is another essential reason for a multi-cloud approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Workload specialization and costs&lt;/strong&gt;&lt;br&gt;
As mentioned earlier, cloud providers continue to offer specializations for workloads and features that may address the specific needs of a particular application. For example, AWS may offer some advances in ML application but your IOT application may be most suited to a GCP set of enhancements. Having a multi-cloud approach ensures you are able to optimize an application based on need and costs as appropriate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forestall Data Gravity challenges&lt;/strong&gt;&lt;br&gt;
The idea of data gravity was first coined by &lt;a href="https://www.linkedin.com/in/davemccrory/"&gt;Dave McCrory&lt;/a&gt; in 2010. His view was that once data is stored anywhere, it starts to “grow” in size and quantity. That mass attracts services and applications, because the closer they are to the data, the lower the latency and better the throughput. The resulting challenge is that as the data gravity increases, it becomes almost impossible to migrate that data to a different platform. What results is ‘artificial data gravity’ where data is centralized not because of any benefits or requirements, but rather because it is too difficult to do otherwise.&lt;/p&gt;

&lt;p&gt;By deploying a “multi-cloud first” approach, customers can retain data where it is created (e.g at the edge) and optimize the applications to utilize real-time processing and secure multi-cluster networking instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimize Geographical Performance&lt;/strong&gt;&lt;br&gt;
Since the performance and latencies differ between cloud providers in different regions, a multi-cloud application can utilize the provider with the best characteristics for a given region or geography.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application Resiliency&lt;/strong&gt;&lt;br&gt;
While cloud outages are rare, they are extremely disruptive when they do occur. The recent Fortune technology &lt;a href="https://fortune.com/2023/06/07/cloud-outages-on-the-rise-tech-geopolitics-internet/"&gt;Article on Cloud Outages&lt;/a&gt; estimates a downtime cost of $365K per hour for cloud outages on business.&lt;/p&gt;

&lt;p&gt;A multi-cloud approach is an effective defense against such risks.&lt;/p&gt;

&lt;p&gt;Now that we’ve outlined some of the reasons WHY you should incorporate a multi-cloud approach to your devops projects, let’s discuss some of the common mistakes to avoid when establishing a multi-cloud strategy.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mistake #1 - Relying on custom resources
&lt;/h1&gt;

&lt;p&gt;Ideally, your application should not be reliant on custom resources from your cloud vendor. Resources that you use (networking, compute, memory, storage) should be virtualized using industry standard interfaces - CNI, CSI etc. This enables you to move an application between platforms without having to unwind custom hooks. Adopt a true Infrastructure as Code (IaC) methodology.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mistake #2 - Overlooking inter-cloud network connectivity
&lt;/h1&gt;

&lt;p&gt;One of the often overlooked aspects of Multi-cloud deployments is the network connectivity between applications running on different cloud platforms. Using a global load balancer to route traffic to individual application ‘islands’ is a suboptimal solution at best. Data and Metrics that have to travel between these isolated clusters have to navigate network boundaries via North-South traffic, and can only do so asynchronously.&lt;br&gt;&lt;br&gt;
Users should instead use tools such as KubeSlice to create a software defined network tunnel between the clusters / Clouds that ensures security and lowers the network latency. Thus, data and metrics can connect synchronously, via an East-West pathway between the clusters. In addition, the connection can be isolated at the individual namespace level - complying with zero trust application deployment model.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mistake #3 - Simply using Autoscaling to control costs vs. Intelligent Autoscaling and Remediation
&lt;/h1&gt;

&lt;p&gt;Intelligent autoscaling is a type of autoscaling that uses machine learning to predict future resource demand and scale accordingly. This can help to improve the performance and scalability of cloud-based applications, while also reducing costs.&lt;/p&gt;

&lt;p&gt;Traditional autoscaling approaches are based on simple rules, such as scaling up when CPU utilization reaches a certain threshold. However, these rules are reactive in nature, and can be too simplistic, leading to over- or under-provisioning of resources. Intelligent autoscaling, on the other hand, uses machine learning to learn the patterns of resource usage and predict future demand. This allows it to scale more effectively and efficiently.&lt;/p&gt;

&lt;p&gt;There are a number of different ways to implement intelligent autoscaling. Some popular approaches include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using machine learning models to predict resource demand&lt;/strong&gt;. This can be done by analyzing historical data, such as CPU utilization, memory usage, and traffic patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using reinforcement learning algorithms to learn the optimal scaling policies&lt;/strong&gt;. This can be done by trial and error, or by using a simulation environment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using a combination of machine learning and reinforcement learning&lt;/strong&gt;. This can be a more effective approach, as it can combine the strengths of both approaches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Intelligent autoscaling is a relatively new technology, but it is becoming increasingly popular. As cloud-based applications become more complex, the need for intelligent autoscaling will only grow.&lt;/p&gt;

&lt;p&gt;Using Intelligent Autoscaling tools such as Avesha SmartScaler, enterprises can ensure their multi-cloud applications also benefit from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improved performance&lt;/strong&gt;: Intelligent autoscaling can help to improve the performance of cloud-based applications by ensuring that they have the right amount of resources available. This can help to reduce latency and improve the user experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced costs&lt;/strong&gt;: Intelligent autoscaling can help to reduce costs by preventing over-provisioning of resources. This can save businesses money on their cloud bills.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved scalability&lt;/strong&gt;: Intelligent autoscaling can help to improve the scalability of cloud-based applications by allowing them to adapt to changes in demand. This can help businesses to avoid downtime and ensure that their applications are always available.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instantaneous action&lt;/strong&gt;: Unlike some of the common autoscaling tools, SmartScaler not only provides autoscale recommendations, but can actually make those changes in real time, instead of waiting for a manual operation. This not only saves time, but can also ensure specific application SLOs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Mistake #4 - Cluster monitoring vs. fleet monitoring
&lt;/h1&gt;

&lt;p&gt;When we’re only monitoring a single cluster, it is relatively easy to install Prometheus and Grafana, two open-source tools that are often used together for monitoring and observability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prometheus&lt;/strong&gt; is a monitoring system that collects metrics from a variety of sources, such as applications, services, and infrastructure. It stores these metrics in a time series database, which can be queried to generate alerts and visualizations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grafana&lt;/strong&gt; is a visualization tool that can be used to create dashboards and charts from Prometheus data. It provides a wide range of features for visualizing metrics, including graphs, tables, and maps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The situation becomes infinitely more complex when we want to monitor a fleet of clusters on a single dashboard. Installing a Prometheus server and Grafana dashboard for every cluster quickly becomes unwieldy. On the other hand, exporting metrics from different clusters, from multiple cloud platforms, to a centralized control center tends to create IP address conflicts and challenges in metrics latency&lt;/p&gt;

&lt;p&gt;Here again, a tool such as KubeSlice can help create a virtual, synchronous data plane for all Prometheus metrics from each cluster to be transmitted to a central control dashboard via a low latency synchronous connection.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mistake #5 - Not planning for MultiCloud Resiliency and Backup
&lt;/h1&gt;

&lt;p&gt;A full discussion on Resiliency and backup in Multi-Cloud setup is beyond the scope of this blog, but I’ve covered this in a previous blog post which can be found &lt;a href="https://avesha.io/resources/blogs/kubernetes-resiliency-rto-rpo-in-multi-cluster-deployments"&gt;here&lt;/a&gt;. There is also an in depth webinar by the &lt;a href="https://wemakedevs.org/?/events/webinars/kuberentes-disaster-recovery"&gt;WeMakeDevs&lt;/a&gt; folks on Zero RTO DR for Kubernetes for those that are interested.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mistake #6 - Shortchanging Multi-Cloud security
&lt;/h1&gt;

&lt;p&gt;Cloud Security causes trepidation in most application owners’ minds, multi-cloud security even more so. With a few best practices however, these risks can be ameliorated. Since each cloud platform may have its own security features and requirements, adopting a cloud-agnostic security stance frees you up from dependency on any one tool or security model.&lt;/p&gt;

&lt;p&gt;Some of the key best practices to ensure multi-cloud security include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Implementing consistent security policies across all cloud platforms&lt;/strong&gt;. This will help to ensure that all of your data and applications are protected to the same level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using a centralized cloud security management platform&lt;/strong&gt;. This can help you to simplify the management of your security policies and configurations across multiple cloud platforms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring your cloud environments for security threats&lt;/strong&gt;. This will help you to identify and respond to threats quickly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encrypt your data&lt;/strong&gt; (obviously!)

&lt;ul&gt;
&lt;li&gt;Store encryption keys separately (in a central repository) from cloud workloads&lt;/li&gt;
&lt;li&gt;Rotate the keys regularly&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use IAM Federation for SSO&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/singlesignon/index.html"&gt;AWS IAM Identity Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/active-directory/hybrid/connect/how-to-connect-sso"&gt;Azure Active Directory single sign-on&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/iam/docs/workload-identity-federation"&gt;Google Cloud Workload identity federation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Educating your employees about cloud security best practices&lt;/strong&gt;. This will help to reduce the risk of human error.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Mistake #7 - Not having an escape plan
&lt;/h1&gt;

&lt;p&gt;It is surprising to see so many business leaders embark on a public cloud journey with no exit plan. Even if today’s financial analysis makes it a no-brainer to move applications to a cloud vendor - those rosy numbers may change over time, or performance / service may degrade. It is important to have a backup plan on how to repatriate applications and services.&lt;/p&gt;

&lt;p&gt;To quote the famous line by Robert De Niro in the movie Ronin ; ”I never walk into a place I don't know how to walk out of.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RYPsYC1j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwg6miku9ynfjycf1spb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RYPsYC1j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwg6miku9ynfjycf1spb.png" alt="Image description" width="750" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/david-heinemeier-hansson-374b18221/"&gt;David Heinemeier Hansson&lt;/a&gt; has a great blog on &lt;a href="https://world.hey.com/dhh/we-have-left-the-cloud-251760fb"&gt;Cloud Repatriation&lt;/a&gt; and what was the analysis that led him down that path.&lt;/p&gt;

&lt;p&gt;Another extreme case of cloud repatriation is that of Dropbox who saved over $75 million over 2 years by moving much of their workload from public cloud to colo facilities with custom infrastructure. Sarah Wang and Martin Casado of Andreessen Horowitz used the Dropbox example in their groundbreaking article &lt;a href="https://a16z.com/2021/05/27/cost-of-cloud-paradox-market-cap-cloud-lifecycle-scale-growth-repatriation-optimization/"&gt;The Cost of Cloud, a Trillion Dollar Paradox&lt;/a&gt;, a worthy read.&lt;/p&gt;

&lt;p&gt;Whether we like it or not, the public cloud has become an integral part of our technological landscape and is poised for further growth. Forward-thinking leaders should acknowledge this reality and instead of relying solely on a single cloud provider, they should adopt a multi-cloud strategy to mitigate potential future uncertainties.&lt;/p&gt;

&lt;p&gt;Some of the key benefits of a multi-cloud strategy include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increased flexibility and scalability: By using multiple cloud providers, organizations can choose the best services for their specific needs. This can help to improve flexibility and scalability, as well as reduce costs.&lt;/li&gt;
&lt;li&gt;Improved resilience: By spreading their workloads across multiple cloud providers, organizations can improve their resilience to outages and other disruptions.&lt;/li&gt;
&lt;li&gt;Increased security: By using multiple cloud providers, organizations can reduce their reliance on any single provider. This can help to improve security by reducing the risk of a single point of failure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the right approach, multi-cloud can be a safe, secure, and economical path. However, it is important to have a clear understanding of the risks and challenges involved. Tools such as Kubeslice can help to mitigate these risks and make multi-cloud a more manageable reality.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>monitoring</category>
      <category>security</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>Kafka Multi-Cluster Deployment on Kubernetes - simplified !</title>
      <dc:creator>Ray Edwards</dc:creator>
      <pubDate>Thu, 19 Oct 2023 20:27:53 +0000</pubDate>
      <link>https://dev.to/rayedwards/kafka-multi-cluster-deployment-on-kubernetes-simplified--2f27</link>
      <guid>https://dev.to/rayedwards/kafka-multi-cluster-deployment-on-kubernetes-simplified--2f27</guid>
      <description>&lt;p&gt;What is Kafka&lt;br&gt;
Commonly known simply as Kafka, Apache Kafka is an open-source event streaming platform maintained by the Apache Software Foundation. Initially conceived at LinkedIn, Apache Kafka was collaboratively created by &lt;a href="https://www.linkedin.com/in/jaykreps/"&gt;Jay Kreps&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/nehanarkhede/"&gt;Neha Narkhede&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/junrao/"&gt;Jun Rao&lt;/a&gt;, and subsequently released as an open-source project in 2011. &lt;a href="https://en.wikipedia.org/wiki/Apache_Kafka"&gt;Wiki Page&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Today, Kafka is one of the most popular event streaming platforms designed to handle real-time data feeds. It is widely used to build scalable, fault-tolerant, and high-performance streaming data pipelines.&lt;/p&gt;

&lt;p&gt;Kafka's uses are continually expanding, with the top 5 cases nicely illustrated by Brij Pandey in the accompanying image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oWaksHyx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6cgc1zom4wpk1hgvck1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oWaksHyx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6cgc1zom4wpk1hgvck1.gif" alt="Image description" width="794" height="1046"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a brief primer, it is important to understand the components of the Kafka platform and how they work..&lt;/p&gt;

&lt;p&gt;Kafka works as a distributed event streaming platform, designed to handle real-time data feeds efficiently. It operates based on the publish-subscribe messaging model and follows a distributed and fault-tolerant architecture. It maintains a persistent, ordered, and partitioned sequence of records called "topics." Producers write data to these topics, and consumers read from them. This enables decoupling between data producers and consumers and allows multiple applications to consume the same data stream independently.&lt;/p&gt;

&lt;p&gt;Key components of Kafka include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Topics and Partitions:&lt;/strong&gt; Kafka organizes data into topics. Each topic is a stream of records, and the data within a topic is split into multiple partitions. Each partition is an ordered, &lt;u&gt;immutable&lt;/u&gt; sequence of records. Partitions enable horizontal scalability and parallelism by allowing data to be distributed across multiple Kafka brokers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Producers:&lt;/strong&gt; Producers are applications that write data to Kafka topics. They publish records to specific topics, which are then stored in the topic's partitions. Producers can send records to a particular partition explicitly or allow Kafka to determine the partition using a partitioning strategy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consumers:&lt;/strong&gt; Consumers are applications that read data from Kafka topics. They subscribe to one or more topics and consume records from the partitions they are assigned to. Consumer groups are used to scale consumption, and each partition within a topic can be consumed by only one consumer within a group. This allows multiple consumers to work in parallel to process the data from different partitions of the same topic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Brokers:&lt;/strong&gt; Kafka runs as a cluster of servers, and each server is called a broker. Brokers are responsible for handling read and write requests from producers and consumers, as well as managing the topic partitions. A Kafka cluster can have multiple brokers to distribute the load and ensure fault tolerance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Partitions/Replication:&lt;/strong&gt; To achieve fault tolerance and data durability, Kafka allows configuring replication for topic partitions. Each partition can have multiple replicas, with one replica designated as the leader and the others as followers. The leader replica handles all read and write requests for that partition, while followers replicate the data from the leader to stay in sync. If a broker with a leader replica fails, one of the followers automatically becomes the new leader to ensure continuous operation. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Offset Management:&lt;/strong&gt; Kafka maintains the concept of offsets for each partition. An offset represents a unique identifier for a record within a partition. Consumers keep track of their current offset, allowing them to resume consumption from where they left off in case of failure or reprocessing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ZooKeeper:&lt;/strong&gt; While not part of Kafka itself, ZooKeeper is often used to manage the metadata and coordinate the brokers in a Kafka cluster. It helps with leader election, topic and partition information, and managing consumer group coordination. [Note: &lt;em&gt;Zookeeper metadata management tool, will soon be phased out in favor of &lt;a href="https://developer.confluent.io/learn/kraft/"&gt;Kafka Raft&lt;/a&gt;, or KRaft, a protocol for internally managed metadata&lt;/em&gt;]&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overall, Kafka's design and architecture make it a highly scalable, fault-tolerant, and efficient platform for handling large volumes of real-time data streams. It has become a central component in many data-driven applications and data infrastructure, facilitating data integration, event processing, and stream analytics.&lt;/p&gt;

&lt;p&gt;A typical Kafka architecture would then be as follows : &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kKywtwm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig3j4oa9wu3hho276xwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kKywtwm3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig3j4oa9wu3hho276xwd.png" alt="Image description" width="800" height="622"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Kafka clustering refers to the practice of running multiple Kafka brokers together as a group to form a Kafka cluster. Clustering is a fundamental aspect of Kafka's architecture, providing several benefits, including scalability, fault tolerance, and high availability. A Kafka cluster is used to handle large-scale data streams and ensure that the system remains operational even in the face of failures.  &lt;/p&gt;

&lt;p&gt;In the cluster, Kafka topics are divided into multiple partitions to achieve scalability and parallelism. Each partition is a linearly ordered, immutable sequence of records. Partitions therefore allow data to be distributed across multiple brokers in the cluster.&lt;/p&gt;

&lt;p&gt;It should be noted that a minimum Kafka cluster consists of 3 Kafka brokers, each of which can be run on a separate server (virtual or physical). The 3 node guidance is to help avoid a split brain scenario in case of a broker failure. (Nice article by &lt;a href="https://medium.com/nerd-for-tech/split-brain-in-distributed-systems-252b0d4d122e"&gt;Dhinesh Sunder Ganapathi&lt;/a&gt; that goes into more detail.)&lt;/p&gt;

&lt;h1&gt;
  
  
  Kafka and Kubernetes
&lt;/h1&gt;

&lt;p&gt;As more companies adopt Kafka, there is also an increasing interest in deploying Kafka on Kubernetes.&lt;/p&gt;

&lt;p&gt;In fact, the most recent &lt;a href="https://www.dynatrace.com/news/blog/kubernetes-in-the-wild-2023/"&gt;Kubernetes in the Wild report 2023&lt;/a&gt; by Dynatrace shows that over 40% of large organizations run their open source messaging platform within Kubernetes - the majority of this being Kafka.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.dynatrace.com/news/blog/kubernetes-in-the-wild-2023/#&amp;amp;gid=0&amp;amp;pid=1"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zHyOU_sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yg3gddg26f8ysa0nk21c.png" alt="Image description" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same report also makes a bold claim , that “Kubernetes is emerging as the ‘operating system’ of the cloud.”&lt;/p&gt;

&lt;p&gt;It is imperative then, for Kafka administrators to understand the interplay between Kafka and Kubernetes, and how to implement these appropriately for scale.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Case for Multi Cluster Kafka
&lt;/h1&gt;

&lt;p&gt;Running a Kafka cluster in a single Kubernetes cluster setup is fairly straightforward and enables scalability as needed in theory. In production however, the picture can get a bit murky.&lt;/p&gt;

&lt;p&gt;We should distinguish the use of the term &lt;em&gt;cluster&lt;/em&gt; between Kafka and Kubernetes. A Kubernetes deployment also uses the term &lt;em&gt;cluster&lt;/em&gt; to designate a grouping of connected nodes, referred to as Kubernetes cluster. When the Kafka workload is deployed on Kubernetes, you will end up with a Kafka cluster running inside a Kubernetes cluster, but more relevant to our discussion, you may also have a Kafka cluster that spans multiple Kubernetes clusters - for resiliency, performance, data sovereignty etc. &lt;/p&gt;

&lt;p&gt;To begin with, Kafka is not designed for multi-tenant setups. In technical terms, Kafka does not understand concepts such as Kubernetes namespaces or resource isolation. Within a particular topic, there is no easy mechanism to enforce security access restrictions between multiple user groups.&lt;/p&gt;

&lt;p&gt;Additionally, different workloads may have different update frequency and scale requirements eg batch application vs. real-time application. Combining the two workloads into a single cluster could cause adverse impacts or consume much more resources than necessary.&lt;/p&gt;

&lt;p&gt;Data sovereignty and regulatory compliance can also impose restrictions on co locating data and topics in a specific region or application.&lt;/p&gt;

&lt;p&gt;Resiliency of course is another strong driving force behind the need for multiple Kafka clusters. While Kafka clusters are designed for fault tolerance of topics, we still have to plan for a catastrophic failure of an entire cluster. In such cases, the need for a fully replicated cluster enables proper business continuity planning.&lt;/p&gt;

&lt;p&gt;For businesses that are migrating workload to the cloud or have a hybrid cloud strategy, you may want to set up multiple Kafka clusters and perform a planned workload migration over time rather than a risky full scale Kafka migration.&lt;/p&gt;

&lt;p&gt;These are just a few of the reasons why in practice, enterprises find themselves having to create multiple Kafka clusters that nevertheless need to interact with each other.&lt;/p&gt;

&lt;h1&gt;
  
  
  Multi Cluster Kafka
&lt;/h1&gt;

&lt;p&gt;In order to have multiple Kafka clusters that are connected to each other, key items from one cluster must be replicated to the other cluster(s). These include the topics, offsets and metadata. In Kafka terms, this duplication is considered Mirroring.&lt;/p&gt;

&lt;p&gt;There are two approaches of multi-cluster setups that are possible. Stretched Clusters or Connected Clusters. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YQuQaZ0K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbscn8duc9e8uc5loh8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YQuQaZ0K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbscn8duc9e8uc5loh8w.png" alt="Image description" width="662" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stretched clusters - Synchronous replication&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A stretched cluster is a logical cluster that is ‘stretched’ across several physical clusters. Topics and replicas are distributed across the physical clusters, but since they are represented as a logical cluster, the applications themselves are not aware of this multiplicity. &lt;/p&gt;

&lt;p&gt;Stretched clusters have strong consistency and are easier to manage and administer. Since applications are unaware of the existence of multiple clusters, they are easier to deploy on stretched clusters, compared to connected clusters.&lt;/p&gt;

&lt;p&gt;The downsides of stretched clusters are that it requires a synchronous connection between the clusters. They are not ideal for a hybrid cloud deployment, and will require a quorum of at least 3 clusters to avoid a ‘split-brain’ scenario.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connected Clusters - Asynchronous replication&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Connected Cluster on the other hand, is deployed by connecting multiple independent clusters. These independent clusters could be running in different regions or cloud platforms and are managed individually. &lt;/p&gt;

&lt;p&gt;The primary benefit of the connected cluster model is that there is no downtime in cases of a cluster failure, since the other clusters are running independently. Each cluster can also be optimized for its particular resources.&lt;/p&gt;

&lt;p&gt;The major downside of connected clusters is that it relies on asynchronous connection between the clusters. Topics that are replicated between the clusters are not ‘copy on write’ but rather, depend on &lt;em&gt;eventual consistency&lt;/em&gt;. This can lead to possible data loss during the async mirroring process.&lt;/p&gt;

&lt;p&gt;Additionally, applications that work across connected clusters have to be modified to be aware of the multiple clusters.&lt;/p&gt;

&lt;p&gt;Before we address the solution to this conundrum, I’ll briefly cover the common tools on the market to enable Kafka cluster connectivity.&lt;/p&gt;

&lt;p&gt;Open Source Kafka itself ships with a mirroring tool called Mirror Maker.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xMBZI27g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtl3c074sm9tjhlcxmt5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xMBZI27g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtl3c074sm9tjhlcxmt5.png" alt="Image description" width="633" height="343"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://www.altoros.com/blog/multi-cluster-deployment-options-for-apache-kafka-pros-and-cons/"&gt;https://www.altoros.com/blog/multi-cluster-deployment-options-for-apache-kafka-pros-and-cons/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mirror Maker duplicates topics between different clusters via a built in producer. This way data is cross replicated between clusters with eventual consistency, but without interrupting individual processes.&lt;/p&gt;

&lt;p&gt;It is important to note that while Mirror Maker is simple in its concept, setting up Mirror Maker at scale can be quite a challenge for IT organizations. Managing IP addresses, naming conventions, number of replicas etc must be done correctly or it could lead to what is known as ‘infinite replication’ where a topic is infinitely replicated, leading to eventual crash.&lt;/p&gt;

&lt;p&gt;Other downsides of Mirror Maker is the lack of dynamic configuration of allowed/disallowed lists for updates. Mirror Maker also does not sync topic properties properly, which makes it an operational headache at scale when adding or removing topics to be replicated. Mirror Maker 2 attempts to fix some of these challenges but many IT shops still struggle to get Mirror Maker set up correctly.&lt;/p&gt;

&lt;p&gt;Other Open Source tools for Kafka replication include Mirus from Salesforce, uReplicator from Uber and customised Flink from Netflix. &lt;/p&gt;

&lt;p&gt;For commercial licensed options, Confluent offers two options, Confluent Replicator and Cluster Linking. Confluent Replicator is essentially a Kafka Connect connector that provides a high-performance and resilient way to copy topic data between clusters. Cluster Linking is another offering, developed internally and is targeted at multi region replication while preserving topic offsets.&lt;/p&gt;

&lt;p&gt;Even so, Cluster Linking is an asynchronous replication tool with data having to cross network boundaries and traverse public traffic pathways.&lt;/p&gt;

&lt;p&gt;As should be clear by now, Kafka replication is a crucial strategy for production applications at scale, the question is which option to choose.&lt;/p&gt;

&lt;p&gt;Imaginative Kafka administrators will quickly realize that you may need connected clusters and stretched clusters, or a combination of these deployments, depending on the application performance and resiliency requirements.&lt;/p&gt;

&lt;p&gt;What is daunting however, is the exponential challenges of setting up the cluster configurations and managing these at scale across multiple clusters. Is there a more elegant way to solve this nightmare? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The answer is Yes!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://avesha.io/products/product-slice"&gt;KubeSlice&lt;/a&gt; by Avesha is an exquisitely simple way to get the best of both worlds. By creating a direct &lt;em&gt;Service Connectivity&lt;/em&gt; between clusters or namespaces, KubeSlice obviates the need for manually configuring individual connectivity between Kafka clusters.&lt;/p&gt;

&lt;p&gt;At its core, KubeSlice creates a secure, synchronous Layer 3 network gateway between clusters; isolated at the application or namespace level. Once this is set up, Kafka administrators are free to deploy Kafka brokers in any of the clusters.&lt;/p&gt;

&lt;p&gt;Each broker has a synchronous connectivity to every other broker that is joined via the slice, even though the brokers themselves may be on separate clusters. This effectively creates a stretched cluster between the brokers and  provides the benefit of a strong consistency, and low administration overhead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XZSYiuOM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvkkmvmv69hjz8npmp59.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XZSYiuOM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvkkmvmv69hjz8npmp59.png" alt="Image description" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have your cake and eat it too!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For those that may want to deploy Mirror Maker into their clusters, this can be done with minimal effort since the connectivity between the clusters is delegated to KubeSlice. Thus, Kafka applications can have the benefits of synchronous (speed, resiliency) AND asynchronous (independence, scale) replication in the same deployment with the ability to mix and match the capabilities as needed. This is true of on-prem data centers, across public clouds or any combinations of these in a hybrid setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rrAfvUBA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfmi6fhgoo88s2xd26xv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rrAfvUBA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfmi6fhgoo88s2xd26xv.png" alt="Image description" width="743" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The best part is that KubeSlice is a non-disruptive deployment, meaning that there is no need to uninstall any tool already deployed. It is simply a matter of establishing a &lt;em&gt;slice&lt;/em&gt; and adding the Kafka deployment onto that &lt;em&gt;slice&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This blog provided a brief overview of Apache Kafka and has touched on some of the more common use cases. We covered the current tools available to scale Kafka deployments across multiple clusters and discussed the advantages / disadvantages of each. Finally, the article also introduced Kubeslice - the emerging service connectivity solution that simplifies Kafka multi-cluster deployments and removes the headaches associated with configuring Kafka replication across multiple clusters at scale.&lt;/p&gt;

&lt;p&gt;A couple of links that readers may find useful:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/"&gt;An older blog of best practices running Kafka on AWS&lt;/a&gt;(before KubeSlice was introduced)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://avesha.io/resources/blogs/a-step-by-step-guide-to-acquiring-and-running-kube-slice-enterprise-with-a-trial-license"&gt;Guided setup of KubeSlice&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/stateful-workloads/kafka"&gt;Deploying Kafka on GKE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying"&gt;What Every Engineer should know about distributed log&lt;/a&gt; - by Jay Kreps (essential reading!)&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>kafka</category>
      <category>deployment</category>
      <category>cluster</category>
    </item>
  </channel>
</rss>
