<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yonathan Shtekel on Medium]]></title>
        <description><![CDATA[Stories by Yonathan Shtekel on Medium]]></description>
        <link>https://medium.com/@yonathanshtekel?source=rss-ba364b8d1c11------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*a3qJL30xGm-yLCgprF8H4g.jpeg</url>
            <title>Stories by Yonathan Shtekel on Medium</title>
            <link>https://medium.com/@yonathanshtekel?source=rss-ba364b8d1c11------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 09:35:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yonathanshtekel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Got AI to Manage My Kubernetes Dev Environments]]></title>
            <link>https://medium.com/@yonathanshtekel/how-i-got-ai-to-manage-my-kubernetes-dev-environments-cbc7c4e5dc32?source=rss-ba364b8d1c11------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbc7c4e5dc32</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Yonathan Shtekel]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 20:59:47 GMT</pubDate>
            <atom:updated>2025-04-16T20:59:47.413Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*qoh7LCbEk6mHlYVxHyEhPQ.png" /></figure><p><strong>I Wanted to Learn What MCP Is</strong></p><p>The best way to learn something new? Get your hands dirty.So instead of reading long documents or watching endless tutorials, I built something real. I stumbled across this thing called MCP—Model Context Protocol and thought, &quot;What if I could get ChatGPT to manage my Kubernetes dev environments?&quot; Spoiler: I did.</p><p><strong>What Is MCP (In Human Words)?</strong></p><p>At its core, MCP is a protocol that lets an LLM talk to a server that provides a service, an action, or some real-time data.</p><p>That might sound fancy, but here’s a simple way to look at it:</p><p>An LLM (like ChatGPT) knows what it was trained on — but it doesn’t know, for example, how many open support tickets your team currently has. Why? Because that data lives in your system, not inside the model.</p><p>But if you give the model access to a server that can answer that question, it could just ask: “How many open tickets are assigned to Yonathan?” and get a live response.</p><p>That’s the magic of MCP — turning static models into dynamic agents that can <strong>do stuff</strong> in the real world.</p><p>Imagine if your AI assistant could do more than answer questions. What if it could actually <strong>do stuff</strong> — like call APIs, fetch data, or delete things from your infrastructure?</p><p>That’s what MCP lets it do.</p><p><strong>It’s Built on Two Pieces:<br></strong>- <strong>MCP Client</strong> — this is the thing that connects the AI to the real world.<br>- <strong>MCP Server</strong>— the thing that actually *does* the action (delete an environment, list services, etc).</p><p>The client could be:<br>- ChatGPT (with the right plugin)<br>- Claude Desktop<br>- `mcp-cli` on your machine<br>- A local model running from your laptop</p><p>They all speak the same protocol and know how to call tools you define on the server.</p><p><strong>How They Talk</strong><br>MCP uses<strong> JSON-RPC</strong> to send requests and get responses. Pretty standard stuff. For long-running tasks (like deploying), it uses <strong>Server-Sent Events (SSE)</strong> to stream updates.</p><p>Simple, clean, and modern.</p><p><strong>What’s DynamicEnv?</strong></p><p>This is something we built at Riskified.</p><p>DynamicEnv is a Kubernetes Operator that helps developers spin up dev and test environments on demand — without needing a dedicated staging cluster for everything.</p><p>Instead of duplicating all your microservices, you just deploy the one you’re working on, and everything else routes through production versions using Istio.</p><p><strong>Why Should You Care?</strong></p><p>- <strong>Saves money</strong> — fewer environments = lower cost<br>- <strong>Fast dev loops</strong> — anyone can get their own sandbox<br>- <strong>Safe testing</strong> — it feels like staging, but scoped to you<br>- <strong>Realistic</strong> — uses the same configs and infra as prod</p><p>It’s super useful when you’re working with lots of microservices and don’t want to wait around for staging to be free.</p><p><strong>What I Did</strong></p><p>I wrote an MCP Server that talks to DynamicEnv in Kubernetes.</p><p>It exposes tools like:<br>- ✅ List all environments<br>- ✅ Get status (pods, logs, health)<br>- ✅ Delete environments safely<br>- ✅ Let AI trigger these tools directly</p><p>Now I can ask GPT to “delete dev-abc” and it just does it.</p><p><strong>Code Examples</strong></p><p>Here’s how I exposed some of those tools using Python and the `FastMCP` library:</p><p><strong>Delete</strong> <strong>an</strong> <strong>environment</strong></p><pre>@mcp.tool(name=&quot;delete_dynamicenv&quot;, description=&quot;Delete a DynamicEnv instance&quot;)<br>async def delete_dynamicenv(env_id: str, namespace: str = &quot;default&quot;) -&gt; DeleteResponse:<br> async with get_k8s_context() as clients:<br> return await delete_dynamicenv_instance(clients, env_id, namespace)</pre><p><strong>Get environment status (with logs!)</strong></p><pre>@mcp.tool(<br> name=&quot;get_dynamicenv_status&quot;,<br> description=&quot;Get comprehensive status of a DynamicEnv with progress reporting&quot;<br>)<br>async def get_dynamicenv_status(<br> env_id: str,<br> namespace: str = &quot;default&quot;,<br> include_logs: bool = False,<br> log_lines: int = 50,<br> ctx: Context = None) -&gt; DynamicEnvStatusResponse | dict[str, str]:<br> async with get_k8s_context() as clients:<br> return await get_dynamicenv_detailed_status(<br> clients, env_id, namespace, include_logs, log_lines, ctx<br> )</pre><p><strong>List all environments</strong></p><pre>@mcp.tool(<br> name=&quot;list_dynamicenvs&quot;,<br> description=&quot;List all DynamicEnv instances with optional filtering&quot;<br>)<br>async def list_dynamicenvs(<br> filter: DynamicEnvFilter | None = None<br>) -&gt; list[DynamicEnvSummary] | dict[str, str]:<br> async with get_k8s_context() as clients:<br> return await list_all_dynamicenvs(clients, filter)</pre><p>🛠️ <strong>How the Code Really Works</strong></p><p>One of the most powerful things about large language models?</p><p>They understand <strong>natural language</strong> — and they can reason about it, too.</p><p>So when I expose the get_dynamicenv_status tool, I’m not just returning basic info. I’m <strong>streaming logs directly from the pods</strong> in the dynamic environment.</p><p>That means the model can:</p><ul><li>Analyze logs in real-time</li><li>Spot deployment issues</li><li>Troubleshoot bugs</li><li>Summarize the current health of a service</li></ul><p>Instead of digging through kubectl logs and manually checking deployments, the LLM can look at everything <em>at once</em> — and tell you what’s wrong in seconds.</p><blockquote>💡 <strong>Security note</strong>: If you’re dealing with sensitive logs or production data, you should <em>absolutely</em> run your LLM self-hosted. Keep your company’s data private and avoid leaks to third-party APIs.</blockquote><h4>🧠 Making AI Actually Useful</h4><p>Each @mcp.tool is like a bridge between backend logic and the model — turning something complex into a “button” the AI can press. Here’s a breakdown:</p><ul><li><strong><em>@mcp.tool(…)</em></strong><br>This decorator registers the function so the LLM knows it can call it. It’s discoverable by the MCP protocol and becomes part of the model’s toolkit.</li><li><strong><em>get_k8s_context()</em></strong><br>This async helper handles Kubernetes authentication, sets the correct context, and ensures secure access — <em>without</em> polluting global state.</li><li><strong><em>async def<br></em></strong>All the tools are written asynchronously. Why? Because non-blocking I/O means your service doesn’t freeze up under load. It’s scalable, smooth, and fast.</li><li><strong><em>Return types</em></strong><br>The function can return either custom Python models (like DeleteResponse) or plain dictionaries. MCP serializes the response to JSON and feeds it back to the model — seamlessly.</li></ul><h4>🤖 So What’s Really Happening?</h4><p>Behind the scenes, this isn’t just a friendly chat — it’s a <strong>structured JSON-RPC call</strong>:</p><ol><li>The model identifies the intent</li><li>It chooses the right tool</li><li>MCP turns that intent into a remote procedure call</li><li>Your server handles it and returns the result</li></ol><p>Just like calling an API — but powered by natural language. ✨</p><p>Each tool is like adding a new button to the AI’s interface. Push it, and something <em>actually happens</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QcEE4pB-oyIzFfRTVdunWQ.png" /></figure><h4>🚀 Final Thoughts</h4><p>MCP makes AI more than a chatbot. It becomes a <strong>real teammate</strong> — like an intern who:</p><ul><li>Never gets tired</li><li>Speaks natural language</li><li>And can trigger <em>production-safe</em> actions</li></ul><p>I’ve already wired mine to help manage Kubernetes resources like DynamicEnv.</p><p><strong>links:</strong></p><p><a href="https://github.com/yonathan-shtekel/mcp-server-dynamic-env">https://github.com/yonathan-shtekel/mcp-server-dynamic-env</a></p><p><a href="https://github.com/Riskified/dynamic-environment">https://github.com/Riskified/dynamic-environment</a></p><p><a href="https://linktr.ee/dynamicenv">https://linktr.ee/dynamicenv</a></p><p>Until then — happy building! 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbc7c4e5dc32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DynamicEnv Implementation Use Cases]]></title>
            <link>https://medium.com/riskified-technology/dynamicenv-implementation-use-cases-7178c3da6e79?source=rss-ba364b8d1c11------2</link>
            <guid isPermaLink="false">https://medium.com/p/7178c3da6e79</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[e2e-testing]]></category>
            <category><![CDATA[dynamic-environment]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[e2e]]></category>
            <dc:creator><![CDATA[Yonathan Shtekel]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 11:19:13 GMT</pubDate>
            <atom:updated>2024-07-16T09:47:52.285Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qaN08nGQisdjUjIEe8oeQQ.png" /></figure><p>Welcome back to our DynamicEnv journey!<br>DynamicEnv is an innovative Kubernetes operator designed to empower developers by improving the process of launching on-demand environments. It has simplified the management of numerous services for testing and development purposes, significantly transforming work processes by enabling simultaneous testing to improve efficiency and speed.</p><p>In this blog post, I will share the cases we used to improve the dev cycle using DynamicEnv’s ability to create dev environments easily.</p><p>We’ll explore three use cases:</p><ol><li>The feedback loop for design changes where our designers examine a new website or app design changes.</li><li>E2E test processes, enabling us to establish test environments and conduct E2E tests within those so that everything operates seamlessly from start to finish.</li><li>Equipping each developer with their development environment, remote in this case, where we provide the ability to debug it on the developer’s local machine. This allows developers to modify code and test changes in an environment that closely mirrors production, offering a more accurate and efficient development process.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LT2HOjQInV6Iz-qH.png" /><figcaption>Full use-case diagram</figcaption></figure><p>Let’s break down every use case in this diagram…</p><h3>The instant feedback loop for a design use-case</h3><p>Before the introduction of DynamicEnv, our workflow for reviewing design changes was markedly inefficient.<br>With only a single staging environment available, our designers and front-end developers frequently faced significant delays and bottlenecks. This limitation proved particularly problematic when multiple developers needed to deploy their changes simultaneously, leading to a complex and cumbersome process.<br>The constant conflicts and need to coordinate updates greatly prolonged our review cycles, highlighting the challenges we faced before adopting DynamicEnv.</p><p>By providing teams with the ability to create multiple on-demand environments, DynamicEnv allows developers to deploy their changes to frontend services to individual environments. Instead of waiting in line for one testing area, developers can now use their own testing spaces. This means their changes get reviewed much faster!</p><p>This shift streamlined our review process and fostered a more collaborative and dynamic workflow between our designers and developers.</p><h4>How does it work?</h4><p>A developer who has made UI design changes will commit those to the relevant repo. The CI will trigger this frontend CI, and one of the CI steps will be DynamicEnv, which creates the dev environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cf7kZ5soj7zykeSz.png" /><figcaption>Design feedback use-case diagram</figcaption></figure><h3>E2E tests use-case</h3><p>Before DynamicEnv, teams that wanted to invest in E2E testing faced significant hurdles.<br>The traditional approach involved creating a complete environment with all necessary dependencies — databases, Kafka, third-party dependencies, etc. — using Docker Compose for local testing or deploying to EC2 with an extensive Docker Compose setup.<br>The real pain was the deployment time, and setting up isolated environments for each test or feature required a lot of resources. This became a complex task, especially when dealing with many services.<br>All these factors led to increased operational costs and put a strain on resources.</p><h4>Challenges of traditional approaches</h4><p><strong>Local Docker Compose limitations<em><br></em></strong>Teams with numerous dependencies often configure one large Docker Compose file. This not only puts a substantial load on individual computers but also fails to simulate a production-like environment accurately, primarily because it isn’t Kubernetes-based.</p><p><strong>Drawbacks of EC2 with Docker Compose<br></strong>Another alternative was Docker Compose, deployed on a machine with many resources<strong>.</strong> Deployments were time-consuming due to the lack of a Kubernetes configuration; this setup needed to mirror the production environment closely, making testing less effective.</p><p><strong>Staging environment issues</strong><br>While the staging environment did use Kubernetes, mirroring production more closely, it presented a different set of problems. With multiple teams working on various projects simultaneously, developers often found themselves in conflict, stepping on each other’s toes due to the shared nature of the environment.</p><p><strong>DynamicEnv’s solution<br></strong>With DynamicEnv, isolated development environments can be created very quickly. In the past, setting up a development environment (to test new code) could take up to an hour. The DynamicEnv approach creates these environments in just a few minutes. In this environment, the latest configurations and dependencies can be installed, closely mirroring the production environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cvl_aP1O2HoxRuhF.png" /><figcaption>E2E tests use-case diagram</figcaption></figure><p>In the same way as the Design Feedback use case, the developer commits changes, and the CI pipeline triggers the DynamicEnv step to create the dev environment. After the dev environment is up and running, there is one more step, which involves running the E2E tests against the environment. The results are then sent back to the developer, who can then review them and make any necessary changes.</p><p>How it looks on the CI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FHi7Hy3k4zmpE0-6" /><figcaption>CI pipeline with DynamicEnv example</figcaption></figure><h4>Test platforms</h4><p>Once we have a deployed environment through DynamicEnv, our E2E testing capabilities will significantly expand. Typically, you can use language-specific test frameworks such as Jest for JavaScript, ScalaTest for Scala, PyTest for Python, and more.</p><p>These frameworks are excellent for setting up E2E tests, mainly when focusing on backend functionalities. Teams that use DynamicEnv can also use those frameworks.</p><p>However, at Riskified, we’ve expanded our testing capabilities by supporting two leading test platforms that go beyond traditional language test frameworks, Loadmill and Playwright.</p><p><strong>Loadmill<br></strong>It is a no-code API-driven web platform designed to execute E2E tests. It facilitates the creation of tests based on REST and GRPC requests and supports producing and consuming messages from Kafka via REST using Kafka-Relay.<br>This CI step simplifies the process of incorporating Loadmill’s testing capabilities into our workflows, ensuring that applications are thoroughly vetted for functionality and performance before deployment.</p><p>With Loadmill<strong>, </strong>we focused on backend tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q4cFO22NG14u3cAp" /><figcaption>CI pipeline with Loadmill example</figcaption></figure><p><strong>Playwright<br></strong>It is<strong> </strong>a web testing and automation framework that enables tests across multiple browsers (Chromium, Firefox, and WebKit) using a single API. The Playwright CI step brings the power of Playwright’s testing capabilities into CI workflows.</p><p>It allows for comprehensive testing of web applications across various browser environments to ensure compatibility and performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qfg_4PWpmr2pF7Ix" /><figcaption>CI pipeline with Playwright example</figcaption></figure><h3>Personal dev environment use-case</h3><p>A personal environment is a semi-remote or local environment that can be deployed on a Kubernetes cluster (staging). It is isolated from the shared version (latest), and you can debug your local code in the real-time context of your cloud environment, with access to other microservices, databases, queues, and managed services, all without leaving the local setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*umbeQyQ_gd2uLGZ_.png" /></figure><h3>Personal env diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6_bHWmma0Vfs2DXr.png" /></figure><h4>How it works</h4><p>The developer can deploy a development environment using a CLI that we developed in the DevEx team and then using <strong>Mirrord</strong>; they can debug/run any service in the development environment locally, which means running ​​local processes in the context of their cloud environment.</p><p>Of course, CLI can also run E2E tests against those dev environments in debug mode (locally).</p><h3>Finishing up</h3><h4><strong>Faster development cycles</strong></h4><p>With DynamicEnv, our development cycles have become much shorter. This means we can get from an idea to a finished product faster than before. It’s now easier to set up end-to-end (E2E) tests, which helps us ensure everything works perfectly from start to finish.</p><h4><strong>More accessible design reviews and local environments</strong></h4><p>Reviewing designs quickly and getting feedback has become a breeze. DynamicEnv lets us create separate environments for each new design idea to see what works best without delays. Plus, setting up local environments that mimic our production setup is simpler, letting our developers test new features and fixes quickly and efficiently.</p><h4>What we learned: Growing with DynamicEnv</h4><p>The stories we’ve shared about using DynamicEnv at Riskified are just the beginning. DynamicEnv is improving every day, and so is our team. We’re excited about what we can achieve next with this tool.</p><p>With DynamicEnv, we’re always finding new ways to streamline our work and enhance productivity.<br>We look forward to sharing more about our journey and the new possibilities we discover with DynamicEnv.</p><p>Join DynamicEnv, our open-source project! All are invited. Let’s collaborate!</p><p><a href="https://linktr.ee/dynamicenv">Learn more about DynamicEnv</a> and see how it can make your development easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7178c3da6e79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/riskified-technology/dynamicenv-implementation-use-cases-7178c3da6e79">DynamicEnv Implementation Use Cases</a> was originally published in <a href="https://medium.com/riskified-technology">Riskified Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>