<?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 Knowlesy on Medium]]></title>
        <description><![CDATA[Stories by Knowlesy on Medium]]></description>
        <link>https://medium.com/@kn0wl35y?source=rss-9971f725d914------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M8KI1aaKNY2r9LG6PuCELQ.png</url>
            <title>Stories by Knowlesy on Medium</title>
            <link>https://medium.com/@kn0wl35y?source=rss-9971f725d914------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:58:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kn0wl35y/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[From Zero to Two Custom VS Code Extensions in under 60 Minutes Flat]]></title>
            <link>https://medium.com/@kn0wl35y/from-zero-to-two-custom-vs-code-extensions-in-under-60-minutes-flat-4cc476cb1967?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cc476cb1967</guid>
            <category><![CDATA[vscode-extension]]></category>
            <category><![CDATA[google-antigravity]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Fri, 17 Jul 2026 20:06:45 GMT</pubDate>
            <atom:updated>2026-07-17T20:08:10.103Z</atom:updated>
            <content:encoded><![CDATA[<p>The existing extensions for managing Git work-trees and viewing CSV files in VS Code just weren’t quite what I needed. I wanted something simple easy to use extensions tailored exactly to my preferences. So I decided to see how fast I could manifest my own solution using generative AI.</p><p>Enter <strong>Antigravity </strong>in turbo mode.</p><blockquote>In Antigravity, <strong>Turbo Mode</strong> is an autonomy setting that gives your AI agents full, uninhibited control over the local workspace environment.</blockquote><p>Instead of writing all the boilerplate myself, I instructed Antigrav to act as my lead engineer. After the initial code was written I thought Id try a multi agent approach to QA , DevOps engineer and a Security engineer of the apps.</p><p>Sample prompt below</p><pre>I want to turn our current project into a multi-agent workflow to improve, test, and polish the extension.<br><br>Please act as the Lead Orchestrator. Break down the next steps into three distinct roles and provide the specific prompt/instructions I should run next for each:<br>1. A QA role to write automated tests for our multi-repo branch switching logic.<br>2. A Performance/Security role to audit the code for command injection and optimize bundle sizes.<br>3. A DevOps role to write the GitHub Actions marketplace publishing pipeline.</pre><p><strong>1. The QA Engineer 🧪</strong></p><p>While the main code was being laid down, a dedicated QA sub-agent jumped in. For the CSV extension, it completely decoupled the parsing logic from the frontend webview, extracted it into pure TypeScript utilities, and wrote a comprehensive `vitest` suite. The result? **<strong>100% test coverage</strong>** on the parsing logic without me writing a single assertion.</p><p><strong>2. The Security Reviewer 🔒</strong></p><p>Security in VS Code webviews is notoriously tricky. I had a Security Reviewer agent audit the entire codebase. It immediately caught a critical XSS vulnerability where raw CSV data was being injected directly into an HTML template literal. The agent patched it by implementing a secure `postMessage` data transit pipeline and enforcing a strict Content Security Policy (CSP).</p><p><strong>3. The DevOps Engineer 🚀</strong></p><p>Finally, I needed these extensions ready for the Marketplace. The DevOps agent stepped in, ripped out the bloated TypeScript compiler, and replaced it with lightning-fast `esbuild`. It then set up GitHub Actions for automated CI testing and VSIX packaging, dropping the final deployment-ready packages right into my lap.</p><p><strong>The Result</strong></p><p>Within a under an hour hour, I went from an idea to two fully completed, highly secure, and optimised VS Code extensions (`git-worktrees-native` and `csv-viewer-native`).</p><p>The paradigm of software development has fundamentally shifted. You are no longer just a programmer; with multi-agent orchestration, you are an engineering manager commanding an entire elite strike team. And the results speak for themselves.</p><p>Git Worktree does the following below, just the extension puts a UI side to it…</p><ul><li><strong>Simultaneous Branches:</strong> Instead of constantly switching branches back and forth in a single directory, you can create a completely separate folder on your machine for a different branch.</li><li><strong>No Stashing Needed:</strong> If you are halfway through a feature on branch-A and a critical bug pops up on main, you don&#39;t have to run git stash. You simply open your main worktree folder, fix the bug, and commit.</li><li><strong>Shared Git History:</strong> All your worktree folders point back to the exact same .git directory. They share the same local history, stashes, and remote tracking information, meaning you don&#39;t have to clone the repository multiple times.</li></ul><p>You can see the extension in action here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*9Gaeay4Q2Kv5Kac7myqEJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*DcbNvy1D21N8MITWri-Pcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*lbq4I66nzRlu35r9r3AxCw.png" /></figure><p>For the CSV viewer …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*zc11oNj6b-egeyxgSJb0Hw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*TwbW0AM_verZH3R_aZYzzw.png" /></figure><p>You can checkout the repos</p><ul><li><a href="https://github.com/knowlesy/worktree">https://github.com/knowlesy/worktree</a></li><li><a href="https://github.com/knowlesy/csv-tables-native">https://github.com/knowlesy/csv-tables-native</a></li></ul><p>and the VS Code Extensions</p><ul><li><a href="https://marketplace.visualstudio.com/items?itemName=knowlesy.git-worktrees-native">https://marketplace.visualstudio.com/items?itemName=knowlesy.git-worktrees-native</a></li><li><a href="https://marketplace.visualstudio.com/items?itemName=knowlesy.csv-viewer-native">https://marketplace.visualstudio.com/items?itemName=knowlesy.csv-viewer-native</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cc476cb1967" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built My Own AI News Station — and It Delivers to an E-Ink Reader Every Morning]]></title>
            <link>https://medium.com/@kn0wl35y/i-built-my-own-ai-news-station-and-it-delivers-to-an-e-ink-reader-every-morning-22e7da9b3871?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/22e7da9b3871</guid>
            <category><![CDATA[google-antigravity]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 12:01:16 GMT</pubDate>
            <atom:updated>2026-07-06T12:01:16.290Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Av085oI1TrlyV9VCZT0B8w.png" /></figure><p>Every morning at 6am, a small pipeline running on a k3s cluster in my house wakes up, reads a few hundred articles so I don’t have to, and builds me a newspaper.</p><p>Not a feed. Not another app fighting for my attention with infinite scroll. An actual finite, curated, <strong>done-when-you’ve-read-it</strong> newspaper — as an EPUB on my Xteink X4 e-ink reader, in my browser, and as audio for when my hands are busy.</p><p>This is the story of how I built it, and how three different AI tools ended up in an assembly line to get it shipped.</p><h3>The vision</h3><p>I wanted four things every morning:</p><ol><li><strong>A daily EPUB newspaper</strong> — every article from my sources (BBC News, DevOps and CI/CD engineering blogs, Substack, Medium tags), cleaned to Reader-Mode text, grouped by source, readable on an e-ink screen at breakfast</li><li><strong>A flash radio briefing</strong> — a punchy ~30-minute MP3 of just the headline stories, for when I’m making coffee and doing whatever in the morning</li><li><strong>A long-form podcast</strong> — a deeper conversational digest of the technical stories for during the day at home as background noise</li><li><strong>A TLDR digest</strong> — one plain-English sentence per article, for the days when even the briefing is too much</li></ol><p>All self-hosted. No subscriptions to yet another aggregator, no algorithm deciding what I care about, no tracking. My sources, my summaries, my hardware.</p><p>The e-reader part mattered more than it sounds. Reading news on an e-ink device is a completely different experience from reading it on a phone — no notifications, no temptation one swipe away, and it ends. The X4 runs CrossPoint firmware and can pull books over OPDS, which meant the station could be a proper little library server: the device fetches its own newspaper, nothing is pushed to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNpm6AvTBYzKSsqEjXwuNQ.png" /></figure><h3>The assembly line: Gemini → Antigravity → Claude</h3><p>I didn’t write most of this by hand. The interesting part is <em>how</em> it got built.</p><p><strong>Stage one: Gemini for the thinking.</strong> I started by developing the context — the vision, the constraints, the shape of the thing — in conversations with Gemini. Describing what I want, what’s realistic, where we should start. By the end I had something better than a spec: a shared understanding I could hand to a coding agent.</p><p><strong>Stage two: Antigravity for the skeleton.</strong> That context went into Antigravity, Google’s agentic IDE, which built the initial system: a Python scraper using Playwright to fetch and extract articles, a Rust/Axum web server to serve the dashboard and media, a vanilla-JS frontend, and the docker config to run it all.</p><p>After testing locally it was time to deploy to my k3s cluster and on to stage three….</p><p><strong>Stage three: Claude Code for the long haul.</strong> Then the real work started — the part where a project stops being a demo and starts being software. I moved to Claude Code and settled into a loop: I test on real hardware, I feed back what’s actually wrong, it executes and suggests ideas I hadn’t asked for. Dozens of iterations of that loop shipped, among other things:</p><ul><li><strong>OPDS catalog support</strong>, so the X4 pulls editions itself instead of me pushing files</li><li><strong>The TLDR digest</strong> as a second EPUB with its own reader in the dashboard</li><li><strong>Paywall detection</strong>, so truncated “sign up to read more” articles never waste space in my newspaper</li><li><strong>Per-task LLM routing</strong> — the flash briefing can use Gemini while the podcast uses Claude, each output can be switched off entirely, and outputs sharing a backend share a single LLM call to keep token costs down</li><li><strong>Surgical regeneration</strong> — rebuild just the radio, just the podcast, just the EPUB (no LLM call at all), or just the TLDR, instead of paying for everything every time</li></ul><h3>What testing on real hardware teaches you</h3><p>The feedback half of the loop was where the product actually got good. Almost none of the meaningful fixes came from reading code — they came from holding the device at breakfast:</p><ul><li>Book titles like <em>“AI News Station — Daily News — 04 July 2026”</em> truncate into uselessness on a small e-ink list view. Now they’re 260704-news-ai. The date is the only part that matters.</li><li>Justified text — which looks elegant in a browser — stretches into ugly rivers of whitespace on a narrow e-ink column. The TLDR digest got its own compact, left-aligned stylesheet, in relative units so it adapts to any reader instead of being tuned for one device.</li><li>A same-day re-run of the scraper was quietly producing editions with only the articles published since the <em>last</em> run. It now diffs against yesterday, merging the morning’s already-extracted articles back in without re-fetching anything.</li></ul><p>Each of those was a five-minute description in plain English — “the spacing is off, we’re not fitting enough per screen” — that came back as a tested change. That’s the loop: I supply judgement and hardware, the agent supplies execution and the occasional idea I adopt on the spot.</p><h3>The stack, briefly</h3><ul><li><strong>Scraper</strong>: Python + Playwright (with stealth), feedparser, TF-IDF clustering to pick cross-source “highlight” stories for the audio tracks</li><li><strong>LLMs</strong>: pluggable — Gemini, Claude API, or Claude via CLI OAuth (no API key needed), configurable per output</li><li><strong>TTS</strong>: Microsoft Edge neural voices via edge-tts — free, and shockingly good</li><li><strong>Server</strong>: Rust + Axum — serves the dashboard, the media, the OPDS catalog, and a small config API</li><li><strong>Frontend</strong>: a single Catppuccin-themed page, no framework, with an embedded epub.js reader</li><li><strong>Infra</strong>: Docker multi-stage build → GitHub Actions → GHCR (with Trivy scanning) → k3s + ArgoCD at home</li></ul><p>Everything runs on hardware I own. The recurring cost is roughly one LLM call per day.</p><h3>What’s next</h3><p>My to do is ever growing but feel free to give me feedback…..</p><p>The repo is open: <strong>github.com/knowlesy/my-news-station</strong>. Point it at your feeds, give it a free Gemini key, and tomorrow morning you’ll have a newspaper nobody optimised for engagement.</p><p><em>Built with Gemini, Antigravity, and Claude Code — and a human in the loop doing the part that still matters: knowing what “good” looks like.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22e7da9b3871" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building my homelab part 2]]></title>
            <link>https://medium.com/@kn0wl35y/building-my-homelab-part-2-a9f415f85521?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9f415f85521</guid>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[lets-encrypt]]></category>
            <category><![CDATA[kubernetes-argocd]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 21:41:37 GMT</pubDate>
            <atom:updated>2026-06-24T08:01:36.716Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8D2se0md7kYoS4CDf5bQDw.jpeg" /></figure><h3>K3s + ArgoCD</h3><p>This guide covers standing up a K3s Kubernetes cluster, wiring it to ArgoCD with GitOps, and bootstrapping the full application stack. It assumes a single-node setup on a Linux box (Ubuntu/Debian) with a domain managed by Cloudflare.</p><h3>Prerequisites</h3><ul><li>A Linux machine (physical or VM) with a static IP on your network</li><li>A domain name managed by Cloudflare</li><li>A GitHub account with a public and a private repository set up per the architecture post</li><li>A client machine (Mac assumed below for tooling)</li></ul><h3>Step 1: Client Tooling</h3><p>Install the tools you will use to manage the cluster from your local machine:</p><pre>brew install k9s # Terminal UI for Kubernetes</pre><pre>brew install --cask headlamp # GUI Kubernetes dashboard</pre><pre>brew install argocd # ArgoCD CLI</pre><pre>brew install helm # Helm package manager</pre><pre>brew install kubectl</pre><h3>Step 2: Install K3s</h3><p>SSH into your server and run the K3s installer. The --disable=traefik flag is important — K3s ships with its own Traefik instance, but you will be managing Traefik yourself through ArgoCD so the built-in one would conflict.</p><pre>curl -sfL https://get.k3s.io | sh -s - --disable=traefik</pre><p>K3s is now running as a systemd service. Verify it:</p><pre>sudo systemctl status k3s<br>kubectl get nodes</pre><h3>Copy the kubeconfig to your client machine</h3><p>On the server, make the kubeconfig readable by your user:</p><pre>sudo cp /etc/rancher/k3s/k3s.yaml ~/k3s-config<br><br>sudo chown $USER:$USER ~/k3s-config</pre><p>On your client machine, copy it over:</p><pre>scp youruser@192.168.x.x:~/k3s-config ~/.kube/config</pre><p>Open ~/.kube/config and find the server: line. It will read https://127.0.0.1:6443. Change 127.0.0.1 to the actual IP address of your server:</p><pre>clusters:</pre><pre>- cluster:</pre><pre>server: <a href="https://192.168.x.x:6443/">https://192.168.x.x:6443</a> # &lt;- change this</pre><p>Test the connection:</p><pre>kubectl get nodes<br><br># NAME STATUS ROLES AGE VERSION<br># myserver Ready control-plane,master 2m v1.x.x+k3s1</pre><h3>Set DNS on the server (optional)</h3><p>If your homelab DNS needs updating on the server itself:</p><pre>sudo nano /etc/resolv.conf</pre><p>Add your preferred DNS servers. Note that on systemd-resolved systems /etc/resolv.conf may be a symlink — check /etc/systemd/resolved.conf instead.</p><h3>Step 3: Install Traefik</h3><p>Traefik is your ingress controller. You are installing it manually first (before ArgoCD) because ArgoCD itself needs an ingress to be accessible.</p><p>Add the Helm repo and install using the values file from the public repo:</p><pre>helm repo add traefik <a href="https://traefik.github.io/charts">https://traefik.github.io/charts</a></pre><pre>helm repo update</pre><pre>helm install traefik traefik/traefik \</pre><pre>-n traefik \</pre><pre>--create-namespace \</pre><pre>-f bootstrap/traefik-values.yaml</pre><p>The values file configures:</p><ul><li>Ports 80 and 443 exposed via LoadBalancer</li><li>HTTP → HTTPS redirect</li><li>Kubernetes Ingress and CRD providers enabled</li><li>Traefik set as the default IngressClass</li></ul><p>Verify Traefik is running and has been assigned an external IP:</p><pre>kubectl get svc -n traefik<br><br># NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)<br># traefik LoadBalancer 10.43.x.x 192.168.x.x 80:xxxx/TCP,443:xxxx/TCP</pre><p>The EXTERNAL-IP here is your K3s node IP (K3s uses its own load balancer). This is the IP you will point your DNS A records at.</p><h3>Step 4: Install cert-manager</h3><p>cert-manager handles automatic TLS certificate issuance via Let’s Encrypt. Install it with CRDs enabled:</p><pre>helm repo add jetstack https://charts.jetstack.io<br><br>helm repo update<br>  <br>helm install cert-manager jetstack/cert-manager \<br>--namespace cert-manager \<br>--create-namespace \<br>--set crds.enabled=true</pre><p>Verify the three cert-manager pods are running:</p><pre>kubectl get pods -n cert-manager<br><br># cert-manager-xxxx 1/1 Running<br># cert-manager-cainjector-xxxx 1/1 Running<br># cert-manager-webhook-xxxx 1/1 Running</pre><h3>Create the Cloudflare API token secret</h3><p>In Cloudflare, go to <strong>My Profile → API Tokens → Create Token</strong>, use the <strong>Edit zone DNS</strong> template, and scope it to your specific zone. Copy the token — you only see it once.</p><p>Create the Kubernetes secret that cert-manager will use:</p><pre>kubectl create secret generic cloudflare-api-token-secret \<br><br>--namespace cert-manager \<br><br>--from-literal=api-token=YOUR_CLOUDFLARE_API_TOKEN</pre><h3>Create the ClusterIssuer</h3><p>Copy bootstrap/example-cloudflare-issuer.yaml from the public repo into your private repo at bootstrap/cloudflare-issuer.yaml. Fill in your real email address and Cloudflare zone:</p><pre>apiVersion: cert-manager.io/v1</pre><pre>kind: ClusterIssuer</pre><pre>metadata:</pre><pre>name: letsencrypt-prod</pre><pre>spec:</pre><pre>acme:</pre><pre>email: your-email@example.com</pre><pre>server: <a href="https://acme-v02.api.letsencrypt.org/directory">https://acme-v02.api.letsencrypt.org/directory</a></pre><pre>privateKeySecretRef:</pre><pre>name: letsencrypt-prod</pre><pre>solvers:</pre><pre>- dns01:</pre><pre>cloudflare:</pre><pre>email: your-email@example.com</pre><pre>apiTokenSecretRef:</pre><pre>name: cloudflare-api-token-secret</pre><pre>key: api-token</pre><p>Apply it:</p><pre>kubectl apply -f bootstrap/cloudflare-issuer.yaml</pre><p>Verify:</p><pre>kubectl get clusterissuer letsencrypt-prod</pre><pre># NAME READY AGE</pre><pre># letsencrypt-prod True 30s</pre><h3>Step 5: Cloudflare DNS Records</h3><p>Before ArgoCD will have a working ingress with a valid TLS certificate, you need the DNS records pointing at your cluster.</p><p>In Cloudflare DNS:</p><ol><li>Create an <strong>A Record</strong> for each service you plan to expose. Start with ArgoCD:</li></ol><ul><li><strong>Name</strong>: argo (creates argo.yourdomain.com)</li><li><strong>Content</strong>: 192.168.x.x (your K3s node IP, the same as the Traefik EXTERNAL-IP)</li><li><strong>Proxy status</strong>: <strong>DNS Only (Grey Cloud)</strong> — do <strong>not</strong> use the orange proxy cloud for private IPs, as Cloudflare cannot proxy to an RFC1918 address</li></ul><p>You can add more records later for other services. If you install external-dns (available as one of the apps in this stack), it will manage these records automatically from ingress annotations.</p><h3>Step 6: Install ArgoCD</h3><p>Install ArgoCD using the upstream manifests. This approach (rather than Helm) ensures you get the exact version from the ArgoCD project:</p><pre>kubectl create namespace argocd</pre><pre>kubectl apply -n argocd \</pre><pre>-f <a href="https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml">https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</a></pre><p>Wait for all pods to be running:</p><pre>kubectl get pods -n argocd</pre><h3>Disable TLS on the ArgoCD server</h3><p>ArgoCD serves HTTPS internally by default. Since Traefik will handle TLS termination at the ingress, you need to tell ArgoCD to run in insecure (HTTP) mode internally, otherwise you get double-TLS issues:</p><pre>kubectl patch configmap argocd-cmd-params-cm \</pre><pre>-n argocd \</pre><pre>--type merge \</pre><pre>-p &#39;{&quot;data&quot;:{&quot;server.insecure&quot;:&quot;true&quot;}}&#39;</pre><p>Restart the ArgoCD server pod to pick up the change:</p><pre>kubectl rollout restart deployment argocd-server -n argocd</pre><h3>Create the ArgoCD ingress</h3><p>Copy bootstrap/example-argo-ingress.yaml into your private repo at bootstrap/argo-ingress.yaml and fill in your real hostname:</p><pre>apiVersion: networking.k8s.io/v1</pre><pre>kind: Ingress</pre><pre>metadata:</pre><pre>name: argocd-server-ingress</pre><pre>namespace: argocd</pre><pre>annotations:</pre><pre>cert-manager.io/cluster-issuer: letsencrypt-prod</pre><pre>spec:</pre><pre>ingressClassName: traefik</pre><pre>tls:</pre><pre>- hosts:</pre><pre>- argo.yourdomain.com</pre><pre>secretName: argo-yourdomain-com-tls</pre><pre>rules:</pre><pre>- host: argo.yourdomain.com</pre><pre>http:</pre><pre>paths:</pre><pre>- path: /</pre><pre>pathType: Prefix</pre><pre>backend:</pre><pre>service:</pre><pre>name: argocd-server</pre><pre>port:</pre><pre>number: 80</pre><p>Apply it:</p><pre>kubectl apply -f bootstrap/argo-ingress.yaml</pre><p>cert-manager will now request a Let’s Encrypt certificate via the Cloudflare DNS challenge. This can take 30–90 seconds. Watch it:</p><pre>kubectl get certificate -n argocd</pre><pre># NAME READY SECRET</pre><pre># argo-yourdomain-com-tls True argo-yourdomain-com-tls</pre><p>ArgoCD should now be accessible at <a href="https://argo.yourdomain.com./">https://argo.yourdomain.com.</a></p><h3>Get the initial admin password</h3><pre>kubectl -n argocd get secret argocd-initial-admin-secret \<br><br>-o jsonpath=&quot;{.data.password}&quot; | base64 -d; echo</pre><p>Log in to the UI with username admin and this password. Change it immediately in <strong>User Info → Update Password</strong>.</p><h3>Step 7: Give ArgoCD Access to the Private Repo</h3><p>ArgoCD needs credentials to clone your private repository. Create a repository credential secret. This secret has a special ArgoCD label that causes ArgoCD to recognise it as a repository definition:</p><pre>apiVersion: v1</pre><pre>kind: Secret</pre><pre>metadata:</pre><pre>name: private-repo-creds</pre><pre>namespace: argocd</pre><pre>labels:</pre><pre>argocd.argoproj.io/secret-type: repository</pre><pre>stringData:</pre><pre>type: git</pre><pre>url: <a href="https://github.com/YOUR_USERNAME/argo-private.git">https://github.com/YOUR_USERNAME/argo-private.git</a></pre><pre>username: YOUR_GITHUB_USERNAME</pre><pre>password: YOUR_GITHUB_PAT</pre><p>Save this to a file and apply it:</p><pre>kubectl apply -f private-repo-secret.yaml</pre><p>Then delete the local file — do not commit it to git.</p><p><strong>GitHub PAT permissions required</strong> (using fine-grained tokens, not classic):</p><ul><li><strong>Contents</strong>: Read-only</li><li><strong>Metadata</strong>: Read-only</li></ul><p>Verify in ArgoCD UI under <strong>Settings → Repositories</strong> — the private repo should show as Connected.</p><h3>Step 8: Bootstrap the ApplicationSets</h3><p>Now apply the root applications that wire ArgoCD to your public repo. These are the two files that kick off the entire GitOps loop:</p><pre># Bootstraps the Helm-chart app ApplicationSet (apps/ folder)</pre><pre>kubectl apply -f bootstrap/root-app.yaml</pre><pre># Bootstraps the git-chart app ApplicationSet (apps2/ folder)</pre><pre>kubectl apply -f bootstrap/git-apps-root.yaml</pre><p>In the ArgoCD UI you should now see:</p><ul><li>applicationset-controller Application (synced, watching apps/)</li><li>applicationset-controller-git Application (synced, watching apps2/)</li><li>Individual Applications for every JSON file in apps-config/ and apps-git-config/</li></ul><p>The Applications will initially show as OutOfSync since nothing has been deployed yet. Sync them in the order they depend on each other (cert-manager and Traefik are already installed manually; reflector should come next, then external-dns, then the rest).</p><h3>Step 9: Docker Hub Credentials with Reflector</h3><p>Docker Hub enforces pull rate limits on unauthenticated requests. With multiple pods across multiple namespaces all pulling images, you will hit these limits. The solution is a single authenticated pull secret replicated across every namespace by <a href="https://github.com/emberstack/kubernetes-reflector">Reflector</a>.</p><h3>Create your Docker Hub access token</h3><ol><li>Log in to hub.docker.com</li><li>Go to <strong>Account Settings → Security → New Access Token</strong></li><li>Give it a description (e.g. k3s-homelab) and copy the token</li></ol><h3>Generate and annotate the secret</h3><p>Generate the secret YAML without applying it:</p><pre>kubectl create secret docker-registry regcred \</pre><pre>--docker-server=https://index.docker.io/v1/ \</pre><pre>--docker-username=YOUR_DOCKERHUB_USERNAME \</pre><pre>--docker-password=YOUR_ACCESS_TOKEN \</pre><pre>--docker-email=YOUR_EMAIL \</pre><pre>--namespace kube-system \</pre><pre>--dry-run=client -o yaml &gt; regcred.yaml</pre><p>Open regcred.yaml and add the Reflector annotations to the metadata section:</p><pre>apiVersion: v1</pre><pre>kind: Secret</pre><pre>metadata:</pre><pre>name: regcred</pre><pre>namespace: kube-system</pre><pre>annotations:</pre><pre>reflector.v1.k8s.emberstack.com/reflection-allowed: &quot;true&quot;</pre><pre>reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: &quot;*&quot;</pre><pre>reflector.v1.k8s.emberstack.com/reflection-auto-enabled: &quot;true&quot;</pre><pre>type: kubernetes.io/dockerconfigjson</pre><pre>data:</pre><pre>.dockerconfigjson: &lt;the base64 blob generated above&gt;</pre><p>Apply it:</p><pre>kubectl apply -f regcred.yaml</pre><p>Then delete the local file — do not commit it.</p><p>Once Reflector is synced by ArgoCD, it will copy this secret into every existing and future namespace automatically. Any pod that needs Docker Hub images can reference imagePullSecrets: [{name: regcred}] and it will be there.</p><p>To trigger the initial replication after applying the secret, sync the Reflector application from the ArgoCD UI.</p><h3>Verification Checklist</h3><p>At this point your cluster should have:</p><ul><li>K3s running, node in Ready state</li><li>Traefik running with a LoadBalancer IP</li><li>cert-manager running with the letsencrypt-prod ClusterIssuer Ready</li><li>Cloudflare A records pointing at the Traefik IP</li><li>ArgoCD accessible via HTTPS with a valid Let’s Encrypt certificate</li><li>Private repo connected in ArgoCD Settings</li><li>applicationset-controller and applicationset-controller-git Applications synced</li><li>Individual app Applications visible in ArgoCD UI</li><li>regcred secret in kube-system, being replicated by Reflector</li></ul><h3>Troubleshooting</h3><p><strong>Certificate stuck in Pending</strong></p><pre>kubectl describe certificaterequest -n &lt;namespace&gt;<br><br>kubectl describe challenge -n &lt;namespace&gt;</pre><p>Usually a Cloudflare token permission issue or the DNS record not yet propagated.</p><p><strong>ArgoCD showing connection error to private repo</strong></p><pre>kubectl get secret private-repo-creds -n argocd -o yaml</pre><p>Verify the PAT has not expired and has the correct permissions. Re-create the secret if needed.</p><p><strong>Traefik not getting an external IP</strong></p><p>K3s includes its own service load balancer (ServiceLB / klipper). If the node IP is not being assigned, check:</p><pre>kubectl get pods -n kube-system | grep svclb<br><br>kubectl describe svc traefik -n traefik</pre><p><strong>ArgoCD app stuck OutOfSync after values change</strong></p><p>If you changed a private repo values file, ArgoCD may not detect it immediately. Force a refresh:</p><pre>argocd app get my-app --refresh<br><br>argocd app sync my-app</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f415f85521" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Headroom]]></title>
            <link>https://medium.com/@kn0wl35y/using-headroom-70145aab43df?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/70145aab43df</guid>
            <category><![CDATA[headroom]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 17:39:50 GMT</pubDate>
            <atom:updated>2026-06-26T17:05:22.446Z</atom:updated>
            <content:encoded><![CDATA[<p>Tokens these days can disappear in a near single input, so I started looking at headroom see <a href="https://github.com/chopratejas/headroom">https://github.com/chopratejas/headroom</a></p><p><strong><em>Note</em></strong>: <em>This is a walk through for running it locally</em></p><p>It is…</p><p><em>“Headroom compresses everything your AI agent reads — tool outputs, logs, RAG chunks, files, and conversation history — before it reaches the LLM. Same answers, fraction of the tokens.</em>”</p><p><strong>TLDR:</strong> its a proxy</p><h3>1. Prerequisites</h3><p>Ensure you have the following installed:</p><ul><li><a href="https://github.com/chopratejas/headroom"><strong>Headroom</strong></a>: Our token optimization engine.</li><li><strong>Claude Code</strong>: Your interactive AI CLI agent. or a compatible LLM</li><li><strong>Python 3.10–3.13</strong>: Required for Headroom (avoid 3.14 due to dependency conflicts).</li></ul><h3>2. Phase 1: The Optimisation Layer</h3><p>Always run Headroom in the background to act as your traffic controller.</p><ol><li><strong>Install Headroom:</strong></li></ol><pre>pipx install --python python3.13 &quot;headroom-ai[all]&quot;</pre><p><em>Or your appropriate python version</em></p><ol><li><strong>Start the Proxy:</strong></li></ol><pre>headroom proxy --port 8787</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YoXwWlOcHtJzodXoWpPzBg.png" /></figure><h3>3. Phase 2: Saving your Credits</h3><p>In a new terminal window, route Claude through your</p><p>Claude CLI:</p><pre>ANTHROPIC_BASE_URL=http://localhost:8787 claude</pre><h3>Optional</h3><p>Anti Gravity</p><pre>OPENAI_BASE_URL=http://127.0.0.1:8787/v1 antigravity</pre><p>VS-Code / Claude (Updated)</p><pre>Add the following to `.claude/settings.local.json` in your workspace. This tells Claude Code to route all Anthropic API calls through your headroom instance:<br><br><br>{<br>  &quot;env&quot;: {<br>    &quot;ANTHROPIC_BASE_URL&quot;: &quot;http://127.0.0.1:8787&quot;<br>  }<br>}<br><br>or  under vscode/settings.json<br>{<br>  &quot;claudeCode.environmentVariables&quot;: {<br>    &quot;ANTHROPIC_BASE_URL&quot;: &quot;http://localhost:8787&quot;<br>  }<br>}</pre><p>Verify your connections with:</p><pre>claude mcp list</pre><p><em>Both </em><em>kubernetes and </em><em>argocd should show </em><em>✔ Connected.</em></p><h3>Is it on ?</h3><p>Running</p><pre>claude mcp list</pre><p>should bring back</p><pre>headroom: headroom mcp serve - ✔ Connected</pre><h3>4. Seeing the Magic Happen</h3><p>Start using your LLM in its ui/cli and go to <a href="http://127.0.0.1:8787/dashboard">http://127.0.0.1:8787/dashboard</a> to watch you save tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiU5kLq1ShT9szRTSeWmDw.png" /></figure><p>Final note you may wish to disable telemetry</p><pre>headroom proxy --port 8787 --no-telemetry</pre><p>Whilst Ive yet to benchmark this or throw it into my home cluster it seemingly “doing somthing”. So for now at least I’ll continue using it and likely have another post about it</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70145aab43df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building my homelab]]></title>
            <link>https://medium.com/@kn0wl35y/building-my-homelab-3e85eeba321c?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e85eeba321c</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[dell]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Mon, 25 Aug 2025 16:58:29 GMT</pubDate>
            <atom:updated>2025-08-25T16:58:29.194Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been some time since I’ve had an active home lab. After my last server, a Dell R620, finally gave up the ghost, I shifted most of my projects to an Azure test subscription. However, a recent move and the end of my MSDN access sent me searching for new hardware.</p><p>As luck would have it, a Dell R7910 was recently donated to the cause. With a free bank holiday weekend ahead, it’s time to dive in and get this build underway.</p><p><strong>VGA</strong></p><p>Powering the server on is one thing, but seeing what’s actually occurring on the box is another story. As luck would have it, all my monitors are HDMI, which left me hunting for a solution. The answer was my TV, which thankfully still has a VGA port.</p><p>After dragging it over and embarking on a quest into the loft for the single VGA cable I still own, I finally got on the box. I was able to get everything configured, including the iDRAC and Lifecycle Manager settings, but I was surprised to find the whole process took over an hour!</p><p>iDRAC’s or ipmi are phenomenal things ! if you do want to find out more <a href="https://www.youtube.com/watch?v=Ne_ViTnIvy0">https://www.youtube.com/watch?v=Ne_ViTnIvy0</a> is a good place to start</p><p><strong>Updates</strong></p><p>Updating the firmware proved to be a challenge, which isn’t surprising for a server of this age. Dell’s FTP repositories seem to have moved to HTTPS, breaking the onboard Lifecycle Controller updates. My next attempt with the Dell Repository Manager also came up empty, as it no longer listed the update files for this hardware.</p><p>After hitting that dead end, I changed tactics: I proceeded with a clean Windows 10 installation and decided to manually download and execute the firmware updates from within the OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*-43x2wRCmnSTdL4f_xXeVg.png" /></figure><p><strong>Virtualisation</strong></p><p>With not using vmware or hyper-v for so long I thought ID give proxmox a go so off to youtube to familiarise myself with it <a href="https://www.youtube.com/watch?v=7OVaWaqO2aU&amp;t=73s&amp;pp=0gcJCa0JAYcqIYzv">https://www.youtube.com/watch?v=7OVaWaqO2aU&amp;t=73s&amp;pp=0gcJCa0JAYcqIYzv</a></p><p>Since I had a virtual ISO mounter to hand i just used that instead of using rufuss or anything else to make a boot usb stick.</p><p>The install is simple and I won’t double the work the video does.</p><p><strong>Proxmox</strong></p><p>Once setup and logged in ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6UN87Dq8WXQbmRpdxfg6A.png" /></figure><p>I got to working on deploying a few vm’s with terraform initially starting with Telmate/proxmox however I ran into several issues with it requiring VM.Monitoring permissions see <a href="https://forum.proxmox.com/threads/proxmox-9-terraform-provider-missing-vm-monitor-permission-but-it-doesnt-exist.170212/">https://forum.proxmox.com/threads/proxmox-9-terraform-provider-missing-vm-monitor-permission-but-it-doesnt-exist.170212/</a></p><p>However updating to the latest unlike the lucky soul in the thread wasn’t resolving my issue so I moved to bpg/proxmox this for me, worked first time with no issues. Thankfully copilot had assisted here as well in performing updates and filling in some blanks. as all of the troubleshooting was taking forever and a day….</p><p><strong>VM’s</strong></p><p>Sadly, building out the VMs was an entirely manual process. This is a scenario where a tool like Packer or a golden image would have been perfect, but I was stuck in the “just get it done” mindset.</p><p>No doubt I will end up rebuilding these at some point, and that’s when I’ll set aside an hour or two to finally automate the deployment.</p><p><strong>More updates and Ansible</strong></p><p>With the new VMs online, it was Ansible’s turn to take over, and GitHub Copilot came to the rescue. After a quick ping test confirmed everything was reachable, I asked Copilot to generate a playbook for general maintenance and updates.</p><p>After making a few small adjustments to the code, it was good to go. The playbook ran successfully, bringing all the VMs up to date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WHriPCbkNMZrvIneGJkRg.png" /></figure><p><strong>The final….of this part of the series …..</strong></p><p>If you’ve made it this far, thank you for reading!</p><p>All the configurations and code from this project are publicly available on GitHub for your reference. The repository can be found at the link below: <a href="https://www.google.com/search?q=https://github.com/knowlesy/homelab">https://github.com/knowlesy/homelab</a></p><p>In the upcoming posts, I’ll be focusing on deploying a Kubernetes (k8s) cluster. After that, I’ll explore using tools like Argo CD for cluster management and application deployment.</p><p>Stay tuned for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e85eeba321c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trying Cursor ….]]></title>
            <link>https://medium.com/@kn0wl35y/trying-cursor-9e9a5dc977b4?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e9a5dc977b4</guid>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[cursor]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 22:49:11 GMT</pubDate>
            <atom:updated>2025-03-03T22:49:11.730Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trying Cursor ….</h3><p>After using Copilot, a mate of mine recommended using Cursor to do something I have pretty much no clue about and he gave an example of something similar he did “<em>I just cloned </em><a href="https://github.com/modelcontextprotocol/servers,"><em>https://github.com/modelcontextprotocol/servers,</em></a><em> opened it with cursor and said “write me a simple skeleton mcpserver using ssetransport using deno</em>””</p><p>So literally entering that into cursor away I go…. fast forward 30 minutes I refined my query to “write me a simple skeleton mcpserver using <em>ssetransport</em> using deno so i can scrape websites to give me a summary”</p><p>a little more debugging … aka asking cursor for help with a few prompts and errors …..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfQQmwi2autcpy1L0XL-Xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6P5t00LzUVErBk16G3LFw.png" /></figure><p>And there we go, knowing very little on mcp/llms/deno and we have something that works.</p><p>Fork here for your pleasure <a href="https://github.com/knowlesy/mcp-servers-webscrape/blob/main/Scraper_Readme.md">https://github.com/knowlesy/mcp-servers-webscrape/blob/main/Scraper_Readme.md</a></p><p>Overall in comparison to copilot I found it a smidge more helpful with queues to run commands etc however upon retrying VSCode with my slightly refined queries that I fired at Cursor, I found that it gave examples — however it certainly didnt generate something as polished as Cursor!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*azFan_yHJyR6-nNyzaBaiw.png" /></figure><p>Granted theres probably a range of ways to improve this, excluding user knowledge for me it demonstrates how good cursor is out of the box and potential it, as well as co pilot could be in a few more months/years.</p><p>More info</p><ul><li><a href="https://docs.cursor.com/get-started/welcome">https://docs.cursor.com/get-started/welcome</a></li><li><a href="https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse">https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse</a></li><li><a href="https://github.com/modelcontextprotocol/servers,">https://github.com/modelcontextprotocol/servers</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e9a5dc977b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Github Copilot for the first time …]]></title>
            <link>https://medium.com/@kn0wl35y/using-github-copilot-for-the-first-time-5076c6d24998?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/5076c6d24998</guid>
            <category><![CDATA[co-pilot]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 19:02:22 GMT</pubDate>
            <atom:updated>2025-03-03T19:02:22.306Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Github Copilot for the first time …</h3><p>For another project Im working on I needed a repo with a few hundred commits and pull requests that I wasnt going to damage in any way shape or form. Not wanting to think about start writing my own or even looking one up I thought nows a time to see how good Co-pilot is!</p><p>I started with an empty repo and entered “<em>how would i create a test git repository with a couple hundred prs with a few test words per pr</em>”</p><p>That progressed to adding</p><p># <em>enable the start and end date to be custom variables</em><br>#<em> for each pr created create a text file using cat names the contents of the file will be a simple hello world pything script that will have a slight change on every version</em><br>#<em>add a time variable that will be the same time to start and end date</em><br>#<em>enable token to be in a text file</em></p><p>And after all of that, we now have the following python script</p><pre>import time<br>import random<br>from datetime import datetime, timedelta<br>from github import Github<br><br># Read GitHub token from file<br>with open(&#39;github_token.txt&#39;, &#39;r&#39;) as file:<br>    GITHUB_TOKEN = file.read().strip()<br><br>REPO_NAME = &#39;knowlesy/test-repo-1&#39;<br><br># Initialize GitHub instance<br>g = Github(GITHUB_TOKEN)<br>repo = g.get_repo(REPO_NAME)<br><br># List of cat names<br>cat_names = [&quot;Whiskers&quot;, &quot;Mittens&quot;, &quot;Shadow&quot;, &quot;Simba&quot;, &quot;Nala&quot;, &quot;Luna&quot;, &quot;Bella&quot;, &quot;Chloe&quot;, &quot;Oliver&quot;, &quot;Leo&quot;]<br><br># Function to create a pull request<br>def create_pr(branch_name, title, body):<br>    base = repo.default_branch<br>    head = branch_name<br>    pr = repo.create_pull(title=title, body=body, head=head, base=base)<br>    return pr<br><br># Function to merge a pull request<br>def merge_pr(pr):<br>    pr.merge()<br><br># Function to create a new file in the branch<br>def create_file(branch_name, file_path, content):<br>    repo.create_file(path=file_path, message=&quot;Add new file&quot;, content=content, branch=branch_name)<br><br># Custom start and end dates with time<br>time_str = &#39;12:00:00&#39;<br>start_date_str = f&#39;2010-01-01 {time_str}&#39;<br>end_date_str = f&#39;2012-01-01 {time_str}&#39;<br>start_date = datetime.strptime(start_date_str, &quot;%Y-%m-%d %H:%M:%S&quot;)<br>end_date = datetime.strptime(end_date_str, &quot;%Y-%m-%d %H:%M:%S&quot;)<br>current_date = start_date<br><br>cat_index = 0<br><br>while current_date &lt; end_date:<br>    # Create a new branch with a unique name<br>    branch_name = f&#39;feature-{current_date.strftime(&quot;%Y%m%d%H%M%S&quot;)}-{random.randint(1000, 9999)}&#39;<br>    repo.create_git_ref(ref=f&#39;refs/heads/{branch_name}&#39;, sha=repo.get_branch(repo.default_branch).commit.sha)<br>    <br>    # Create a new file in the branch with a cat name<br>    cat_name = cat_names[cat_index % len(cat_names)]<br>    file_path = f&#39;test/{cat_name}_hello_world_{current_date.strftime(&quot;%Y%m%d%H%M%S&quot;)}.py&#39;<br>    file_content = f&#39;print(&quot;Hello World from {cat_name}!&quot;)&#39;<br>    create_file(branch_name, file_path, file_content)<br>    <br>    # Create a pull request<br>    pr_title = f&#39;ABC ENV Automated PR {current_date.strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)}&#39;<br>    pr_body = &#39;This is an automated pull request. Effecting the environment ABC_123&#39;<br>    pr = create_pr(branch_name, pr_title, pr_body)<br>    <br>    # Merge the pull request<br>    merge_pr(pr)<br>    <br>    # Increment the date (e.g., create a PR every day)<br>    current_date += timedelta(days=1)<br>    <br>    # Increment the cat index<br>    cat_index += 1<br>    <br>    # Sleep to avoid hitting API rate limits (adjust as needed)<br>    time.sleep(1)<br><br>print(&quot;Completed creating and merging PRs.&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aYW8jl2py3yArKpng1VlrA.png" /></figure><p>Pretty neat! now on to the next step</p><p>Repo for those who may want to use the code <a href="https://github.com/knowlesy/test-repo-1">https://github.com/knowlesy/test-repo-1</a></p><p>For more information</p><p># <a href="https://code.visualstudio.com/docs/copilot/overview">https://code.visualstudio.com/docs/copilot/overview</a> <br>#<a href="https://www.youtube.com/watch?v=dMbOh114Vd4">https://www.youtube.com/watch?v=dMbOh114Vd4</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5076c6d24998" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AzKeyVault_Pipeline_Security]]></title>
            <link>https://medium.com/@kn0wl35y/azkeyvault-pipeline-security-2a868dd0e5c3?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a868dd0e5c3</guid>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 19:14:18 GMT</pubDate>
            <atom:updated>2025-02-26T19:14:18.575Z</atom:updated>
            <content:encoded><![CDATA[<p>Enabling access to your Key Vaults securely with Azure Devops Library Sets</p><p>Github Repo <a href="https://github.com/knowlesy/AzKeyVault_Pipeline_Security">here</a></p><h3>KeyVaults</h3><p>Azure Key vaults enable you to do the following</p><ul><li>Secrets Management — Azure Key Vault can be used to Securely store and tightly control access to tokens, passwords, certificates, API keys, and other secrets</li><li>Key Management — Azure Key Vault can be used as a Key Management solution. Azure Key Vault makes it easy to create and control the encryption keys used to encrypt your data.</li><li>Certificate Management — Azure Key Vault lets you easily provision, manage, and deploy public and private Transport Layer Security/Secure Sockets Layer (TLS/SSL) certificates for use with Azure and your internal connected resources.</li></ul><p>However they also enable auditing, RBAC (Access policies or Azure RBAC) along with setting restricted access via firewall / network access control lists.</p><p>In this we will go over the 3 options for securing access to your keyvault when using lirary sets in Azure Devops Pipelines</p><p>I have created 3 Key Vaults with varying degrees of access all controlled via the networking section</p><p>The Key Vaults consist of the following</p><ul><li>Configured with Azure RBAC</li><li>Have a test secret in them</li><li>An SPN “KeyVault” as reader to the subscription and as “Key Vault Secrets User” (read in Key Vaults) to the Key Vault</li><li>My own account added as a Key Vault Secrets Officer (to create / edit / read)</li></ul><p>The SPN “Key Vault” was added to my test project as a connector in ADO</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/0*tNXd7EXj0ljznygE" /></figure><h3>Network Config Options</h3><h3>IP MSOnly</h3><p>Network settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E6Xqve1iqlfp5GIx" /></figure><p>ADO View in Library sets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*K9kE1jVihJWwb5g8" /></figure><p>My access via web page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TawPIYwBoWG6z50O" /></figure><p>You would use this private endpoints — ADO unable to access this</p><h3>IP Public</h3><p>Network settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gcEdpb3kISUxGvPe" /></figure><p>ADO View in Library sets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aKUHCUkhMx_LV-Jl" /></figure><p>My access via web page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PQiflsCf3gMF_X_W" /></figure><p>Could be utilised for a variety of things (think IP address changes) however not ideal if a service principle or users account is compromised</p><h3>IP Filtered</h3><p>Network settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PhrAgcXCOmnVupXG" /></figure><p>ADO View in Library sets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-ct6XIZCJaS7zCFG" /></figure><p>My access via web page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/0*4Zv785ibObqyD8oy" /></figure><p>If you require restricted access to a on prem or Azure network (that isnt set up to utilise private link) as well as public access (ADO Access), this would be the best way to enable that.</p><h3>Giving ADO Access</h3><p>As you can see in the IP Filtered it has access with the single range, if you visit the link below in further reading “Allowed IP addresses and domain URLs — INBOUND” this will provide you with all the regions ADO works in and their corresponding IP addresses/ranges.</p><p>To find your region go to your Organisation in ADO &gt; Click Organization settings &gt; In Overview you will see region for me its UK South</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*X_UEh2bEdU_q4Mi2" /></figure><p>Note — Review any other IP address you may require</p><h3>Further Reading</h3><ul><li><a href="https://learn.microsoft.com/en-us/azure/devops/organizations/security/allow-list-ip-url?view=azure-devops&amp;tabs=IP-V4#inbound-connections">Allowed IP addresses and domain URLs — INBOUND</a></li><li><a href="https://learn.microsoft.com/en-us/azure/key-vault/">Azure Keyvaults</a></li><li><a href="https://learn.microsoft.com/en-us/azure/key-vault/general/best-practices">Key Vault Best Practises</a></li><li><a href="https://learn.microsoft.com/en-gb/azure/devops/pipelines/agents/windows-agent?view=azure-devops">Self Hosted Agents</a></li><li><a href="https://build5nines.com/what-is-ip-address-of-azure-devops-build-agent-and-set-firewall-to-allow-it/">What is IP Address of Azure DevOps Build Agent and Set Firewall to Allow it</a></li><li><a href="https://learn.microsoft.com/en-gb/azure/key-vault/general/network-security?WT.mc_id=Portal-Microsoft_Azure_KeyVault">Configure Azure Key Vault firewalls and virtual networks</a></li><li><a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/release/azure-key-vault?view=azure-devops&amp;tabs=yaml">Use Azure Key Vault secrets in Azure Pipelines</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a868dd0e5c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Container Repository Scheduled Tasks]]></title>
            <link>https://medium.com/@kn0wl35y/azure-container-repository-scheduled-tasks-c1b9700c5ebd?source=rss-9971f725d914------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1b9700c5ebd</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Knowlesy]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 17:14:12 GMT</pubDate>
            <atom:updated>2024-11-14T17:14:12.223Z</atom:updated>
            <content:encoded><![CDATA[<p>This will show you how to get a scheduled azure container task that will build an image in this particular case just Alpine at a scheduled time and store it in the ACR. This has a variety of benefits for example say if your wanting upgrades to your layers.</p><p>Another option If you have links to base images this could be useful as refence or if your wanting an import you could just use the acr import commands within a pipeline or look at encoded script block.</p><p>This is a lab only !</p><h3>Pre-Req’s</h3><ul><li>terraform installed locally</li><li>VSCode with TF Extension and Git</li><li>AZ Cli or AZ PS Module</li><li>Azure Environment</li><li>Github account with PAT Token</li><li>Repo: <a href="https://github.com/knowlesy/ACR_Tasks">https://github.com/knowlesy/ACR_Tasks</a></li></ul><h3>Instructions</h3><p>Git clone in VS Code and modify the cron job to a more specific time closer to you, remember this will be executed in UTC Time. The following can help <a href="https://crontab.guru/">crontab guru</a></p><p>in your terminal cd into the TF folder then run through following prompts</p><p>Log in to azure <a href="https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli">AZ CLI</a> or <a href="https://learn.microsoft.com/en-us/powershell/azure/authenticate-azureps?view=azps-10.1.0">Powershell</a></p><pre>az login --t &quot;XYZ&quot;</pre><p>Initialize TF Code</p><pre>terraform init -upgrade</pre><p>Plan TF Code have your pat token ready <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens">help on pat tokens</a></p><p>You could also switch the github link to a storage account and SAS token as an alternative.</p><pre>terraform plan -out main.tfplan</pre><p>You will be prompted for your token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/0*vactO1WmkKm4zkbH" /></figure><p>NOTE: This isnt stored securely as this is a LAB!</p><p>Apply TF Code</p><pre>terraform apply main.tfplan</pre><p>Any of the code below will rely on the following variable run this after your tf apply</p><pre>$registry = (terraform output -raw acr_login).replace(&quot;.azurecr.io&quot;,&quot;&quot;)</pre><p>Your Key vault and Azure Container Registry will be created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/0*JSB0ycJPiHOCrg70" /></figure><p>Check your tasks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Xx89Yi7wt6hbvuu" /></figure><p>Or Run the following</p><pre>az acr task show -n daily-pull-task -r $registry -o table</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wfwRcNtQ0x0T6aW7" /></figure><p>Some additional scripts to run and brows your repository</p><pre>#lists the timer for the task (if applicable<br>az acr task timer list -n daily-pull-task -r $registry</pre><pre>#forces the task manually	  <br>az acr task run -n daily-pull-task -r $registry</pre><pre>#Shows Logs <br>az acr task logs -r $registry<br>#Lists runs executed <br>az acr task list-runs -r $registry -o table<br>az acr repository list --name  $registry --output table</pre><pre>#By tag name  <br>az acr repository show-tags -n $registry --repository alpine --orderby time_desc --output table</pre><p>Repositories</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eTJJqhcjc7dCQWBS" /></figure><p>Tear down the env</p><pre>terraform plan -destroy -out main.destroy.tfplan<br>terraform apply &quot;main.destroy.tfplan&quot;</pre><p>References below have helped in making this example</p><ul><li><a href="https://learn.microsoft.com/en-us/azure/container-registry/tasks-consume-public-content">How to consume and maintain public content with Azure Container Registry Tasks</a></li><li><a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-tasks-overview">Automate container image builds and maintenance with ACR Tasks</a></li><li><a href="https://opencontainers.org/posts/blog/2020-10-30-consuming-public-content/">Consuming Public Content</a></li><li><a href="https://learn.microsoft.com/en-us/azure/container-registry/buffer-gate-public-content?tabs=azure-cli">Manage public content with Azure Container Registry</a></li><li><a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-tutorial-private-base-image-update">Tutorial: Automate container image builds when a base image is updated in another private container registry</a></li><li><a href="https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_registry_task">azurerm_container_registry_task</a></li><li><a href="https://thomasthornton.cloud/2022/12/15/deploy-container-app-and-pull-image-from-azure-container-registry-using-terraform-and-azapi/">Deploy Container App and pull image from Azure Container Registry using Terraform and AzAPI</a></li><li><a href="https://docs.docker.com/docker-hub/download-rate-limit/#how-do-i-authenticate-pull-requests">Docker Hub Account</a></li><li><a href="https://docs.docker.com/docker-hub/access-tokens/">Docker API Tokens</a></li><li><a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-skus">ACR Sku’s</a></li><li><a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-import-images?tabs=azure-cli">ACR Import Container Images</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1b9700c5ebd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>