<?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>Forem: Eyal Bukchin</title>
    <description>The latest articles on Forem by Eyal Bukchin (@eyalb).</description>
    <link>https://forem.com/eyalb</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%2F870070%2Fd01a7af7-a7ae-42a9-9fa1-5f63c974af8f.jpg</url>
      <title>Forem: Eyal Bukchin</title>
      <link>https://forem.com/eyalb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/eyalb"/>
    <language>en</language>
    <item>
      <title>mirrord as an alternative to Telepresence</title>
      <dc:creator>Eyal Bukchin</dc:creator>
      <pubDate>Fri, 11 Aug 2023 09:50:22 +0000</pubDate>
      <link>https://forem.com/eyalb/mirrord-as-an-alternative-to-telepresence-39mn</link>
      <guid>https://forem.com/eyalb/mirrord-as-an-alternative-to-telepresence-39mn</guid>
      <description>&lt;p&gt;A question that comes up often from those already familiar with local Kubernetes development is how mirrord compares to Telepresence. The idea at the base of both products is indeed similar: instead of deploying your new code to the cloud and testing it there, connect it to the cloud from your local machine. By shifting left on cloud testing this way you utilize your cloud environment much more effectively and speed up your development process. The people at Ambassador Labs &lt;a href="https://www.getambassador.io/docs/telepresence-oss/latest/concepts/devworkflow" rel="noopener noreferrer"&gt;wrote about it at length&lt;/a&gt;.&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%2Fewa9vla8w465jz4v6yp2.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%2Fewa9vla8w465jz4v6yp2.png" alt="The mandatory mirrord VS. Telepresence image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, the technical approach at the base of mirrord is very different from that of Telepresence, which translates into significant differences in usability, compatibility, and performance. What Telepresence does is install an operator in your cluster, then connect you to the cluster via VPN (either your entire development machine or a containerized subset). On the other hand, this is what happens when you run a local process with mirrord:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;mirrord starts a pod (called the mirrord agent) on the same network namespace as your target. This pod is cleaned up automatically at the end of execution.&lt;/li&gt;
&lt;li&gt;mirrord then injects itself into your process, overrides low-level functions and relays them to the mirrord agent, who then executes them on the target in the cluster and sends back the results. For example, when your process tries to read a file, mirrord intercepts that function call and instead asks the agent to read that file from the remote target. mirrord does this for everything - traffic, file operations, environment variables - so your process behaves as if it was executed within the Kubernetes cluster, and with the entire context of your target.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It’s pretty heavy lifting compared to just starting a VPN - mirrord has to hook and reimplement a lot of functions for everything to work smoothly across different frameworks. But there’s a payoff:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;By providing your local process with the &lt;strong&gt;entire remote context of the pod&lt;/strong&gt; you chose to target, mirrord &lt;strong&gt;natively supports complex flows&lt;/strong&gt;. For example, if when your process receives a request it queries a database - since mirrord provides it with the pod’s environment variables and files, it’s going to have the necessary credentials, and since mirrord intercepts the outgoing requests and sends it out from the remote pod instead, it won’t be interrupted by any network rules blocking access from outside of the cluster. &lt;/li&gt;
&lt;li&gt;mirrord &lt;strong&gt;doesn’t need root access&lt;/strong&gt; on your machine. All it does is override the functions of a running process; the rest of your machine remains untouched&lt;/li&gt;
&lt;li&gt;You &lt;strong&gt;don’t have to install anything on your cluster&lt;/strong&gt; - mirrord uses the Kubernetes API, so all you need is a configured kubeconfig. mirrord does create a pod when it runs, but it cleans itself up at the end of execution.&lt;/li&gt;
&lt;li&gt;As you might have guessed, mirrord &lt;strong&gt;supports traffic mirroring&lt;/strong&gt;. It can still intercept traffic like Telepresence does, but if you want to leave the remote process completely untouched, mirrord can also just duplicate its traffic and send a copy to you. The original requests are handled by the remote service, so people accessing it are completely unaware that you’re using mirrord to debug it.&lt;/li&gt;
&lt;li&gt;As opposed to Telepresence which works at the network level, mirrord works at the pod level. This means it also &lt;strong&gt;supports pods that aren’t exposed through a service&lt;/strong&gt;, and gives your local code access to anything the pod can access, including &lt;strong&gt;components outside the cluster&lt;/strong&gt;. It also natively supports environments with service mesh like Linkerd or Istio.&lt;/li&gt;
&lt;li&gt;Because the mirrord client works at the process level, you can easily &lt;strong&gt;configure exactly what’s executed remotely and what stays local&lt;/strong&gt;. For example, you could make all the components of the remote cluster accessible to your local process, but have it write to the database locally; or have it read files from the local file system, except a few specific files that you want to get from the remote pod. &lt;/li&gt;
&lt;li&gt;mirrord is a tool for developers, and as such, in addition to a CLI tool, it also comes as an &lt;strong&gt;IDE plugin for both VS Code and the IntelliJ IDEs&lt;/strong&gt;. This is the most popular way to use mirrord, where it naturally fits into the existing development workflow.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most importantly though, all of these things are supported out of the box and with no required changes to your system. You don’t have to set up mounts, manually ingest environment variables, or create headless services. Just run your process with mirrord, and everything works. It’s this lack of friction that really makes the vision of local Kubernetes development possible - a true shift left of the cloud, where running your code in Kubernetes isn’t the thing you’re saving for last after all the unit tests and local setups, but rather the first thing you do when you write new code. &lt;/p&gt;

