<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Leo Snetsinger</title>
	<atom:link href="https://www.leosnetsingerengineer.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.leosnetsingerengineer.com/</link>
	<description></description>
	<lastBuildDate>Thu, 04 Sep 2025 18:11:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>Scaling ML Deployment with Ray Serve on Kubernetes: A Practical Guide for DevOps Teams</title>
		<link>https://www.leosnetsingerengineer.com/scaling-ml-deployment-with-ray-serve-on-kubernetes-a-practical-guide-for-devops-teams/</link>
		
		<dc:creator><![CDATA[Leo Snetsinger]]></dc:creator>
		<pubDate>Thu, 04 Sep 2025 18:11:46 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.leosnetsingerengineer.com/?p=79</guid>

					<description><![CDATA[<p>Why Ray Serve? And Why Now? Machine learning (ML) workloads are maturing fast. What used to be experimental notebooks are now powering real-time user experiences, from recommendations to fraud detection. And with that shift comes pressure — pressure to deploy faster, scale reliably, and recover smoothly. That’s where Ray Serve steps in. Built on top [&#8230;]</p>
<p>The post <a href="https://www.leosnetsingerengineer.com/scaling-ml-deployment-with-ray-serve-on-kubernetes-a-practical-guide-for-devops-teams/">Scaling ML Deployment with Ray Serve on Kubernetes: A Practical Guide for DevOps Teams</a> appeared first on <a href="https://www.leosnetsingerengineer.com">Leo Snetsinger</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Why Ray Serve? And Why Now?</h2>



<p>Machine learning (ML) workloads are maturing fast. What used to be experimental notebooks are now powering real-time user experiences, from recommendations to fraud detection. And with that shift comes pressure — <strong>pressure to deploy faster, scale reliably, and recover smoothly</strong>.</p>



<p>That’s where <strong>Ray Serve</strong> steps in. Built on top of the Ray distributed computing framework, Ray Serve gives you an elegant, scalable, and Python-native way to deploy ML models as APIs.</p>



<p>But like any powerful tool, it needs a strong foundation. And for that, we turn to Kubernetes.</p>



<p>In this blog, I’ll walk through how I’ve deployed production-grade ML services using Ray Serve on Kubernetes — and what DevOps teams need to know to make it work smoothly. No hype, no jargon — just practical architecture, lessons learned, and a few bruises I earned along the way.</p>



<h2 class="wp-block-heading">The Architecture at a Glance</h2>



<p>Let’s start with a high-level overview of how it fits together:</p>



<ul class="wp-block-list">
<li><strong>Kubernetes (EKS/GKE)</strong>: The orchestrator, managing nodes, scaling, and pod lifecycles.<br></li>



<li><strong>Ray Cluster</strong>: A set of Ray pods managed as a RayHead and RayWorker setup.<br></li>



<li><strong>Ray Serve</strong>: Deployed inside the RayHead pod — this is where your model-serving logic lives.<br></li>



<li><strong>Model API</strong>: Your Python model, wrapped in a FastAPI-compatible Ray Serve deployment.<br></li>



<li><strong>Ingress (like NGINX or ALB)</strong>: Routes traffic to the Ray Serve HTTP proxy.<br></li>



<li><strong>Monitoring (Prometheus + Grafana)</strong>: Metrics tracking CPU, memory, and inference latency.<br></li>
</ul>



<p>This setup allows you to deploy any Python-based model — from scikit-learn to PyTorch — as a scalable, auto-replicated service with built-in request batching, versioning, and A/B testing.</p>



<h2 class="wp-block-heading">Step 1: Setting Up Ray on Kubernetes</h2>



<p>Ray has native support for Kubernetes via the<a href="https://docs.ray.io/en/latest/cluster/kubernetes.html"> Ray Operator</a>. Here&#8217;s what you need:</p>



<ol class="wp-block-list">
<li><strong>Install the Ray Operator</strong> using Helm:<br></li>
</ol>



<p>helm repo add ray https://ray-project.github.io/ray-helm/</p>



<p>helm install ray-operator ray/ray-operator</p>



<ol start="2" class="wp-block-list">
<li><br><strong>Define a RayCluster YAML</strong>, which sets up:<br>
<ul class="wp-block-list">
<li>A head pod to run the Ray dashboard and controller.<br></li>



<li>One or more worker pods that execute tasks and handle model replicas.<br></li>
</ul>
</li>



<li><strong>Apply the cluster manifest</strong>:<br></li>
</ol>



<p>kubectl apply -f ray-cluster.yaml</p>



<p>Once the cluster is up, you’ll use the head pod as your deployment target for Ray Serve applications.</p>



<h2 class="wp-block-heading">Step 2: Deploying Your Model with Ray Serve</h2>



<p>Ray Serve uses decorators to wrap your model function or class and expose it via HTTP.</p>



<p>Here’s a basic example:</p>



<p>from ray import serve</p>



<p>import joblib</p>



<p>@serve.deployment</p>



<p>class MyModel:</p>



<p>&nbsp;&nbsp;&nbsp;&nbsp;def __init__(self):</p>



<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.model = joblib.load(&#8220;/models/my_model.pkl&#8221;)</p>



<p>&nbsp;&nbsp;&nbsp;&nbsp;async def __call__(self, request):</p>



<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input_data = await request.json()</p>



<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prediction = self.model.predict([input_data[&#8220;features&#8221;]])</p>



<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return {&#8220;prediction&#8221;: prediction.tolist()}</p>



<p>To deploy this to your running Ray cluster:</p>



<p>serve.run(MyModel.bind())</p>



<p>From here, you get a REST endpoint for inference. Want auto-scaling? Just add .options(num_replicas=3) to your deployment.</p>



<h2 class="wp-block-heading">Step 3: Exposing Ray Serve to the Outside World</h2>



<p>Ray Serve includes an HTTP proxy inside the head pod, but it’s internal by default. To expose it:</p>



<ol class="wp-block-list">
<li>Create a Kubernetes <strong>Service</strong> for the Ray Serve HTTP port (default: 8000).<br></li>



<li>Use an <strong>Ingress controller</strong> (like NGINX or ALB) to route external traffic.<br></li>



<li>(Optional) Add an API Gateway for authentication or rate limiting.<br></li>
</ol>



<p>For production, make sure to:</p>



<ul class="wp-block-list">
<li>Terminate TLS at the ingress layer.<br></li>



<li>Use readiness probes for Ray pods.<br></li>



<li>Set autoscaling limits on the RayCluster to avoid overconsumption.<br></li>
</ul>



<h2 class="wp-block-heading">Observability and Resilience</h2>



<p>No deployment is complete without monitoring.</p>



<p>Here’s what I monitor in every Ray Serve deployment:</p>



<ul class="wp-block-list">
<li><strong>Inference latency</strong> (per endpoint)<br></li>



<li><strong>Queue depth and backlog</strong> (Ray metrics)<br></li>



<li><strong>CPU and memory</strong> usage per pod<br></li>



<li><strong>Model load failures</strong><strong><br></strong></li>



<li><strong>Error rates (HTTP 5xx)</strong><strong><br></strong></li>
</ul>



<p>Prometheus can scrape Ray’s built-in metrics, and Grafana makes it easy to visualize trends. Alerting on model errors or traffic spikes can save you a ton of fire drills.</p>



<p>Also, remember: Ray Serve supports <strong>rolling updates</strong>, so you can push new models without downtime. That’s a DevOps dream.</p>



<h2 class="wp-block-heading">Scaling Tips from Real-World Use</h2>



<p>Over time, I’ve learned a few things that might help your team:</p>



<ul class="wp-block-list">
<li><strong>Use node affinity</strong> to co-locate Ray worker pods for better performance.<br></li>



<li><strong>Package models separately</strong> from code — use object stores or persistent volumes.<br></li>



<li><strong>Set </strong><strong>num_cpus</strong><strong> per deployment</strong> to avoid oversubscribing pods.<br></li>



<li><strong>Batch requests</strong> if you expect high-throughput inference (Ray makes this easy).<br></li>



<li><strong>Avoid stateful logic</strong> inside Ray deployments unless you really know what you&#8217;re doing.<br></li>
</ul>



<h2 class="wp-block-heading">Common Pitfalls to Avoid</h2>



<p>Let me save you some pain:</p>



<ul class="wp-block-list">
<li><strong>Don’t use default resource limits</strong>. Ray needs memory and CPU to scale properly.<br></li>



<li><strong>Don’t run your Ray cluster in the same namespace as unrelated workloads.</strong><strong><br></strong></li>



<li><strong>Avoid using large models without lazy loading</strong> — startup times will kill your rollout performance.<br></li>



<li><strong>Remember: Ray clusters don’t persist state</strong> between pod terminations unless you configure volume mounts.<br></li>
</ul>



<h2 class="wp-block-heading">Empowering DevOps to Own ML Deployment</h2>



<p>If you’re a DevOps engineer, ML deployment might seem like “someone else’s problem.” But that’s changing. As ML becomes a core part of business logic, <strong>it belongs in your pipeline</strong> — monitored, versioned, and deployed like any other service.</p>



<p>Ray Serve on Kubernetes is the toolset that brings ML to our world — the world of reproducibility, automation, and scale.</p>



<p>The next time your data science team hands you a “model to productionize,” don’t just duct tape Flask onto it. Give it a home in your infrastructure. Give it observability. Give it failover.</p>



<p>In short: treat it like you would any critical microservice.</p>



<p>Because now, it is.</p>
<p>The post <a href="https://www.leosnetsingerengineer.com/scaling-ml-deployment-with-ray-serve-on-kubernetes-a-practical-guide-for-devops-teams/">Scaling ML Deployment with Ray Serve on Kubernetes: A Practical Guide for DevOps Teams</a> appeared first on <a href="https://www.leosnetsingerengineer.com">Leo Snetsinger</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>From Kubernetes to Crustaceans: Applying DevOps Principles to Sustainable Aquaculture</title>
		<link>https://www.leosnetsingerengineer.com/from-kubernetes-to-crustaceans-applying-devops-principles-to-sustainable-aquaculture/</link>
		
		<dc:creator><![CDATA[Leo Snetsinger]]></dc:creator>
		<pubDate>Thu, 04 Sep 2025 18:09:11 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.leosnetsingerengineer.com/?p=76</guid>

					<description><![CDATA[<p>Bridging the Worlds of Tech and Aquaculture As a senior platform engineer, I&#8217;ve spent over a decade working with cloud-native infrastructure. My daily tools included Kubernetes, GitOps, CI/CD pipelines, and enough YAML to fill a novel. But lately, I’ve found myself applying those same tools — or at least the thinking behind them — to [&#8230;]</p>
<p>The post <a href="https://www.leosnetsingerengineer.com/from-kubernetes-to-crustaceans-applying-devops-principles-to-sustainable-aquaculture/">From Kubernetes to Crustaceans: Applying DevOps Principles to Sustainable Aquaculture</a> appeared first on <a href="https://www.leosnetsingerengineer.com">Leo Snetsinger</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Bridging the Worlds of Tech and Aquaculture</h2>



<p>As a senior platform engineer, I&#8217;ve spent over a decade working with cloud-native infrastructure. My daily tools included Kubernetes, GitOps, CI/CD pipelines, and enough YAML to fill a novel. But lately, I’ve found myself applying those same tools — or at least the thinking behind them — to a completely different domain: indoor shrimp farming.</p>



<p>Running my aquaculture startup, Homeland Shrimp, I’ve realized something simple but powerful: the mindset and principles we use in DevOps don’t stop at the data center. In fact, they translate beautifully to building and maintaining environmentally controlled systems in the physical world — where reliability, observability, and automation are just as critical.</p>



<p>This post is a deep dive into how lessons from infrastructure engineering are helping me sustainably raise Pacific white shrimp — and how you can use DevOps thinking beyond the screen.</p>



<h2 class="wp-block-heading">Infrastructure as Code → Infrastructure as Ecosystem</h2>



<p>In cloud infrastructure, we treat our architecture as code. Everything is declarative, repeatable, and version-controlled. You want your system to spin up the same way every time, regardless of who’s deploying it or where it’s running.</p>



<p>In aquaculture, I’ve come to treat the tank environment the same way.</p>



<p>Each tank is a system. It has inputs (feed, oxygen, temperature control), outputs (ammonia, waste, growth), and defined state goals: stable pH, optimal temperature, dissolved oxygen levels. Just like cloud infrastructure, it needs to be configured, monitored, and tuned for uptime and performance.</p>



<p>My background in defining predictable environments with Kubernetes gave me the discipline to build precision control into the physical world — and it’s working. I know what “healthy” looks like in the same way a production cluster knows what “running” looks like.</p>



<h2 class="wp-block-heading">Observability: You Can’t Fix What You Can’t See</h2>



<p>In platform engineering, we build dashboards with metrics like CPU usage, error rates, and deployment status. These let us make fast, informed decisions — and alert us before users even notice something is wrong.</p>



<p>Shrimp don’t file support tickets. But they <em>do</em> give off signals — and if you’re paying attention, they’re just as valuable.</p>



<p>I monitor real-time data from sensors tracking temperature, oxygen saturation, ammonia, nitrates, and water flow. These sensors are my Prometheus. My dashboard isn&#8217;t Grafana, but it performs the same function: visualizing system health.</p>



<p>When oxygen levels start to drop, I don’t wait for shrimp to react. I get alerted and let automation kick in. That’s the same feedback loop I’ve relied on in GitOps-based environments — only this one keeps creatures alive.</p>



<h2 class="wp-block-heading">Kubernetes Taught Me to Design for Failure</h2>



<p>Kubernetes assumes that things will break. Pods die. Nodes flake. Containers crash. And that’s OK — because the system recovers automatically.</p>



<p>That principle — “design for failure” — has had a huge influence on how I built Homeland Shrimp.</p>



<p>For example, my heat exchange system doesn’t just work when the power’s on. It holds temperature using passive design principles and thermodynamic insulation. My oxygenation system doesn’t rely on one pump. There are redundant systems that keep water flowing even if something breaks.</p>



<p>This mindset — learned from years of dealing with flaky clusters — is helping me build a shrimp farm that can survive a Minnesota winter power outage or a failed valve without total catastrophe. Resilience isn’t optional when your uptime includes living creatures.</p>



<h2 class="wp-block-heading">GitOps and Aquaculture: It’s All About the Source of Truth</h2>



<p>One of my favorite DevOps concepts is GitOps — managing your infrastructure declaratively, with Git as the source of truth. If your live system drifts from that declared state, the controller steps in and brings it back into sync.</p>



<p>I’ve applied this thinking to how I document, track, and manage the operation of my tanks.</p>



<p>Every feed schedule, filter clean, water change, and sensor calibration gets logged. I track what works, what doesn’t, and version-control key environmental parameters. When something goes wrong, I can roll back to a known-good configuration — just like a Kubernetes deployment.</p>



<p>It’s not flashy, but it gives me confidence. When you&#8217;re dealing with biological systems, knowing what changed — and when — is the difference between a hiccup and a disaster.</p>



<h2 class="wp-block-heading">Automating the Mundane, Prioritizing the Critical</h2>



<p>In DevOps, we automate the repetitive so we can focus on the strategic. Jenkins, ArgoCD, and Terraform run our routines so we can think about system design and scale.</p>



<p>In my shrimp farm, I’ve automated lighting, oxygen cycles, feeding routines, and temperature adjustments. Not because I’m lazy — but because it frees me up to focus on long-term system health, growth rates, and infrastructure improvements.</p>



<p>Every minute I save not having to manually flip a switch is a minute I can use to optimize a filter design or improve shrimp welfare. Automation, whether digital or mechanical, gives me leverage.</p>



<h2 class="wp-block-heading">Why This Matters: Sustainability and Scalability</h2>



<p>At its core, this fusion of DevOps and aquaculture isn’t just a fun side project — it’s a model for sustainable, scalable food production.</p>



<p>Raising shrimp indoors with closed-loop systems and precision control allows us to:</p>



<ul class="wp-block-list">
<li>Reduce water waste<br></li>



<li>Avoid harmful chemicals<br></li>



<li>Lower energy usage<br></li>



<li>Produce clean, local protein with low environmental impact<br></li>
</ul>



<p>And by borrowing from DevOps — monitoring, automation, resilience — we can scale this model without compromising on quality or ethics.</p>



<h2 class="wp-block-heading">Build Systems That Take Care of Themselves</h2>



<p>The biggest lesson I’ve learned from both Kubernetes and crustaceans is this:</p>



<p>If you build it right, it takes care of itself.</p>



<p>Whether it’s a cluster or a tank, a system should be observable, resilient, and recoverable. The more you listen to its feedback and respect its complexity, the better your outcomes will be.</p>



<p>Engineering isn’t just about servers or code. It’s a mindset — and when you bring that mindset to the physical world, incredible things can happen.</p>



<p>From YAML to oxygenation loops, from rollbacks to water changes — it’s all just infrastructure. And I’ve never been more excited to build it.</p>
<p>The post <a href="https://www.leosnetsingerengineer.com/from-kubernetes-to-crustaceans-applying-devops-principles-to-sustainable-aquaculture/">From Kubernetes to Crustaceans: Applying DevOps Principles to Sustainable Aquaculture</a> appeared first on <a href="https://www.leosnetsingerengineer.com">Leo Snetsinger</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
