<?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 Ales Loncar on Medium]]></title>
        <description><![CDATA[Stories by Ales Loncar on Medium]]></description>
        <link>https://medium.com/@loncarales?source=rss-4893d9024887------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*x92dqxJDlMezWMe8</url>
            <title>Stories by Ales Loncar on Medium</title>
            <link>https://medium.com/@loncarales?source=rss-4893d9024887------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:25:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@loncarales/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[Let’s Encrypt Certificates for a Home Network, Without Opening a Port]]></title>
            <link>https://medium.com/@loncarales/lets-encrypt-certificates-for-a-home-network-without-opening-a-port-cad322b4862d?source=rss-4893d9024887------2</link>
            <guid isPermaLink="false">https://medium.com/p/cad322b4862d</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[caddy]]></category>
            <category><![CDATA[lets-encrypt]]></category>
            <dc:creator><![CDATA[Ales Loncar]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 00:00:17 GMT</pubDate>
            <atom:updated>2026-11-22T19:48:11.795Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lx-hnq2wI0ooXgXb.png" /></figure><p>My home server runs services that should only ever be reachable from my own network. Until recently, that meant a private certificate authority, and a private CA means setting it up on every device. This post shows how I replaced it with a real Let’s Encrypt certificate without opening a single port to the internet.</p><h3>TL;DR</h3><ul><li>Put your internal services under a subdomain of a domain you already own, for example home.example.com.</li><li>Resolve those names only on your LAN, using a local DNS zone on your router.</li><li>Get a wildcard certificate for *.home.example.com with the ACME <strong>DNS-01</strong> challenge. Let&#39;s Encrypt only checks a temporary TXT record in public DNS; it never connects to your network.</li><li>Renew daily with a systemd timer, and let a deploy hook hand the new certificate to the reverse proxy.</li></ul><h3>The problem: a private CA doesn’t scale to your family’s phones</h3><p>My first setup served the photo app <a href="https://immich.app/">Immich</a> at https://immich.home.arpa. home.arpa is the name space reserved for home networks, and Caddy&#39;s built-in internal CA issued the certificate. It worked on my laptop. But every new device needed two manual steps:</p><ol><li>a hosts entry, because nothing resolved home.arpa;</li><li>trusting Caddy’s root certificate.</li></ol><p>A local DNS zone on the router solves the first step. Nothing solves the second: no public CA issues certificates for .home.arpa, so every device still has to trust the private CA. Phones are the hard part. Immich&#39;s documentation warns that self-signed and private-CA certificates can break mobile upload and video playback, and the mobile app was the main reason the server exists.</p><p>So I set myself three constraints:</p><ul><li><strong>No custom CA or hosts-file entries on each device.</strong> A phone on the home Wi-Fi should just work.</li><li><strong>LAN only.</strong> No port forwarding on the router, and no public A record for any service.</li><li><strong>A certificate every device already trusts.</strong></li></ul><h3>The approach: a public name with a private answer</h3><p>The trick is to separate <em>who issues the certificate</em> from <em>who can reach the service</em>.</p><ul><li><strong>Naming.</strong> I already own a domain whose DNS is hosted at Cloudflare. Internal services live under its home subdomain, for example immich.home.example.com.</li><li><strong>Resolution.</strong> The router’s DNS server holds a local zone for home.example.com with an A record immich pointing to 192.168.10.20, the home server&#39;s LAN address. DHCP hands out the router as the DNS server, so every device on the Wi-Fi gets that answer. Public DNS has no record for these names at all.</li><li><strong>Certificate.</strong> Let’s Encrypt validates domain control through the DNS-01 challenge: the ACME client writes a temporary _acme-challenge TXT record through Cloudflare&#39;s API, Let&#39;s Encrypt looks it up in public DNS, and the client removes it again. Nothing on my network has to accept a connection from the internet.</li></ul><p>I requested a <strong>wildcard</strong>, *.home.example.com, rather than one certificate per service. Let&#39;s Encrypt only issues wildcards through DNS-01, so it costs nothing extra here, and there are two benefits. Every certificate appears in the public Certificate Transparency logs, so a wildcard only reveals that home.example.com exists, not which services run under it. And the next service I add can reuse the same certificate.</p><h3>The pieces</h3><p><strong>Part — Role</strong></p><p>Router DNS - Local zone home.example.com, answers only on the LAN</p><p><a href="https://github.com/go-acme/lego">lego</a> — ACME client that speaks DNS-01 to Cloudflare</p><p>Cloudflare API token — Lets lego write the challenge TXT records</p><p>systemd timer — Checks daily whether renewal is due</p><p>Deploy hook — Copies a renewed certificate to Caddy and reloads it</p><p><a href="https://caddyserver.com/">Caddy</a> — Reverse proxy serving the certificate on the LAN</p><p>Why lego and not Caddy’s own ACME support? Caddy can do DNS-01 itself, but only with a DNS provider module compiled in. The stock Ubuntu package has none, and I wanted to keep the distribution package rather than maintain a custom build. lego is a single static binary, so I pin a release and verify its SHA-256 checksum before installing it.</p><p>Everything below is deployed with Ansible, but the files are short enough to read on their own. The names and addresses are placeholders.</p><h3>The Cloudflare token</h3><p>The token is created from Cloudflare’s “Edit zone DNS” template and limited to the one zone, with two permissions:</p><ul><li><strong>Zone → DNS → Edit</strong>, to write the challenge records;</li><li><strong>Zone → Zone → Read</strong>, which lego needs to look up the zone ID.</li></ul><p>I gave it no expiry. That is a deliberate trade-off: a token that expires breaks renewal silently months later, so instead I rotate it by hand. The other trade-off is scope. The token can edit every record in the zone, not just the home subdomain, so it lives only in my password manager and in one file on the server:</p><pre>/etc/lego/cloudflare-token root:root 0600</pre><p>lego reads it through CF_DNS_API_TOKEN_FILE, so the token never appears on a command line or in the process list.</p><h3>One wrapper for issuing and renewing</h3><p>In lego v5, lego run obtains a certificate when none exists and otherwise renews it once it is inside the renewal window. A small wrapper holds the shared arguments, so the first issuance and every renewal run the same command:</p><pre>#!/bin/sh<br># /usr/local/sbin/lego-run<br>set -eu<br>export CF_DNS_API_TOKEN_FILE=/etc/lego/cloudflare-token<br># Public resolvers: the router&#39;s local home.example.com zone would<br># hide the Cloudflare zone and the challenge records.<br>exec /usr/local/bin/lego run \<br>  --path /var/lib/lego/production \<br>  --server https://acme-v02.api.letsencrypt.org/directory \<br>  --email admin@example.com \<br>  --accept-tos \<br>  --dns cloudflare \<br>  --dns.resolvers 1.1.1.1:53 \<br>  --dns.resolvers 1.0.0.1:53 \<br>  --domains &#39;*.home.example.com&#39; \<br>  &quot;$@&quot;</pre><p>I ran it against the Let’s Encrypt <a href="https://letsencrypt.org/docs/staging-environment/">staging environment</a> first, by swapping the --server URL, so mistakes didn&#39;t count against the production rate limits. Staging and production write to separate --path directories, /var/lib/lego/staging and /var/lib/lego/production. Switching back to production therefore issues a fresh, trusted certificate instead of finding the staging one and deciding it is still valid.</p><h3>The split-horizon catch</h3><p>The two --dns.resolvers lines are the part that cost me time. The server uses the router for DNS like every other device, and the router is authoritative for home.example.com. When lego asked for the zone that contains _acme-challenge.home.example.com, the router answered with its local zone, and lego went looking for a Cloudflare zone called home.example.com that doesn&#39;t exist.</p><p>Pointing lego at public resolvers fixes it: it sees the same DNS as Let’s Encrypt does. Check that the server is allowed to send DNS queries to those resolvers; a firewall that forces all DNS through the router would bring the problem back.</p><p>A second, smaller router lesson: the local zone wouldn’t load ( SERVFAIL) until the name server record that the router created for the zone also had an A record. Test the zone with dig before blaming the certificate.</p><h3>Daily renewal</h3><p>A one-shot service runs the wrapper with a deploy hook:</p><pre># /etc/systemd/system/lego-renew.service<br>[Unit]<br>Description=Renew the home.example.com wildcard certificate<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>Type=oneshot<br>ExecStart=/usr/local/sbin/lego-run --deploy-hook /usr/local/sbin/caddy-install-certificate</pre><p>A timer starts it once a day. RandomizedDelaySec spreads the requests, and Persistent=true catches up on a run missed while the server was off:</p><pre># /etc/systemd/system/lego-renew.timer<br>[Unit]<br>Description=Daily home.example.com certificate renewal check<br><br>[Timer]<br>OnCalendar=daily<br>RandomizedDelaySec=1h<br>Persistent=true<br><br>[Install]<br>WantedBy=timers.target</pre><p>Enable it with systemctl enable --now lego-renew.timer, and check the next run with systemctl list-timers lego-renew.timer.</p><p>Most days lego logs “Skip renewal” and exits. That is the ex</p><h3>Handing the certificate to Caddy</h3><p>lego writes its files as root with mode 0600, and Caddy runs as its own user. Rather than loosen permissions on lego’s directory, the deploy hook installs a copy that the caddy group can read and then reloads Caddy:</p><pre>#!/bin/sh<br># /usr/local/sbin/caddy-install-certificate<br>set -eu<br>src=/var/lib/lego/production/certificates/_.home.example.com<br>install -o root -g caddy -m 0640 &quot;$src.crt&quot; /etc/caddy/tls/home.example.com.crt<br>install -o root -g caddy -m 0640 &quot;$src.key&quot; /etc/caddy/tls/home.example.com.key<br>systemctl reload caddy</pre><p>A few details make this work:</p><ul><li>install doesn&#39;t create directories, so /etc/caddy/tls has to exist first. Mine is root:caddy, mode 0750.</li><li>The source path is the production one. While you test against staging, point the hook at /var/lib/lego/staging instead. Alternatively, read the paths from LEGO_HOOK_CERT_PATH and LEGO_HOOK_CERT_KEY_PATH, which lego v5 sets for the hook.</li><li>systemctl reload caddy only works because the unit shipped with Caddy&#39;s packages runs caddy reload --force as its ExecReload. The Caddyfile hasn&#39;t changed, only the certificate files, and --force makes Caddy reload anyway, including manually loaded certificates. If you run Caddy another way, make sure your reload uses --force too.</li></ul><p>lego only calls the hook after it has actually obtained a new certificate, so the daily runs don’t reload Caddy for nothing. That has a downside. lego saves the new certificate <em>before</em> it runs the hook. If the hook fails, lego reports an error, but the next daily run finds a fresh certificate, logs “Skip renewal” and never runs the hook again. Caddy would keep serving the old certificate until it expires. So after a renewal, compare what lego saved with what Caddy actually serves:</p><pre># What lego saved<br>openssl x509 -noout -enddate \<br>  -in /var/lib/lego/production/certificates/_.home.example.com.crt<br># What Caddy serves<br>openssl s_client -connect immich.home.example.com:443 \<br>  -servername immich.home.example.com &lt;/dev/null 2&gt;/dev/null \<br>  | openssl x509 -noout -enddate</pre><p>The two dates should match.</p><p>Caddy then loads the files directly and refuses anything that doesn’t come from the LAN (trimmed; 10.10.0.20 is the Immich VM&#39;s address, and the IPv6 prefix is a documentation placeholder):</p><pre>immich.home.example.com {<br> tls /etc/caddy/tls/home.example.com.crt /etc/caddy/tls/home.example.com.key<br> @outside not remote_ip private_ranges 2001:db8:1234:5678::/64<br> respond @outside &quot;LAN access only&quot; 403<br> reverse_proxy 10.10.0.20:2283<br>}</pre><p>private_ranges is Caddy&#39;s shortcut for the private IPv4 ranges plus fd00::/8 and ::1. It doesn&#39;t cover the global IPv6 prefix your provider assigns to your LAN, so add that yourself if your devices use IPv6, and update it if your provider changes the prefix.</p><p>This remote_ip line is the form I recommend, not a copy of the config on my server. Mine lists the IPv4 LAN and the internal network between Caddy and Immich explicitly.</p><p>The remote_ip rule is a second line of defence, not the main one. It only works if the client&#39;s address reaches Caddy unchanged, so check that any port forwarding in front of the proxy doesn&#39;t rewrite the source address. Over IPv4, the protection is that nothing is forwarded from the internet. IPv6 is different. If the server has a public IPv6 address, there is no NAT and no port forwarding involved, and the only thing between it and the internet is the router&#39;s firewall. Make sure that firewall blocks unsolicited inbound IPv6 connections. Check it rather than assume it.</p><h3>Retiring the private CA</h3><p>I didn’t switch over in one step. During the cutover, Caddy served both names: the old immich.home.arpa with its internal CA, and the new name with the Let&#39;s Encrypt certificate. Only once every device in the house was confirmed to use the new name did I remove the old site block and stop exporting the internal root certificate. If you trusted that root on your devices, remove it from them as well; a trusted CA you no longer use is a risk without a purpose.</p><h3>Result</h3><p>I set this up and checked it on 1 November 2026:</p><ul><li>The served certificate is CN=*.home.example.com, issued by Let&#39;s Encrypt, and valid for 90 days.</li><li>A browser on the LAN opens the site with no warning, and the Immich app on a phone with no profile or custom certificate installed logs in, uploads and plays video. On Android, that needed Private DNS set to Automatic or Off: with a Private DNS hostname, the phone sends its queries past the router and never sees the local zone.</li><li>Nothing is forwarded from the internet, and public DNS has no record for any service name.</li></ul><p>One part isn’t proven yet. I expect the first renewal around the end of December. So far, the timer has run and correctly skipped renewal, and I ran the deploy hook by hand: it installed the files with the right owner and mode, and Caddy reloaded cleanly. I will update this post once the first real renewal has gone through.</p><h3>Lessons</h3><ul><li><strong>DNS-01 separates trust from reachability.</strong> A service can have a publicly trusted certificate without being publicly reachable.</li><li><strong>Split-horizon DNS affects your ACME client too.</strong> If the server resolves through the same local zone as everyone else, point the ACME client at public resolvers.</li><li><strong>Use the staging directory first, with its own storage path.</strong></li><li><strong>Check what the proxy serves, not just what the ACME client saved.</strong> A failed deploy hook isn’t retried.</li><li><strong>“No port forwarding” only covers IPv4.</strong> With IPv6, the router’s firewall is what keeps the service private.</li><li><strong>Expiring credentials can turn into silent renewal failures.</strong> If you choose a token without an expiry, keep its scope small and rotate it on a schedule.</li><li><strong>Keep the old path running until the last device has moved.</strong></li></ul><p><em>Originally published at </em><a href="https://loncar.net/posts/lets-encrypt-certificates-home-network-without-opening-a-port/"><em>https://loncar.net</em></a><em> on November 22, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cad322b4862d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pereci]]></title>
            <link>https://medium.com/@loncarales/pereci-9601c6a51077?source=rss-4893d9024887------2</link>
            <guid isPermaLink="false">https://medium.com/p/9601c6a51077</guid>
            <category><![CDATA[recipe]]></category>
            <category><![CDATA[homemade]]></category>
            <category><![CDATA[food]]></category>
            <category><![CDATA[foodies]]></category>
            <category><![CDATA[baking]]></category>
            <dc:creator><![CDATA[Ales Loncar]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 00:00:39 GMT</pubDate>
            <atom:updated>2026-04-29T19:01:44.343Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RRwA9nbrjQJpMYfz.jpg" /></figure><p>Pereci are traditional braided bread rolls that sit somewhere between a pretzel and a bread roll. They can be enjoyed on their own or served alongside a hearty stew.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*z7ak7RpH6AFLwT1aUDJy9g.png" /></figure><h3>Ingredients</h3><ul><li>1 kg wheat flour</li><li>40 g yeast</li><li>1 tablespoon sugar</li><li>5–6 dl milk</li><li>25 g lard or oil</li><li>salt</li><li>egg and milk, for brushing</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ngdB6LGvLZbyZTsS.jpg" /><figcaption>Form the spiral into a ring and gently press the ends together</figcaption></figure><h3>Instructions</h3><ol><li>Start by preparing the yeast mixture: crumble the yeast into a bowl, then add 2 tablespoons of lukewarm milk, 1 tablespoon of sugar, and 2 tablespoons of flour.</li><li>Once the yeast has activated, mix it into the flour.</li><li>Knead everything together into a medium-firm dough. When the dough becomes elastic, add the lard or oil.</li><li>Knead until the dough is smooth and develops bubbles. Flatten it slightly in a bowl and cover it with a clean kitchen towel.</li><li>Leave the dough to rise in a warm place until doubled in size.</li><li>Turn the dough out onto a lightly floured surface and shape it into pencil-thick rolls.</li><li>Shape each roll into a circle, then cut it in half and twist the two strands into a spiral.</li><li>Form the spiral into a ring and gently press the ends together.</li><li>Let the shaped dough rise for about 20 minutes. Brush with beaten egg and milk, then bake.</li><li>Bake in a conventional oven at 200 °C until golden, then reduce the heat to 175 °C and bake until fully cooked, about 10 minutes in total.</li><li>Cover the baked rolls with a kitchen towel to keep them soft.</li></ol><h3>Notes</h3><p>There are many versions of this recipe. Pereci were brought from neighboring Hungary to Slovenia and are especially typical of Prekmurje, where different ethnic communities have long lived side by side.</p><p>Vesela kuharija 😋👌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gtz7ScmAK6Vz5y-_q1a6g.jpeg" /><figcaption>Bake in a conventional oven at 200 °C until golden, then reduce the heat to 175 °C and bake until fully cooked, about 10 minutes in total.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u8SN_usReAtgFq-Z.jpg" /><figcaption>Soft, golden pereci rings cooling in a kitchen towel</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ik1l54kCYJic-Q4C.jpg" /><figcaption>Twisted pereci rings with black cumin seeds, just out of the oven</figcaption></figure><p><em>Originally published at </em><a href="https://loncar.net/recipes/pereci/"><em>https://loncar.net</em></a><em> on April 11, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9601c6a51077" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run Ollama & OpenWebUI on Minikube: Zero-Config, Cross-Platform, TLS-Ready]]></title>
            <link>https://medium.com/@loncarales/run-ollama-openwebui-on-minikube-zero-config-cross-platform-tls-ready-3a9e59dd6353?source=rss-4893d9024887------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a9e59dd6353</guid>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[open-webui]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[tls]]></category>
            <dc:creator><![CDATA[Ales Loncar]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 08:19:44 GMT</pubDate>
            <atom:updated>2025-06-24T11:28:43.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IrhChl4iQlcjAFnB.png" /></figure><p>This image is a conceptual representation and does not reflect the exact service architecture of Ollama and OpenWebUI on Minikube.</p><blockquote><em>Skip the pain of complex AI deployments and GPU requirements. Use Minikube + Ollama + OpenWebUI to get a complete local LLM stack with HTTPS in one command — works on any machine with or without GPU.</em></blockquote><p>Running large language models (LLMs) locally has never been easier. What if I told you that you could deploy a complete AI stack with Ollama and OpenWebUI on Kubernetes with just <strong>one command</strong>? There are no complex configurations or manual setup steps — just pure automation.</p><p>This project lets you deploy <a href="https://ollama.ai/">Ollama</a> and <a href="https://github.com/open-webui/open-webui/">OpenWebUI</a> on <a href="https://minikube.sigs.k8s.io/">Minikube</a> with a single command. It works on <strong>Linux</strong>, <strong>macOS</strong>, and <strong>Windows</strong>, with or without GPU support, and includes:</p><ul><li>🔐 HTTPS via mkcert and cert-manager</li><li>🧠 Internal LLM inference via Ollama</li><li>🖥️ Beautiful web UI via OpenWebUI</li><li>⚙️ Optional GPU acceleration with CUDA/NVIDIA (only on Linux)</li><li>📦 Fully scripted deployment with a Makefile</li></ul><h3>💡 Why Run LLMs Locally?</h3><p>Before diving into the technical details, let’s talk about why you’d want to run AI models locally instead of using cloud services:</p><ul><li>✅ <strong>Privacy &amp; Control</strong>: Your sensitive data never leaves your machine. This is crucial for businesses handling confidential information or developers working on proprietary projects.</li><li>✅ <strong>Zero subscription fees</strong>: No monthly subscription fees or pay-per-token costs. Once you have the hardware, your AI inference is free.</li><li>✅ <strong>Performance</strong>: Lower latency compared to API calls to cloud services, significant for real-time applications.</li><li>✅ <strong>Customisation</strong>: Full control over model selection, fine-tuning, and configuration without platform limitations.</li><li>✅ <strong>Cross-Platform Compatibility</strong>: Works on Linux, macOS, and Windows.</li><li>✅ <strong>GPU Optional</strong>: Automatically detects GPU availability and falls back to CPU-only mode when needed.</li><li>✅ <strong>Learning</strong>: Perfect for understanding how AI systems work under the hood and experimenting with different models.</li></ul><h4>The Challenge with Local AI Deployment</h4><ul><li>Setting up a local AI stack traditionally involves multiple steps:</li><li>Configuring GPU drivers and CUDA (if available)</li><li>Setting up container runtimes</li><li>Managing networking and ingress</li><li>Handling SSL certificates</li><li>Coordinating multiple services</li><li>Platform-specific configurations</li></ul><p>This complexity often deters developers from experimenting with local AI deployments. That’s precisely the problem I wanted to solve.</p><h3>⚡️ Cross-Platform and GPU-Optional</h3><p>When I first created this project, it was primarily focused on Linux systems with NVIDIA GPUs. However, I’ve evolved the solution to be more universal:</p><ul><li><strong>Cross-Platform Support</strong>: The deployment now works seamlessly on Linux, macOS, and Windows. The automation detects the platform and configures everything accordingly.</li><li><strong>NVIDIA GPU Detection</strong>: Don’t have a GPU? No problem! The system automatically detects NVIDIA GPU availability in the Minikube and gracefully falls back to CPU-only mode. This means you can run AI models on any modern machine, from high-end workstations to modest laptops.</li><li><strong>Intelligent Configuration</strong>: The Makefile and deployment scripts now include detection logic that adapts to your specific environment, eliminating the need for manual configuration changes.</li></ul><h3>🚀 Introducing Zero-Config LLM Deployment</h3><p>My solution provides a <strong>single command</strong> that handles everything automatically:</p><pre>make</pre><p>That’s it. This one command:</p><ul><li>Starts Minikube with GPU support (if available)</li><li>Configures ingress and networking</li><li>Sets up SSL certificates</li><li>Deploys Ollama for model serving</li><li>Deploys OpenWebUI for the web interface</li><li>Verifies the installation</li></ul><h4>What You Get Out of the Box</h4><p>The deployment includes:</p><ul><li><a href="https://ollama.ai/"><strong>Ollama</strong></a>: A powerful tool for running LLMs locally with GPU acceleration support. It handles model management and inference, providing a clean API.</li><li><a href="https://github.com/open-webui/open-webui/"><strong>OpenWebUI</strong></a>: A beautiful, ChatGPT-like web interface that connects to Ollama. It offers features such as conversation history, model switching, and file uploads.</li><li><strong>Kubernetes Infrastructure</strong>: Everything runs on <a href="https://minikube.sigs.k8s.io/">Minikube</a>, giving you an environment that’s easy to manage and scale.</li><li><strong>Security</strong>: Automatic TLS certificate generation using <a href="https://cert-manager.io/">cert-manager</a> and <a href="https://github.com/FiloSottile/mkcert">mkcert</a> for secure HTTPS connections.</li><li><strong>Networking</strong>: Proper ingress configuration with a clever DNS solution using <a href="https://traefik.me/">traefik.me</a> for automatic hostname resolution.</li></ul><h3>⚙️ Quick Start Guide</h3><p>Here’s how to get started:</p><h4>Prerequisites</h4><p>You’ll need these core tools installed:</p><ul><li>Minikube</li><li>kubectl</li><li>Helm</li><li>mkcert</li></ul><p>Optional on Linux for GPU acceleration (automatically detected):</p><ul><li>NVIDIA Container Toolkit</li><li>CUDA Toolkit and drivers</li></ul><p>The beauty of the updated solution is that it works regardless of whether you have a high-end GPU setup or a regular laptop. The system detects your capabilities and configures itself accordingly.</p><h4>One-Command Deployment</h4><pre>git clone https://github.com/loncarales/minikube-ollama-lab.git<br>cd minikube-ollama-lab<br>make</pre><h4>Accessing Your AI Stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u3crl-zpwdGc27dl.png" /></figure><p>Web UI via OpenWebUI (with proper local TLS setup)</p><p>Once deployed, open your browser and navigate to:</p><pre># On Linux: When Minikube IP is 192.168.49.2<br>https://openwebui-192-168-49-2.traefik.me<br><br># On macOS and Windows via<br># minikube tunnel (must be running in a shell)<br>https://openwebui-127-0-0-1.traefik.me</pre><p>The hostname automatically resolves to your configured IP using the free traefik.me wildcard DNS service — no /etc/hosts editing required!</p><h3>🔌 Technical Deep Dive</h3><h4>GPU Acceleration (When Available)</h4><p>The setup includes GPU detection and configuration. If you have compatible NVIDIA hardware, it automatically configures GPU passthrough for containers, enabling faster model inference. If not, it seamlessly falls back to CPU-only mode.</p><p>You can verify GPU access (if available) with:</p><pre>kubectl exec -it -n ollama $(kubectl get pods -n ollama -l app.kubernetes.io/name=ollama -o name) -- nvidia-smi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GsXspx56z1ISyxgd.png" /></figure><p>Dynamic distribution between CPU/GPU</p><p>Run a quick inference:</p><pre># Pull a CUDA-compatible model<br>kubectl exec -it -n ollama $(kubectl get pods -n ollama -l app.kubernetes.io/name=ollama -o name) -- ollama pull llama2<br><br># Run a simple inference to test GPU acceleration<br>kubectl exec -it -n ollama $(kubectl get pods -n ollama -l app.kubernetes.io/name=ollama -o name) -- bash -c &#39;echo &quot;Explain quantum computing in simple terms&quot; | ollama run llama2&#39;</pre><p>Monitor GPU usage live (if available) with:</p><pre># In a separate terminal, run:<br>kubectl exec -it -n ollama $(kubectl get pods -n ollama -l app.kubernetes.io/name=ollama -o name) -- watch -n 0.5 nvidia-smi</pre><p>For CPU-only deployments, the models will still run efficiently, just with longer inference times.</p><h4>Customization Options</h4><p>You can customise the deployment with environment variables:</p><pre># Example with custom resource allocation<br>MINIKUBE_MEMORY=8192m MINIKUBE_CPUS=2 make</pre><h3>🌍 Real-World Usage Scenarios</h3><p>This setup is perfect for:</p><ul><li><strong>Development &amp; Testing</strong>: Quickly spin up AI environments for testing applications that integrate with LLMs, regardless of your hardware setup.</li><li><strong>Learning &amp; Experimentation</strong>: Try different models and configurations without incurring cloud costs, making it perfect for students and researchers with varying hardware capabilities.</li><li><strong>Private AI Applications</strong>: Build applications that require data privacy and don’t want to rely on external APIs, accessible to developers across different platforms.</li><li><strong>Prototyping</strong>: Rapid prototyping of AI-powered features before moving to production, lowering the barrier to entry.</li><li><strong>Cross-Platform Development</strong>: Develop AI applications that work consistently across Linux, macOS, and Windows environments.</li><li><strong>Research</strong>: Academic research requiring control over the AI inference pipeline is now accessible to researchers without specialised hardware.</li></ul><h3>🏎️ Performance Considerations</h3><p>To get the best performance:</p><ul><li>Allocate sufficient memory (16GB+ recommended, but 8GB works for smaller models)</li><li>Use multiple CPU cores (4+ recommended)</li><li>If available, ensure your GPU has adequate VRAM for your chosen models</li><li>Consider NVMe storage for faster model loading</li><li>For CPU-only setups, choose models appropriate for your available RAM</li></ul><h3>🩺 Troubleshooting Common Issues</h3><p>The project includes comprehensive troubleshooting documentation, but here are the most common issues:</p><ul><li><strong>Pods Stuck in Pending</strong>: Usually indicates insufficient resources. Increase Minikube’s memory and CPU allocation.</li><li><strong>GPU Not Detected</strong>: Only relevant if you expected GPU acceleration. Verify NVIDIA Container Toolkit installation and Docker runtime configuration. Remember, CPU-only mode is perfectly functional for most use cases.</li><li><strong>Ingress Issues</strong>: Check that the ingress controller is running and verify your Minikube IP address (on Linux).</li></ul><h3>🧪 Try It Yourself</h3><p>The complete project is available on <a href="https://github.com/loncarales/minikube-ollama-lab">GitHub</a>, licensed under the MIT license. Whether you’re a seasoned DevOps engineer or just getting started with AI, and regardless of whether you have a powerful GPU or just a regular laptop, this zero-config approach removes barriers. It lets you focus on what matters: building amazing AI applications. The future of AI development is local, private, accessible, and under your control. With tools like this, there’s never been a better time to start experimenting with local LLM deployments, no matter what hardware you have.</p><h3>📚 Resources</h3><ul><li><a href="https://github.com/loncarales/minikube-ollama-lab">Project Repository</a></li><li><a href="https://github.com/ollama/ollama/tree/main/docs">Ollama Documentation</a></li><li><a href="https://github.com/open-webui/open-webui">OpenWebUI GitHub</a></li><li><a href="https://minikube.sigs.k8s.io/">Minikube Documentation</a></li><li><a href="https://kubernetes.io/docs/">Kubernetes Documentation</a></li></ul><blockquote><em>Have you tried running LLMs locally? What challenges have you faced? Share your experiences in the comments below, and don’t forget to start the repository if you find it useful! And remember, contributions earn you karma. 😜</em></blockquote><p><em>Originally published at </em><a href="https://loncar.net/posts/run-ollama-and-openwebui-on-minikube-zero-config-cross-platform-tls-ready/"><em>https://loncar.net</em></a><em> on June 22, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a9e59dd6353" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieving Dev/Prod Parity with Local Kubernetes and TLS using Anchor and lcl.host]]></title>
            <link>https://medium.com/@loncarales/achieving-dev-prod-parity-with-local-kubernetes-and-tls-using-anchor-and-lcl-host-fbd7a6158cc3?source=rss-4893d9024887------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbd7a6158cc3</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[local-development]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Ales Loncar]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 08:20:34 GMT</pubDate>
            <atom:updated>2025-06-03T11:38:50.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L3Ph5n5N5HJxHqQP.png" /></figure><p>Achieving Dev/Prod Parity with Local Kubernetes and TLS using Anchor and lcl.host</p><h3>🔄 TL;DR</h3><blockquote><em>Skip the pain of self-signed certificates and localhost DNS hacks. Use Anchor + lcl.host + Kind to get production-like Kubernetes with real HTTPS locally in minutes, not hours.</em></blockquote><p>Picture this: Your application works perfectly on your laptop with http://localhost:3000, but mysteriously breaks in production with certificate errors, CORS issues, and networking problems you&#39;ve never seen before.</p><p>Sound familiar? You’re not alone.</p><p>As developers, we strive for perfection, especially when it comes to ensuring our development environments closely mirror production setups. Historically, tools like <a href="https://developer.hashicorp.com/vagrant"><strong>Vagrant</strong></a> have been our go-to for mimicking production infrastructure locally. However, with the rapid shift toward containerization, particularly with <a href="https://www.docker.com/">Docker</a> and Kubernetes ( <a href="https://kubernetes.io/">K8S</a>), Vagrant’s relevance has waned. Today, many production environments are orchestrated by Kubernetes. Naturally, this leads developers to prefer running Kubernetes locally to achieve that coveted <a href="https://12factor.net/dev-prod-parity">Dev/Prod</a> parity. This parity isn’t just convenient; it’s crucial for stability and consistency when deploying to production.</p><p>But here’s the kicker: <strong>most local Kubernetes setups completely ignore encryption</strong>, creating a massive blind spot that only surfaces when things break in production.</p><h3>The Encryption Gap: Why TLS Matters in Development</h3><p>Consider these scenarios I’ve encountered:</p><ul><li><strong>Mixed content errors</strong> that only appear with HTTPS</li><li><strong>Cookie security policies</strong> that behave differently over HTTP vs HTTPS</li><li><strong>Service mesh mTLS</strong> configurations that can’t be tested without proper certificates</li><li>…</li></ul><p>The harsh reality? These issues are <strong>100% preventable</strong> with a proper local TLS setup.</p><p>One critical yet frequently overlooked aspect of Dev/Prod parity is encrypting application traffic using Transport Layer Security ( <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a>). Often, developers neglect encryption during local development due to complexity and setup friction. Yet, if encryption isn’t tested locally, issues usually appear once it is deployed to production. Ensuring local application encryption is seamless, frictionless, and identical to production standards is crucial. The key to building stable production systems is ensuring encryption is integrated seamlessly across all environments.</p><h3>The Traditional Toolchain Pain</h3><p>The “classic” approach involves a tedious dance with multiple tools:</p><ul><li><a href="https://www.openssl.org/">openssl</a>: Widely referenced on Google and Stack Overflow, especially the popular “<a href="https://stackoverflow.com/questions/10175812/how-to-get-a-localhost-certificate">how to get a localhost certificate</a>” article, but can be cumbersome and error-prone.</li><li><a href="https://mkcert.dev/">mkcert</a>: Simplifies generating locally trusted certificates.</li><li><a href="https://github.com/cbednarski/hostess">hostess</a>: Helps manage local DNS entries. Or the ninja way sudo vim /etc/hosts</li><li>nginx (<a href="https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/">reverse proxy</a>): Used to handle SSL termination locally.</li></ul><p>However, this approach suffers from:</p><ul><li>❌ <strong>Browser security warnings</strong> (self-signed certificates)</li><li>❌ <strong>Manual DNS management</strong> (editing /etc/hosts)</li><li>❌ <strong>Certificate rotation headaches</strong></li><li>❌ <strong>Platform-specific quirks</strong> (Windows, macOS, Linux differences)</li><li>❌ <strong>Team onboarding friction</strong> (everyone needs different setup steps)</li></ul><h3>Game Changers: Anchor and lcl.host</h3><p>Recently, I discovered two innovative tools that significantly reduce complexity:</p><h4><a href="https://anchor.dev/">Anchor</a>: Manage public and private certificates with complete insight across environments, built with the trusted ACME standard</h4><p>Anchor provides <strong>real, trusted certificates</strong> using the same ACME protocol that powers Let’s Encrypt. Unlike self-signed certificates, these are trusted by browsers and provide authentic production behaviour locally.</p><p>Key benefits:</p><ul><li>✅ <strong>Zero browser warnings</strong></li><li>✅ <strong>Real certificate authority</strong> backing</li><li>✅ <strong>Automatic renewal</strong> via cert-manager</li><li>✅ <strong>Same ACME flow</strong> as production</li></ul><h4><a href="https://lcl.host/">lcl.host</a>: DNS Magic for Developers</h4><p>A convenient domain where every subdomain of lcl.host automatically resolves to your local machine (127.0.0.1 and ::1).</p><pre># This just works - no configuration needed<br>dig api.lcl.host +short<br># 127.0.0.1<br><br>dig my-awesome-app.lcl.host +short<br># 127.0.0.1<br><br>dig literally-anything.lcl.host +short<br># 127.0.0.1</pre><p>This eliminates:</p><ul><li>❌ Editing /etc/hosts files</li><li>❌ Running local DNS servers</li><li>❌ Platform-specific DNS configuration</li><li>❌ Team member onboarding friction</li></ul><h3>Architecture: Production-Like Kubernetes Locally</h3><p>Here’s how the pieces fit together in my <a href="https://github.com/loncarales/kind-anchor-lab">kind-anchor-lab</a>:</p><pre>┌──────────────────────────────┐<br>│        Your Browser          │<br>│  https://*.lcl.host:32769    │<br>└────────────┬─────────────────┘<br>             │<br>Host Ports: 32768 (HTTP), 32769 (HTTPS)<br>             │<br>┌────────────▼────────────┐<br>│      Envoy Proxy        │  ← Docker container<br>│ envoyproxy/envoy:v1.30  │<br>│ Host → 172.18.0.X:80/443│<br>└────────────┬────────────┘<br>             │<br>Internal Docker Network<br>        172.18.0.0/16<br>             │<br>┌────────────▼────────────┐<br>│        NGINX            │<br>│    Ingress Controller   │  ← Running inside Kind node<br>│  Listens on 172.18.0.4  │<br>└────────────┬────────────┘<br>             │<br>┌────────────▼────────────┐<br>│      Your Service       │<br>│         (Pod)           │<br>│       http://:8080      │<br>└─────────────────────────┘</pre><p>This setup provides:</p><ol><li><strong>Real LoadBalancer simulation</strong> via <a href="https://github.com/kubernetes-sigs/cloud-provider-kind">cloud-provider-kind</a></li><li><strong>Production ingress patterns</strong> with NGINX Ingress Controller</li><li><strong>Authentic TLS termination</strong> using cert-manager + Anchor</li><li><strong>Zero-config DNS</strong> via lcl.host subdomains</li></ol><h3>Kind: Kubernetes in Docker Done Right</h3><p><a href="https://kind.sigs.k8s.io/">Kind</a> (Kubernetes in Docker) is the perfect foundation for this setup because it:</p><ul><li>✅ <strong>Runs anywhere Docker runs</strong> (Linux, macOS, Windows)</li><li>✅ <strong>Boots in seconds</strong>, not minutes</li><li>✅ <strong>Supports multiple node clusters</strong> for realistic testing</li><li>✅ <strong>Integrates with CI/CD</strong> pipelines seamlessly</li><li>✅ <strong>Provides genuine Kubernetes APIs</strong> (not simplified alternatives)</li></ul><p>Combined with the <a href="https://github.com/kubernetes-sigs/cloud-provider-kind">Kubernetes Cloud Provider for Kind</a>, you get realistic cloud interactions, including LoadBalancer services and ingress controllers that behave exactly like production.</p><h3>Real-World Example: From Zero to HTTPS in Minutes</h3><h4>Prerequisite: Create an Anchor Account and Service (Critical Step)</h4><p>Before running the lab, you must create a service in the Anchor UI:</p><ol><li>Create a free account on <a href="https://anchor.dev/">Anchor</a> if you haven’t already.</li><li>Manually create a service kind-anchor-lab in the Anchor dashboard. The local lab will use this service to request and manage TLS certificates.</li></ol><p>Here’s how the service creation screen should look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CUoyAgTEDbBy1I5W.png" /></figure><blockquote><em>Note: Anchor needs to know which service will be requesting certificates. The Kind Cloud Provider will handle the actual port mapping (typically :32769), so the port you choose in Anchor’s UI is just for organization purposes.</em></blockquote><p>This is a one-time step and ensures that your local environment can securely obtain and manage certificates via Anchor.</p><p>Let’s see this in action. Run my automated setup provided in my GitHub repository <a href="https://github.com/loncarales/kind-anchor-lab">kind-anchor-lab</a>.</p><p>You can immediately test real HTTPS endpoints:</p><pre># This just works - no browser warnings!<br>$ curl https://kind-anchor-lab.lcl.host:32769/alice<br>&quot;hello from alice!&quot;<br><br>$ curl https://kind-anchor-lab.lcl.host:32769/bob<br>&quot;hello from bob!&quot;<br><br># Verify the TLS certificate<br>$ openssl s_client -connect kind-anchor-lab.lcl.host:32769 -servername kind-anchor-lab.lcl.host | grep &quot;Verification&quot;<br>Connecting to 127.0.0.1<br>depth=2 O=loncarales, CN=loncarales/localhost - AnchorCA<br>verify return:1<br>depth=1 O=loncarales, CN=kind-anchor-lab - SubCA<br>verify return:1<br>depth=0 O=loncarales, CN=kind-anchor-lab.lcl.host<br>verify return:1<br>Verification: OK</pre><h3>The Business Case: Why This Matters</h3><p>Beyond developer happiness, this approach delivers measurable business value:</p><h4>Reduced Production Issues</h4><ul><li><strong>Fewer certificate-related incidents</strong> in my experience</li><li><strong>Earlier detection</strong> of HTTPS-specific bugs</li><li><strong>Faster root cause analysis</strong> when issues do occur</li></ul><h4>Developer Productivity</h4><ul><li><strong>Zero onboarding friction</strong> for new team members</li><li><strong>Consistent environments</strong> across the entire team</li><li><strong>Faster iteration cycles</strong> with production-like testing</li></ul><h4>Security Posture</h4><ul><li><strong>Real certificate validation</strong> in development</li><li><strong>mTLS testing</strong> capabilities for service mesh deployments</li><li><strong>Security header testing</strong> that actually works</li></ul><h3>The Bottom Line</h3><p>Dev/Prod parity isn’t just a nice-to-have; it’s a competitive advantage. Teams that achieve actual parity ship more reliable software, faster.</p><p>The combination of Kind, Anchor, and lcl.host eliminates the traditional barriers to local Kubernetes development with real TLS. What used to take hours of configuration now takes minutes.</p><p>Stop accepting the broken status quo of HTTP-only local development. <strong>Your production environment uses HTTPS; therefore, your local environment should also use HTTPS.</strong></p><p><strong>Ready to bridge the gap?</strong> Check out the <a href="https://github.com/loncarales/kind-anchor-lab">kind-anchor-lab repository</a> for a complete experience.</p><blockquote><em>And remember, contributions earn you karma. 😜</em></blockquote><p><em>Originally published at </em><a href="https://loncar.net/posts/achieving-devprod-parity-with-local-kubernetes-and-tls-using-anchor-and-lclhost/"><em>https://loncar.net</em></a><em> on June 2, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbd7a6158cc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>