&lt;p&gt;Usage is simple and intuitive. In the CLI:&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%2Fzbgcqrqrxui6iwa5sbsc.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%2Fzbgcqrqrxui6iwa5sbsc.png" alt="A very straightforward breakdown of the mirrord CLI command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And in the IDE - enable mirrord, run or debug your code, and select a target. For example, in VSCode:&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%2Fl18ffrxg2xxs1akqhpnf.gif" 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%2Fl18ffrxg2xxs1akqhpnf.gif" alt="Quick demo of mirrord being used within VS Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it out!
&lt;/h2&gt;

&lt;p&gt;If you want to take mirrord for a spin, check out the &lt;a href="https://mirrord.dev/docs/overview/quick-start/" rel="noopener noreferrer"&gt;quick start guide&lt;/a&gt;. We’d love to hear about your experience or just general thoughts - chat us up on our &lt;a href="https://discord.gg/metalbear" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; or open an issue or discussion on &lt;a href="https://github.com/metalbear-co/mirrord" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>tooling</category>
      <category>development</category>
    </item>
    <item>
      <title>Approaches in Cloud Development Ergonomics</title>
      <dc:creator>Eyal Bukchin</dc:creator>
      <pubDate>Tue, 15 Nov 2022 15:47:30 +0000</pubDate>
      <link>https://forem.com/eyalb/approaches-in-cloud-development-ergonomics-5967</link>
      <guid>https://forem.com/eyalb/approaches-in-cloud-development-ergonomics-5967</guid>
      <description>&lt;p&gt;The advent of microservice architectures and cloud-native has taken some pretty severe tolls on developer ergonomics. It feels as if the tools cloud developers have at their disposal haven’t evolved fast enough to keep up with the rapid progress in infrastructure, and this tool debt is readily apparent in the day-to-day of the modern developer. &lt;/p&gt;

&lt;p&gt;The clearest example of this is that it’s now &lt;strong&gt;really hard to just run your application&lt;/strong&gt;. Not the one microservice you’re currently working on, but your actual entire application, which you ultimately deploy to the cloud and serves your customers. You used to be able to fire up your monolith right there on your laptop from within your IDE (crash, change some code, run it again), but architectures today have become resource-intensive, reliant on third-party services, and mostly just plain convoluted to the point where local execution is no longer a viable option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XACBG2Kb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/ergonomics.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XACBG2Kb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/ergonomics.jpg" alt="Ergonomics" width="687" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we talk about something as elementary as running your application, it naturally applies to many aspects of the developer’s day-to-day: debugging, testing, even just writing new code to see if it works. Therefore, solutions that make your application even a little easier to run provide significant value, just by affecting so many routine activities.&lt;br&gt;
In this article, we’re going to discuss today’s dominant approaches to making microservice applications easier for developers to run, and we’re also going to make the case for our &lt;a href="https://mirrord.dev"&gt;own thing&lt;/a&gt; - namely, a single shared environment in the cloud that the organization maintains, and that developers can plug in and out of non-intrusively as they develop their microservices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contemporary Cloud Development Workflows
&lt;/h2&gt;

&lt;p&gt;In the frictionless microservice utopia, the development workflow goes something along these lines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microservices are independent and new functionality can be developed one microservice at a time &lt;/li&gt;
&lt;li&gt;Microservices talk to each other via well-defined contracts which can be tested in isolation&lt;/li&gt;
&lt;li&gt;Databases, queues, and third-party services consumed by a microservice also expose a consistent and well-defined contract, and as such can be mocked for testing purposes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, a service can be tested on its own, and then deployed to the production environment where it would play nicely with all the other components.&lt;/p&gt;

&lt;p&gt;However, let's assume you’re a microservice developer who doesn’t work in an organization where everyone designs perfect contracts and writes rigorous tests (or they do, but the third-party managed services you rely on don’t). When writing new code, you probably make as much progress as you can within the scope of the one or two microservices you’re working on at the moment, but then you do one or more of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wrangle your entire application - microservices, databases and all - to run on your local machine&lt;/li&gt;
&lt;li&gt;Deploy your new code to a personal persistent/ephemeral development environment in the cloud &lt;/li&gt;
&lt;li&gt;Deploy your new code to a shared staging environment and test it there&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Run Locally
&lt;/h3&gt;

&lt;p&gt;This approach works great when it’s feasible, which is usually at a very early stage in the life of the application where it’s still small and tenable. There’s some tooling that lets you extend this honeymoon phase by letting you do it more easily, like &lt;a href="https://docs.docker.com/compose"&gt;docker-compose&lt;/a&gt;, &lt;a href="https://skaffold.dev"&gt;Skaffold&lt;/a&gt;, or &lt;a href="https://tilt.dev"&gt;Tilt&lt;/a&gt;. However, at a certain point, even if you’ve written whatever scriptage is needed to actually configure and run the latest stable version of all of your components together, you’re going to hit some sort of ceiling: if you’ve got a large database, or some CPU-heavy computations, or you’re relying on some managed service that can’t be containerized, this approach soon becomes untenable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p46S7vH_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/local.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p46S7vH_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/local.png" alt="Local Environment" width="469" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convenient development on your local machine&lt;/li&gt;
&lt;li&gt;No reliance on network or external services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Difficult/impossible for large applications (ones with e.g. many microservices, a large database, high bandwidth usage)&lt;/li&gt;
&lt;li&gt;Doesn’t support hard-to-containerize components, like managed services&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Personal Cloud Environment
&lt;/h3&gt;

&lt;p&gt;With Infrastructure as Code at its current state of maturity, it’s now easier than ever to replicate microservice environments in the cloud. This unlocked a new approach of having a personal production-like cloud environment for every developer, which they can use freely and in isolation. It comes in two flavors - persistent environments, or ephemeral environments created on demand with products like &lt;a href="https://okteto.com"&gt;Okteto&lt;/a&gt; or &lt;a href="https://bunnyshell.com"&gt;Bunnyshell&lt;/a&gt; (also sometimes called Environment as a Service)&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. This approach overcomes the resource limitations of the local environment but substitutes them for some new difficulties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For persistent environments, cost (determined by the size of the environment times the number of developers) becomes a factor. As the company grows, so do its architecture and the number of developers, leading to soaring cloud bills&lt;/li&gt;
&lt;li&gt;To generate state, database seed files are used. These need to be maintained so they don’t become stale&lt;/li&gt;
&lt;li&gt;You have to work against a cloud environment, which isn’t always fun (though some tools make it easier, like &lt;a href="https://github.com/features/codespaces"&gt;GitHub Codespaces&lt;/a&gt; or &lt;a href="https://www.gitpod.io/"&gt;Gitpod&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Same as with running your application locally, having hard-to-containerize components in your architecture like managed services can make this approach unfeasible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2tomNXPp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/personal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2tomNXPp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/personal.png" alt="Personal Environment" width="688" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not capped by the hardware limitations of your development machine&lt;/li&gt;
&lt;li&gt;Better simulation of your production environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No production-like database state&lt;/li&gt;
&lt;li&gt;Local changes have to be synced to the cloud&lt;/li&gt;
&lt;li&gt;Doesn’t support hard-to-containerize components, like managed services&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Shared Cloud Environment
&lt;/h3&gt;

&lt;p&gt;A lot of organizations have already put in the effort of setting up a single, shared production-like environment for testing - the staging environment. It’s persistent and has already been set up manually to include all components, including third-party services, databases with full state (some companies even automatically stream data from production), and all the microservices. In terms of simulating production, it’s hard to do much better.&lt;/p&gt;

&lt;p&gt;However, since this environment is shared by multiple developers, some measures are usually in place to keep it stable - for example, you can only actually deploy new code through the CI, often meaning you have to wait for a code review and your entire suite of automated tests to run (not to mention the deployment script itself) before it actually gets there. Even then, the tests aren’t perfect, and sometimes you end up deploying broken code and corrupting the environment, much to the chagrin of your fellow developers.&lt;/p&gt;

&lt;p&gt;This is where shared environment tools like &lt;a href="https://telepresence.io/"&gt;Telepresence&lt;/a&gt; and &lt;a href="https://www.codezero.io/"&gt;CodeZero&lt;/a&gt; can help. They assume you're only working on one or two microservices anyway, and running them locally is not an issue. These tools let you connect your local service to the staging environment, replacing the service currently running in the cluster, without deployment. The code you're working on runs locally, and its dependencies run in the cloud. Not only can you keep working on your local environment, you can iterate on testing against your cloud environment without waiting for lengthy CI and deployment processes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CJNsWiBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/shared.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CJNsWiBF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://metalbear.co/blog/approaches-in-cloud-development-ergonomics/shared.png" alt="Shared Environment" width="849" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leverage a single shared environment, making it feasible for you to manually set up database state and managed services (since you only have to do it once, for one environment)&lt;/li&gt;
&lt;li&gt;You can still work locally within your IDE&lt;/li&gt;
&lt;li&gt;Code changes happen locally, so iterations are fast (no need to deploy to the cloud)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One developer can break the environment for the others&lt;/li&gt;
&lt;li&gt;If the environment is corrupted, it’s hard to recover&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Sell
&lt;/h2&gt;

&lt;p&gt;So local setups are easy to use but don’t support large deployments; personal cloud environments support large deployments but don’t really reflect production, don’t support components that can’t be containerized, and cost a lot; and shared environments reflect production for cheap, but don’t really support concurrency without sacrificing stability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mirrord.dev"&gt;mirrord&lt;/a&gt; lets you have all of these cakes and eat them too. We essentially took the shared environment approach and tacked on isolation. We do this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Letting developers mirror incoming traffic rather than just intercept it. This lets multiple developers work on the same service in the cloud, while the service is still running and handling requests.&lt;/li&gt;
&lt;li&gt;Giving developers fine-grained control over what happens locally and what happens remotely. This way, for example, incoming traffic mirroring and file reads can happen remotely, but outgoing traffic and file writes can be local. Future versions of mirrord will include more advanced modes of configuration, letting users filter by e.g. hostname or protocol.&lt;/li&gt;
&lt;li&gt;In future versions, supporting advanced features like copy-on-write for databases.&lt;/li&gt;
&lt;li&gt;In our upcoming cloud solution, providing RBAC, letting the organization control which teams have access to which parts of the staging environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using mirrord, developers can run the one service they’re working on locally, without juggling configurations or straining their development machine; they can run it against a full environment with mature database state and managed services; and they can do it quickly, easily and without risk. &lt;/p&gt;

&lt;p&gt;We’ve recently released our &lt;a href="https://metalbear.co/blog/mirrord-3.0-is-out/"&gt;first stable version&lt;/a&gt;, and would love to hear your thoughts (on &lt;a href="https://github.com/metalbear-co/mirrord"&gt;GitHub&lt;/a&gt; or &lt;a href="https://discord.gg/pSKEdmNZcK"&gt;Discord&lt;/a&gt;).&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;It can also be supplemented with a cloud development environment, as provided by products like Gitpod or Codespaces. For a comprehensive survey of the non-localhost space see this &lt;a href="https://dx.tips/the-end-of-localhost"&gt;excellent article&lt;/a&gt;.   ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>productivity</category>
      <category>cloudnative</category>
      <category>microservices</category>
      <category>programming</category>
    </item>
    <item>
      <title>(Re)Introducing mirrord (or: the War on the Long Dev Loop)</title>
      <dc:creator>Eyal Bukchin</dc:creator>
      <pubDate>Tue, 31 May 2022 09:12:57 +0000</pubDate>
      <link>https://forem.com/eyalb/reintroducing-mirrord-or-the-war-on-the-long-dev-loop-nil</link>
      <guid>https://forem.com/eyalb/reintroducing-mirrord-or-the-war-on-the-long-dev-loop-nil</guid>
      <description>&lt;p&gt;Originally posted on the &lt;a href="https://metalbear.co/blog/reintroducing-mirrord/"&gt;MetalBear blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CY7y8RcR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0g92u051f0vdd9933kx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CY7y8RcR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0g92u051f0vdd9933kx6.png" alt="mirrord logo" width="446" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Dev Loop (or: know your enemy)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iOryIIqY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifc7f9wh8azjdoa65j7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iOryIIqY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifc7f9wh8azjdoa65j7g.png" alt="The dev loop" width="241" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine you’re a backend developer at post series B SaaS soonicorn. You’ve spent half a sprint adding a new feature to your microservice. You’ve thoroughly researched possible inputs and database states and built an elaborate test suite. Your code was mercilessly reviewed by two of your teammates. Finally, the tests pass, the pull request is approved, and as a final verification, you deploy your new code to the staging environment…&lt;/p&gt;

&lt;p&gt;Where it crashes almost immediately. Turns out you forgot to test some obscure configuration, or some complex database state that would only ever occur on a mature, complex environment - like staging, and unlike your local machine.&lt;br&gt;
So you roll the service back on staging, fix the bug, write some more tests, get it reviewed again, build the code, deploy it to staging… and it crashes again. While you were fixing the bug, your teammate deployed a new version of some other microservice - except they're not as thorough a tester as you are, and the new version is broken, so you can’t test your own service. You wait for them to roll their service back to a working version, the sprint is long over, and you’ve started on your next feature during your downtime so now you’re dividing your focus between two things.&lt;/p&gt;

&lt;p&gt;The worst part being that you know it’s going to happen again next sprint.&lt;/p&gt;

&lt;h2&gt;
  
  
  mirrord (or: how you win)
&lt;/h2&gt;

&lt;p&gt;I’ve encountered some variation of the dev loop at every startup I’ve ever worked in, and it’s this pain exactly that we’re trying to solve with mirrord. mirrord runs in two places - on your local development machine, and in your staging environment. By wrapping your local process and hooking system calls, it lets you plug your process non-invasively into that service’s instance on the staging environment. &lt;br&gt;
Simply put, mirrord lets you run a local process in the context of your cloud service. This means you can test your code on staging, without actually deploying it there. Not only does it save you the hassle of deployment every time you make a change, but it also keeps the staging environment free from untested versions, and constantly usable for everyone else in the organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nJ_8ADhL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dt51lnzabke5phsh35or.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nJ_8ADhL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dt51lnzabke5phsh35or.png" alt="mirrord architecture" width="880" height="524"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started (and: other practical info)
&lt;/h2&gt;

&lt;p&gt;Today we’re releasing &lt;a href="https://mirrord.dev"&gt;mirrord 2.0&lt;/a&gt;, which supports incoming traffic. That means whatever traffic reaches your service in staging is duplicated by mirrord and sent to your local process. We’ll soon be adding support for outgoing traffic, file access, and environment variables - everything needed for your local process to “think” it’s running on the staging environment.&lt;br&gt;
All you need to run mirrord is kubectl access to your staging environment&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. You can use it as either a CLI tool, or an extension for VS Code (IntelliJ support is on the way). Try it out &lt;a href="https://mirrord.dev"&gt;here&lt;/a&gt;, and let us know what you think at &lt;a href="//mailto:hi@metalbear.co"&gt;hi@metalbear.co&lt;/a&gt;, or in our repo!&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;note that mirrord doesn’t install anything persistent in your Kubernetes cluster. It runs a job that self-deletes when mirrord terminates. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
