<?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 Ryan Gough on Medium]]></title>
        <description><![CDATA[Stories by Ryan Gough on Medium]]></description>
        <link>https://medium.com/@ryjogo?source=rss-fd75f4513228------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*s0UAS17hKsqgQf1KtvdthQ.png</url>
            <title>Stories by Ryan Gough on Medium</title>
            <link>https://medium.com/@ryjogo?source=rss-fd75f4513228------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:38:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryjogo/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[Orchestrating thousands of Speedtests, using Kubernetes]]></title>
            <link>https://jysk.tech/orchestrating-thousands-of-speedtests-using-kubernetes-eabdcc668611?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/eabdcc668611</guid>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[talos-linux]]></category>
            <category><![CDATA[iperf3]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[speed-test]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 05:39:50 GMT</pubDate>
            <atom:updated>2025-03-20T14:35:24.620Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzlAu_fp1iC7Cxr6EAnBlA.jpeg" /></figure><blockquote>To monitor the network usability and speed of our store systems over time, we addressed the challenge by implementing a distributed speed test solution across all our store systems.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwRGLwtEbTjqzfBF-3MY0w.png" /><figcaption>Drilldown for each site, displaying metrics for speed, latency, packetloss and averages.</figcaption></figure><h3>The Introduction</h3><p>One of the value propositions of the Talos project was to enable easy deployments of containerized applications across our store systems, at scale, or at the edge of our network topology. At least, that’s what I had promised. A colleague recently approached me with a request: “<em>could we create an easy-to-use visual dashboard to display network bandwidth metrics to various points in our infrastructure from each and every store?”</em> Without hesitation, I responded, <em>“Yes, of course! That should be pretty straightforward..?” ..</em> given that the solution warrants an entire article on it, we already know it wasn’t. 😅</p><p>There are a number of tools around the net that can do this, some of the common are <a href="https://github.com/librespeed/speedtest">Libre speed</a> — and <a href="https://openspeedtest.com/selfhosted-speedtest">OpenSpeedtest</a> but none really did what i wanted.</p><p>So what <em>did</em> we want?</p><h3>The Requirements</h3><p>The goal was to report line speeds from <em>all</em> our stores at random times throughout the day without overloading the network. In fact, the tests should not create <em>any</em> noticeable spikes in our monitoring system. The solution needed to provide clear metrics for upload/download speeds, latency, and packet loss, with the ability to compare results over extended periods. Additionally, a later requirement was added; it had to be simple for support teams and operations staff to manually trigger a speed test at any time.</p><p>Given these requirements, even though we could schedule speed tests to run independently, there would likely be situations where multiple users request tests simultaneously — resulting in several tests running at once. The system needed to support this scenario and include monitoring to track such occurrences, and eventually rate-limit/queue if needed.</p><p>Finally, if there were any degradation in the line — and it was clear that over x amount of days at random intervals of the day this was the case — it should be easy to be able to extract sufficient information to send to our network department, and even an ISP for technical analysis.</p><p>What we needed, was a multi-threaded speed-test server, and 3500+ clients running at a schedule, with a ad-hoc trigger, and a way to get this information back to a central database for consumption via a dashboard.</p><p>So not your average home speed-test.</p><h3>The Design</h3><p>What we came up with, was a speedtest-api-service built in Golang, that has a client and a server counterpart. This coupled with a Time-Series Database (TSDB), and Grafana should be able to get the job done. There were some clear considerations very early on with this design that should be addressed, for example — how do we get around the “what if there was a speedtest triggered at the same time as one running?”.</p><p>You might be wondering: <strong>Is it even worth designing for this scenario?</strong> How likely is it to actually happen? I ran some quick calculations and found that the probability of an ad-hoc test colliding with a scheduled test was only <strong>11.57%</strong>. Honestly, this didn’t matter much to me by then, because by the time I figured out how to<em> do</em> the calculation, I was already handed a really elegant solution to the problem! At this point, it was pretty much — well, why not?</p><p>One of my colleagues, had created a multi-threaded Iperf3 solution, that seemed suitable, namely <a href="https://github.com/patrickfnielsen/iperf-lb">iperf-lb</a></p><blockquote><strong>IPerf3 Loadbalancer that spawns a new IPerf3 server process on-demand.<br></strong>Based on the IPerf3 cookie we loadbalance sessions to the same server process, this allows an infinite number of tests to run at the same time.</blockquote><p>Infinite might be pushing it for our use-case, but — we can definitely work with this, and rate-limit if needed. So the design was finally this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcvniceQwnEZRjJFjanaNg.png" /></figure><p>The speedtest-api-client would communicate with the speedtest-api-server to retrieve the schedule specific to that site. Once the schedule was applied, the client would remain idle until it was time to execute the job.</p><p>During this idle period, it would wake-up and periodically check for any updates to the schedule — just in case there were changes due to errors in the schedule API or if new stores were added, requiring a “re-balancing” of all jobs. After all, JYSK adds new stores every month, growth must be a consideration in everything we do.</p><p><a href="https://gojysk.com/en/news/new-jysk-stores-march-2025">New JYSK stores March 2025</a></p><p>Additionally, the client would listen for requests from the speedtest-api-server, which acted as a proxy for triggering jobs. When a job was executed, the client would perform an upload test, a download test, and a ping test, then send the results back to the speedtest-api-server. These results would be stored in an InfluxDB, ready to be visualized and analyzed in our Grafana instance.</p><blockquote>“The most crucial thing for us was that [the] store users have not been engaged into preparations, and our IT store operations have been not affected by the preparation stage.” <br> — Lucjan Polak, Head of HelpDesk</blockquote><h3>The Scheduler</h3><h4>Server</h4><p>For our stores to run test independently of each other, a time-slot api endpoint was created. The model looked like this:</p><pre>type TimeSchedule struct {<br>   Statistics struct {<br>    MeanGap     time.Duration `json:&quot;meanGap&quot;`<br>    StdDev      time.Duration `json:&quot;stdDev&quot;`<br>    MeanGapText string        `json:&quot;meanGapText&quot;`<br>    StdDevText  string        `json:&quot;stdDevText&quot;`<br>    Count       int           `json:&quot;count&quot;`<br>   } `json:&quot;statistics&quot;`<br>   Timeslots []Timeslot `json:&quot;timeslots&quot;`<br>}<br><br>type Timeslot struct {<br> Store         string    `json:&quot;store&quot;`<br> Cron          string    `json:&quot;cron&quot;` // this would define the time-slot <br> Text          string    `json:&quot;text&quot;`<br>}</pre><p>This provided us with a list of stores, and their respective “time slot” for job execution.</p><p>The time slot function, when ran should always provide us with the same data until a seed is changed. This ensures we are not constantly changing our schedule. Therefore, each store gets it’s own hash. To ensure we do not collide our store times we use a <a href="https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function">Fowler–Noll–Vo</a> (or <strong>FNV</strong>) hash function from the hash/fn package. This provides a deterministic way to create the same hash for each store.</p><p>The seed is rotated automatically every week, which generates a new schedule. Because of this rotation, the function is not fully considered idempotent, as the output changes over time. To make it fully idempotent, we would need to provide the seed from the client, ensuring that the same input (including the seed) always produces the same output. I think this would be over-engineering a little, so, for now — we stopped here 😃</p><pre>// hashStoreID hashes the storeID to a slot number using the 32-bit FNV-1a hash function.<br>// FNV-1a is chosen for its speed and low collision rate, ensuring a uniform distribution<br>// of storeIDs across slots to avoid collisions and maintain fairness.<br>func hashStoreID(storeID string) (int, error) {<br>    // Initialize a new FNV-1a hash object<br>    h := fnv.New32a()<br><br>    // Write the storeID bytes to the hash object<br>    _, err := h.Write([]byte(storeID))<br>    if err != nil {<br>        return 0, err<br>    }<br>    // Compute the hash, modulo totalStores, to ensure the result is within the valid range<br>    return int(h.Sum32()) % totalStores, nil<br>}</pre><p>For our seed we create a uuid, then convert this to a int64.</p><p>At this point, you might start thinking — wow, ok — so this is a <em>little</em> over engineered for a speed test service, and you are probably right. However, I can see this time-schedule having many other use-cases going forward, and a very nice solution to “How to not DDoS yourself..”.</p><p>I won’t go into great detail at this point, but to generate our time slot, we randomize the stores, again with our seed and create a small function to assign each store, a time slot within a week.</p><p>There are some further calculations to create some metrics, for StandardDeviation, MeanGap and Count — these are useful to determine the fairness of the time slots assigned, and the time between each timeslot.</p><p>Finally, we can “publish” our time-slot schedule, and each client can pick their associative time with their SiteID/StoreID.</p><h4>Client</h4><p>The speedtest-api-client will fetch the above schedule, every x minutes — and apply the changes if there are any. I am using a cron-scheduler package to parse our time-slots and apply our jobs.</p><p>Our client should be able to initially fetch the schedule, and update. So two functions are created InitScheduler and UpdateScheduler both functions pass f func() which is the function to run on the specific schedule string</p><pre>// snip<br>func InitScheduler(schedule string, f func(), desc string, initialFire bool) (cronJob *cron.Cron, err error) {<br> cronJob = cron.New(<br>  cron.WithSeconds(),<br>  cron.WithChain(<br>   cron.SkipIfStillRunning(cron.DefaultLogger),<br>  ),<br> )<br><br>  jobID, err := cronJob.AddFunc(schedule, func() {<br>    slog.Info(&quot;scheduler&quot;, &quot;status&quot;, &quot;staring job&quot;, &quot;job&quot;, desc)<br>    f()<br>    slog.Info(&quot;scheduler&quot;, &quot;status&quot;, &quot;finished job&quot;, &quot;job&quot;, desc)<br>   })<br>  // snip<br>   cronJob.Start()<br>   return<br>}<br>  <br><br>func UpdateSchedule(cronEntry *cron.Cron, schedule string, f func()) (err error) {<br> <br> slog.Info(&quot;updating speedtest job to scheduler&quot;, &quot;schedule&quot;, schedule)<br> _, err = cronEntry.AddFunc(schedule, func() {<br>  slog.Info(&quot;scheduler&quot;, &quot;status&quot;, &quot;staring job&quot;)<br>  f()<br>  slog.Info(&quot;scheduler&quot;, &quot;status&quot;, &quot;finished job&quot;)<br> })<br> // snip<br> // re-schedule our jobs<br> slog.Info(&quot;starting scheduler&quot;)<br> for _, entry := range cronEntry.Entries() {<br>  next := entry.Schedule.Next(time.Now())<br>  slog.Info(&quot;scheduler&quot;, &quot;next&quot;, next)<br> }<br> return<br>}</pre><p>The job itself is simply an iperf3 exec.Command directly in the container. We provide a server, the storeid, and which direction to test (either forward or reverse). We then marshal the results against an iperf3 model (i just grabbed the json, and ran it through an online <a href="https://transform.tools/json-to-go">Json2GoStruct</a>) and ship them off to our speedtest-api-server .</p><p>An example of calling iperf3 from our SpeedTestStart function:</p><pre>func SpeedTestStart(speedtestServer string, store string, direction string) (data *model.IPerf3, err error) {<br><br>slog.Info(&quot;speedtest&quot;, &quot;status&quot;, &quot;running&quot;, &quot;direction&quot;, direction)<br> cmd := exec.Command(&quot;iperf3&quot;, &quot;-c&quot;, speedtestServer, &quot;--json&quot;, direction, &quot;-P&quot;, &quot;2&quot;, &quot;-t&quot;, &quot;10&quot;)<br> var outBuf, errBuf bytes.Buffer<br> cmd.Stdout = &amp;outBuf<br> cmd.Stderr = &amp;errBuf<br> err = cmd.Run()<br> if err != nil {<br>  slog.Error(&quot;speedtest&quot;, &quot;status&quot;, outBuf.String())<br>  logError(&quot;speedtest command running error&quot;, err)<br>  os.Exit(1)<br> }<br> err = json.Unmarshal([]byte(outBuf.String()), &amp;data)<br> if err != nil {<br>  logError(&quot;speedtest&quot;, err)<br>  os.Exit(1)<br> }<br> slog.Info(&quot;speedtest&quot;, &quot;status&quot;, &quot;completed&quot;, &quot;duration&quot;, fmt.Sprintf(&quot;%.1fsec&quot;, data.End.SumSent.Seconds))<br> slog.Debug(outBuf.String())<br>...<br> return<br>}</pre><p>The important part here is:</p><pre>cmd := exec.Command(&quot;iperf3&quot;, &quot;-c&quot;, speedtestServer, &quot;--json&quot;, direction, &quot;-P&quot;, &quot;2&quot;, &quot;-t&quot;, &quot;10&quot;)</pre><h3>The Dashboard</h3><p>When it comes to dashboards, I’ll admit I’m biased. I’ve always preferred Grafana for its simplicity.</p><p>The dashboards we have are an overview of speed-test results that can provide a 95th percentile view. This is useful to spot outliers, and problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xccdZmql2IlO4ysE0ex33w.png" /><figcaption>A simple overview of all sites, over the past 30d</figcaption></figure><p>The second is a drill-down view of each store:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwRGLwtEbTjqzfBF-3MY0w.png" /><figcaption>Drilldown for each site, displaying metrics for speed, latency, packetloss and averages.</figcaption></figure><p>From here we can easily have an overview of all store networks.</p><h3>The Improvements</h3><p>After the initial deployment of our speed-test solution, it was immediately taken into use — and in a matter of days tickets started to trickle in to our Helpdesk asking <strong>how users can trigger the speed-test manually.</strong> So, naturally, my response was — <em>“Great idea, lets do it! I’ll get back to you”</em>. Not really knowing what that involved. (You would think i had learnt my lesson the first time).</p><p>Actually, this wasn’t that hard to implement. Creating an ingress on our deployment, adding a route into our application with a simple trigger, and some logic to stop multiple tests being ran at the same time.</p><pre>func Speedtest(app *fiber.App) {<br> app.Get(&quot;/api/v1/speedtest&quot;, handlers.Speedtest).Name(&quot;speedtest&quot;)<br>}</pre><p>Using the fiber package in Golang, to create the http routes, and the handler Speedtest — I introduced a tryLock() function to handle if the test was already running.</p><pre>var (<br> testMutex sync.Mutex<br> locked    bool<br>)<br><br>// ReturnSchedule function to return the schedule for all the stores<br>func Speedtest(c *fiber.Ctx) error {<br> slog.Info(&quot;Speedtest&quot;, &quot;status&quot;, &quot;requesting adhoc speedtest&quot;)<br> // Try to lock the mutex<br> if !tryLock(&amp;testMutex) {<br>  slog.Info(&quot;Speedtest&quot;, &quot;status&quot;, &quot;trylock! another speedtest is running...&quot;)<br>  return c.Status(fiber.StatusConflict).JSON(fiber.Map{<br>   &quot;error&quot;:   true,<br>   &quot;message&quot;: &quot;Another test is already running, please try again later&quot;,<br>  })<br> }<br> defer func() {<br>  testMutex.Unlock()<br>  locked = false<br> }()<br> // Run the test suite<br> results, err := testsuite.RunTestSuite()<br> if err != nil {<br>  return fiber.NewError(fiber.StatusInternalServerError, err.Error())<br> }<br> // Send the results back in JSON format<br> return c.Status(fiber.StatusOK).JSON(fiber.Map{<br>  &quot;error&quot;:   false,<br>  &quot;message&quot;: &quot;Speedtest completed successfully&quot;,<br>  &quot;data&quot;:    results,<br> })<br>}<br>// tryLock tries to lock the mutex and returns true if successful<br>func tryLock(m *sync.Mutex) bool {<br> if locked {<br>  return false<br> }<br> m.Lock()<br> locked = true<br> return true<br>}</pre><p>Other improvements are in the pipeline, export results in a standardize format to be able to send to ISP’s, and network professionals, providing an API for export of raw data, adding more test endpoints and configurable iperf3 flags is also on my list, for now though — people are happy.</p><blockquote>“The rapid deployment of our global bandwidth monitoring tool has transformed our approach to managing and monitoring bandwidth, on a massive scale. The value is clear.” — Keld Marott, Executive Vice President IT, JYSK</blockquote><h3>The Result</h3><p>So now we can trigger the test in any of the sites by a simple http GET request. This was then added to our Store Platform so users can trigger this in their “domain”.</p><p>With some quick UI hackery the following was created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PxjbWijUlnu0bQHP6ZmaHg.gif" /><figcaption>A (sped up) example of our store platform performing an ad-hoc speed-test.</figcaption></figure><blockquote>“The implementation of this solution has transformed our approach to bandwidth monitoring. What was once a tedious, manual process has now become an automated, data-driven system that provides real-time insights. This not only improves operational efficiency but also empowers multiple departments across JYSK to make data-backed decisions regarding network infrastructure and IT initiatives.”<em> — </em><strong><em>Anders Harder,</em></strong><em> the Category Manager for Software and Telecom —</em><strong><em> IT Procurement, JYSK</em></strong></blockquote><h3>The Remarks</h3><p>After a few months of providing the service, we noticed backlog issues related to incorrect speed reporting. This immediately caught my attention. Some of our operations engineers had compared results from our speed test app with a manual iperf3 command run on Windows and found discrepancies. After some investigation, we discovered differences in caching between Linux and Windows. As a quick test, we reversed the test order—starting the upload before the download—and, to our surprise, it made a significant difference. The root cause remains unclear—whether it&#39;s an issue with Linux, Talos, the CNI layer, the container level, or even a buggy iperf3 version.</p><p>To be continued… but for now, it works again. 👍</p><p>In addition, this mini project sparked another idea — we encountered a DNS issue (or rather, the absence of ) on our Talos nodes. The speedtest ad-hoc triggers required a simple way to reach the service, and the nodes took any IP available, via DHCP when booting up, thus is not registered with any DNS. A solution has since been rolled out, but that’s a story for another time — stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eabdcc668611" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/orchestrating-thousands-of-speedtests-using-kubernetes-eabdcc668611">Orchestrating thousands of Speedtests, using Kubernetes</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Packer and Talos Image Factory on Proxmox]]></title>
            <link>https://jysk.tech/packer-and-talos-image-factory-on-proxmox-76d95e8dc316?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/76d95e8dc316</guid>
            <category><![CDATA[talos-linux]]></category>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[hashicorp-packer]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Thu, 13 Feb 2025 16:33:13 GMT</pubDate>
            <atom:updated>2025-02-13T16:33:13.356Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*vY8VGHmeW5skIYu99JkSDg.png" /></figure><blockquote>Hashicorp’s <a href="https://www.packer.io/">Packer</a> is an open-source tool for creating identical machine images for multiple platforms from a single source configuration. It automates the process of building pre-configured images, ensuring consistency across environments. Packer uses a JSON or HCL templates to define the image build process, including provisioning steps.</blockquote><p>During our <a href="https://jysk.tech/3000-clusters-part-3-how-to-boot-talos-linux-nodes-with-cloud-init-and-nocloud-acdce36f60c0"><strong>3000+ Clusters Part 2: The journey in edge compute with Talos Linux</strong></a> article i mentioned that we are using <a href="https://www.packer.io/">Packer</a> to create our image. Below is a quick guide on how this is done.</p><p><a href="https://jysk.tech/3000-clusters-part-2-the-journey-in-edge-compute-with-talos-linux-82f42bf9f958">3000+ Clusters Part 2: The journey in edge compute with Talos Linux</a></p><h3>Getting Started</h3><p>The idea is for Packer to create the VM to our specification, boot up some sort of live OS where it can download Talos from their image factory API. This is an API where we can define how we want our image to look. In our case, i went for something small — Arch Linux. The image is then written to a boot disk on the VM node, shutdown and converted to a template with some sensible naming.</p><p>So, to start either download a live image ISO and add to your Promox host, or we can just us the download URL and let Packer/Proxmox do this for us.</p><p>We will also need an <a href="https://pve.proxmox.com/pve-docs/pveum-plain.html">API token</a> for Packer to interact with the PVE API, we will use this later.</p><h3>Defining the build</h3><pre>$ mkdir talos_packer &amp;&amp; cd talos_packer</pre><h4><strong>Variables</strong></h4><p>Create a variables.pkr.hcl and add the following, these are what we will use in our build:</p><pre>variable &quot;proxmox_username&quot; {<br>  type = string<br>}<br><br>variable &quot;proxmox_token&quot; {<br>  type = string<br>}<br><br>variable &quot;proxmox_url&quot; {<br>  type = string<br>}<br><br>variable &quot;proxmox_nodename&quot; {<br>  type = string<br>}<br><br>variable &quot;proxmox_storage&quot; {<br>  type = string<br>}<br><br>variable &quot;proxmox_storage_type&quot; {<br>  type = string<br>}<br><br>variable &quot;static_ip&quot; {<br>  type = string<br>}<br><br>variable &quot;gateway&quot; {<br>  type = string<br>}<br><br>variable &quot;talos_version&quot; {<br>  type    = string<br>  default = &quot;v1.9.2&quot;<br>}</pre><h4><strong>Create a build file</strong></h4><p>Create a proxmox.pkr.hcl file that defines our build. We need to create a source definition, and a packer definition, and will utilise the github.com/hashicorp/proxmox plugin.</p><pre>packer {<br>  required_plugins {<br>    proxmox = {<br>      version = &quot;&gt;= 1.1.7&quot;<br>      source  = &quot;github.com/hashicorp/proxmox&quot;<br>    }<br>  }<br>}<br><br>locals {<br>  timestamp = timestamp()<br>}<br><br>source &quot;proxmox-iso&quot; &quot;talos&quot; {<br>  proxmox_url              = var.proxmox_url<br>  username                 = var.proxmox_username<br>  token                    = var.proxmox_token<br>  node                     = var.proxmox_nodename<br>  insecure_skip_tls_verify = true<br>  iso_file                 = &quot;local:iso/archlinux-x86_64.iso&quot;<br><br>  # If you want to use a mirror directly, the below works nice. <br>  # iso_url = &quot;https://mirrors.dotsrc.org/archlinux/iso/2024.02.01/archlinux-x86_64.iso&quot;<br>  # iso_checksum = &quot;sha256:891ebab4661cedb0ae3b8fe15a906ae2ba22e284551dc293436d5247220933c5&quot;<br>  # iso_storage_pool = &quot;local&quot;<br>  # iso_download_pve = true<br><br>  unmount_iso              = true<br>  os                   = &quot;l26&quot;<br>  scsi_controller = &quot;virtio-scsi-pci&quot;<br><br>  network_adapters {<br>    bridge = &quot;vmbr0&quot;<br>    model  = &quot;virtio&quot;<br>  }<br><br>  disks {<br>    type         = &quot;virtio&quot;<br>    storage_pool = var.proxmox_storage<br>    format     = &quot;qcow2&quot;<br>    disk_size  = &quot;20GB&quot;<br>  }<br><br>  disks {<br>    type         = &quot;virtio&quot;<br>    storage_pool = var.proxmox_storage<br>    format     = &quot;qcow2&quot;<br>    disk_size  = &quot;10GB&quot;<br>  }<br><br>  memory       = 4096<br>  cpu_type     = &quot;host&quot;<br>  sockets      = 2<br>  cores        = 2<br>  tags         = &quot;${var.talos_version};template&quot;<br><br>  ssh_username = &quot;root&quot;<br>  ssh_password = &quot;packer&quot;<br>  ssh_timeout  = &quot;15m&quot;<br><br>  qemu_agent   = true<br><br>  template_name = &quot;talos-template-${var.talos_version}-qemu&quot;<br>  template_description = &quot;${local.timestamp} - Talos ${var.talos_version} template&quot; <br><br>  boot_wait = &quot;20s&quot;<br>  boot_command = [<br>    &quot;&lt;enter&gt;&lt;wait50s&gt;&quot;,<br>    &quot;passwd&lt;enter&gt;&lt;wait1s&gt;packer&lt;enter&gt;&lt;wait1s&gt;packer&lt;enter&gt;&quot;,<br>    &quot;ip address add ${var.static_ip} broadcast + dev ens18&lt;enter&gt;&lt;wait&gt;&quot;,<br>    &quot;ip route add 0.0.0.0/0 via ${var.gateway} dev ens18&lt;enter&gt;&lt;wait&gt;&quot;,<br>    &quot;ip link set dev ens18 mtu 1300&lt;enter&gt;&quot;,<br>  ]<br>}</pre><p>There are a few things custom to our environment here, for example, the naming of the template talos-template-${var.talos_version}-qemu and various tags. The interesting part, (i think) is the boot_command</p><pre>&quot;&lt;enter&gt;&lt;wait50s&gt;&quot;,<br>&quot;passwd&lt;enter&gt;&lt;wait1s&gt;packer&lt;enter&gt;&lt;wait1s&gt;packer&lt;enter&gt;&quot;,</pre><p>This basically creates actions, i.e. keystrokes and wait-times on the console of the VM. It basically mimics a user, it also defines some quirky network limitations we have, namely setting MTU.</p><p>In addition, we also define our disks — one for the Talos OS, and one for <a href="https://github.com/rancher/local-path-provisioner">local-storage-provisioner</a> for our Kubernetes workloads to use if needed. We define memory, cpus, and in our case qemu_agent = true — i will get to this in a second.</p><h4><strong>Define local variables</strong></h4><p>In vars/local.pkvars.hcl — these are values for the definitions we defined earlier, and will add the following:</p><pre>proxmox_storage      = &quot;local&quot;<br>proxmox_storage_type = &quot;lvm&quot;<br>talos_version        = &quot;v1.9.2&quot;         // or leave out to accept the default<br>static_ip            = &quot;10.0.30.163/25&quot; // static IP of the arch linux vm<br>gateway              = &quot;10.0.30.129&quot;    // and gw<br>// you can also add more in here, like proxmox_host etc..</pre><p>I prefer to use env vars for my Proxmox configuration, that is proxmox_username and proxmox_host and so on, so i run this with the command itself.</p><h4>Creating and writing the Talos Image Factory</h4><blockquote>The Talos Linux Image Factory, developed by <a href="https://siderolabs.com/">Sidero Labs, Inc.</a>, offers a method to download various boot assets for <a href="https://talos.dev/">Talos Linux</a>.</blockquote><p>The Talos Image factory service is an API (or webui) that can take a schema file and create a custom image for us to use. We are interested in the NoCloud imag for our builds, and we would like to add the siderolabs/qemu-guest-agent to our build, hence why we set the guest_agent = true in our Packer build file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mK-HWbFYTeuEWQ6UGsBlw.png" /></figure><p>From here, we “simply” download our image through the API (through a proxy), with a schema, create a files/schema.yaml and add the following:</p><pre>customization:<br>  systemExtensions: <br>    officialExtensions: <br>      - siderolabs/qemu-guest-agent</pre><p>Then using dd we can extract the image directly to our disks on the VM.</p><p>That can easily be scripted in our Packer build, this will be added to the proxmox.pkr.hcl file following way:</p><pre>build {<br>  name    = &quot;release&quot;<br>  sources = [&quot;source.proxmox-iso.talos&quot;]<br><br><br>  provisioner &quot;file&quot; {<br>    source = &quot;./files/schematic.yaml&quot;<br>    destination = &quot;/tmp/schematic.yaml&quot;<br>  }<br><br>  provisioner &quot;shell&quot; {<br>    inline = [<br>      &quot;echo &#39;Setting Up Proxy&#39;&quot;,<br>      &quot;export HTTP_PROXY=http://proxy.domain.com:8080&quot;,<br>      &quot;export HTTPS_PROXY=http://proxy.domain.com:8080&quot;,<br>      &quot;export NO_PROXY=domain.com&quot;,<br>      &quot;echo &#39;Requesting build image from Talos Factory&#39;&quot;,<br>      &quot;ID=$(curl -kLX POST --data-binary @/tmp/schematic.yaml https://factory.talos.dev/schematics | grep -o &#39;\&quot;id\&quot;:\&quot;[^\&quot;]*&#39; | sed &#39;s/\&quot;id\&quot;:\&quot;//&#39;)&quot;,<br>      &quot;URL=https://pxe.factory.talos.dev/image/$ID/${var.talos_version}/nocloud-amd64.raw.xz&quot;,<br>      &quot;echo &#39;Downloading build image from Talos Factory: &#39; + $URL&quot;,<br>      &quot;curl -kL \&quot;$URL\&quot; -o /tmp/talos.raw.xz&quot;,<br>      &quot;echo &#39;Writing build image to disk&#39;&quot;,<br>      &quot;xz -d -c /tmp/talos.raw.xz | dd of=/dev/vda &amp;&amp; sync&quot;,<br>      &quot;echo &#39;Done&#39;&quot;,<br>    ]<br>  }<br><br>}</pre><p>You should now have the following structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*Ir0vWxK3YI1eQ5-PogsOUA.png" /></figure><h3>Building our image</h3><p>Once all the “hard work” is done, we can simply build our image from the CLI. As stated earlier, i like to define some variables in my environment so i can easily script this via some automation later on.</p><p>We need a token create in our Promox instance, and we can define the following env vars:</p><pre>export PROXMOX_TOKEN_ID=&#39;user@domain.com!packer&#39;<br>export PROXMOX_TOKEN_SECRET=&#39;my-key&#39;<br>export PROXMOX_HOST=&quot;https://pve.domain.com:8006/api2/json&quot;<br>export PROXMOX_NODE_NAME=&quot;my-node-name&quot;<br>export CLUSTER_NAME=&quot;my-cluster-name&quot;</pre><p>Then run the build</p><pre>packer build -on-error=ask  \<br>  -var-file=&quot;vars/local.pkrvars.hcl&quot; \<br>  -var proxmox_username=&quot;${PROXMOX_TOKEN_ID}&quot; \<br>  -var proxmox_token=&quot;${PROXMOX_TOKEN_SECRET}&quot; \<br>  -var proxmox_nodename=&quot;${PROXMOX_NODE_NAME}&quot; \<br>  -var proxmox_url=&quot;${PROXMOX_HOST}&quot; .</pre><p>Eventually, the build will hopefully complete</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*2DXSFGTNtaukjMff_Mbdfw.png" /></figure><p>And we now have an image we can deploy using <a href="https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html">Cloud-Init NoCloud</a> (or any other cloud-init method)</p><p>The process is now rinse and repeat for any new versions of Talos, simply adjust thevars/local.pkvars.hcl to the version you need, and re-run the build. This can of course be fully automated in the CI of your choice 😃</p><p>Have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76d95e8dc316" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/packer-and-talos-image-factory-on-proxmox-76d95e8dc316">Packer and Talos Image Factory on Proxmox</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3000+ Clusters Part 3: How to boot Talos Linux nodes with cloud-init and NoCloud]]></title>
            <link>https://jysk.tech/3000-clusters-part-3-how-to-boot-talos-linux-nodes-with-cloud-init-and-nocloud-acdce36f60c0?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/acdce36f60c0</guid>
            <category><![CDATA[cloud-init]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[talos-linux]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 07:02:47 GMT</pubDate>
            <atom:updated>2025-02-18T08:11:00.548Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*0vlkTyG_q6JmDQMqTZ892g.png" /></figure><blockquote>In this article, we dive into a custom built API for generating data for our NoCloud Talos nodes. We’ll examine its design, security measures, and the associated tooling. Finally, we’ll walk through the setup of our node in Proxmox.</blockquote><p>In our previous post, “<a href="https://jysk.tech/3000-clusters-part-2-the-journey-in-edge-compute-with-talos-linux-82f42bf9f958">3000+ Clusters Part 2: The journey in edge compute with Talos Linux</a>”, we looked at what was required to deploy Talos to our in-store systems. Our proof of concept reveled some challenges with configuration, management and lifecycle. Our solution was to build a “simple” API that can provision a no-cloud deployment. A CLI tool that can aid in management of the Kubernetes nodes. GitOps practices that can be used to deploy workloads to thousands of stores, in bulk — safely, and finally a robust monitoring and alerting system to ensure the health and performance of our Kubernetes clusters across all locations.</p><p>Let’s make one thing clear: <strong>Sidero Omni</strong> is an exceptional solution. I run it in my homelab, and it’s truly impressive how seamlessly it works right out of the box. It’s capable of managing thousands of clusters effortlessly and handles the entire lifecycle of operations, from Day 0 to Day 2. It’s a robust, feature-rich platform that delivers on its promises. So, you might ask, why are we even considering creating a custom solution when Sidero Omni already does so much so well?</p><p>The answer is simple: because we can. Because it’s possible. We identified a specific problem that required a more tailored approach — a solution that didn’t need the full breadth of Sidero Omni’s capabilities but instead focused on a smaller, more refined feature set. We wanted something purpose-built to address our unique needs. And so, what started as a proof of concept (PoC) evolved into a production-ready solution — almost by accident 😉</p><h3>The API</h3><p>My choice of poison? Golang. Why? Not only because i simply <em>“like it”</em> but the support for main stream projects is there. Kubernetes is built in Golang, Talos is built around Golang, and there are many other projects used around our stack that has Golang packages we can simply hook into.</p><p>We need a (secure) API, a CLI (support for windows, linux, mac), and a few databases. Postgres will be used to store the configuration of all clusters, and <a href="https://victoriametrics.com/">VictoriaMetrics</a> (Prometheus) will be used to store our metrics. For authentication to our API, we will use <a href="https://github.com/oauth2-proxy/oauth2-proxy">OAuth2Proxy</a> — this simplifies our authentication process.</p><p>The API will provide information to our Talos nodes, and users. Talos supports cloud-init, through no-cloud — lets take a look.</p><h3>What is cloud-init?</h3><p>cloud-init is the <em>industry standard</em> multi-distribution method for cross-platform cloud instance initialization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/167/0*rt4tOl_DjKTIfcrH.png" /></figure><blockquote>Cloud-init discovers four types of configuration at runtime. The source of these configuration types is configurable with a discovery configuration. This discovery configuration can be delivered to cloud-init in different ways, but is different from the configurations that cloud-init uses to configure the instance at runtime.</blockquote><h4>user-data</h4><p>User-data is a <a href="https://cloudinit.readthedocs.io/en/latest/explanation/format.html#user-data-formats">configuration format</a> that allows a user to configure an instance.</p><h4>meta-data</h4><p>The meta-data file is a YAML-formatted file which contains cloud-provided information to the instance. This is required to contain an instance-id, with other cloud-specific keys available.</p><h4>vendor-data</h4><p>Vendor-data may be used to provide default cloud-specific configurations which may be overriden by user-data. This may be useful, for example, to configure an instance with a cloud provider’s repository mirror for faster package installation.</p><h4>network config</h4><p>Network configuration typically comes from the cloud provider to set cloud-specific network configurations, or a reasonable default is set by cloud-init (typically cloud-init brings up an interface using DHCP).</p><h3>The Implementation</h3><p>I will not go through the entire codebase, only parts that make sense to the design. After we have established our api-server instance, with correct routes, middleware, logging etc — we need to define our handlers for returning the no-cloud data.</p><p>A colleague of mine once convinced me to take a look at <a href="https://github.com/gofiber/fiber">fiber</a>, and since doing so i’ve grown to like it. We are using this to run our API, and the following NoCloudRoutes are added:</p><pre>func NoCloudRoutes(app *fiber.App) {<br> // Basic Auth middleware configuration<br> basicAuth := basicauth.New(basicauth.Config{<br>  Users: map[string]string{<br>  // get crendentials here<br>  },<br> })<br><br> // Create a group for the routes we want to protect with basic auth<br> storeGroup := app.Group(&quot;/store/:device&quot;, basicAuth)<br><br> // Apply the basic auth middleware to specific routes by adding them to the protected group<br> storeGroup.Get(&quot;/user-data&quot;, handlers.ReturnUserDate)<br> storeGroup.Get(&quot;/meta-data&quot;, handlers.ReturnMetaData)<br> storeGroup.Get(&quot;/network-config&quot;, handlers.ReturnNetworkConfig)<br> storeGroup.Get(&quot;/smi&quot;, handlers.ReturnSMI)<br>}  </pre><p>From here, we can create the Handlers, and in our ReturnUserData handler, we need to call a NewProvisioner after some logic is ran to determine if we have a configuration or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmyFL5xTQhCNS7GKeJfFsw.png" /><figcaption>A sequence diagram explaining the generation of user-data / machine data</figcaption></figure><p>Our NewProvisioner and has an interface called Provisioner which has Retrieve(), AddToDB() and ReturnControlPlan() methods and is defined as follows:</p><pre>// Provisioner interface that has a storeID<br>type Provisioner interface {<br> Retrieve() (existing bool, err error)<br> AddToDB() (err error)<br> ReturnControlPlane() []byte<br>}<br><br>// provisioner struct that implements the Provisioner interface<br>type provisioner struct {<br> Device      string<br> Node        net.IP<br> Bundle      *bundle.Bundle<br> DeviceMeta  meta.Metadata<br> TalosConfig *model.TalosConfig<br>}<br><br>// NewProvisioner method to create a new Provisioner instance<br>// Only Node, Device and DeviceMeta is saved for now, the rest is added<br>// in later methods.<br>func NewProvisioner(metadata meta.Metadata, node net.IP) Provisioner {<br> return &amp;provisioner{<br>  Node:       node, //store the ip<br>  Device:     metadata.Hostname, //device hostname <br>  DeviceMeta: metadata, //meta.Metadata - parses the hostname<br> }<br>}<br><br>func (p *provisioner) Retrieve() (existing bool, err error) {...}<br>func (p *provisioner) AddToDB() (err error) {...}<br>func (p *provisioner) ReturnControlPlane() []byte {...}<br><br>// generate method to generate the Talos config bundle<br>func (p *Provisioner) generate() (configBundle *bundle.Bundle, err error) {...}<br><br>// ... other random private methods, and functions below</pre><p>The Retrieve() method is responsible for retrieving the configuration bundle for a device. If the configuration bundle <em>exists</em> in the database and the <strong>reset flag (explained later) </strong>is <em>not</em> set, it returns the existing data. If the configuration bundle does <em>not exist</em> or the <strong>reset flag</strong> <em>is</em> set, it generates a new configuration bundle via a private method generate() and saves it to the database via AddToDB()</p><p>We are using the <strong>Talos Machinery </strong>packages for generating the correct configuration bundle in generate().</p><pre>&quot;github.com/siderolabs/talos/pkg/machinery/config/bundle&quot;<br>&quot;github.com/siderolabs/talos/pkg/machinery/config/generate&quot;<br>&quot;github.com/siderolabs/talos/pkg/machinery/config/machine&quot;<br>&quot;github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1&quot;</pre><p><strong>Why the reset flag?</strong></p><p>When a new node is provisioned, it contacts our endpoint to fetch its configuration. If the node fails, is wiped, or undergoes hardware changes, it can simply retrieve its “old” configuration. However, if we intentionally want to start fresh — whether for an upgrade or to enable new features — we can flag the existing configuration for deletion.</p><p>This approach allows us to retain access to the certificates, TalosConfig, and KubeConfig files until the node is ready for its new configuration (which is particularly useful for talosctl logging). Once the node is prepared, we can wipe the old record and configuration, generate a new one, and return it to the node. This ensures a smooth, automated transition while maintaining control over the provisioning process.</p><p>Finally, ReturnControlPlane is simply:</p><pre>// ReturnControlPlane method to get the control plane data<br>func (p *provisioner) ReturnControlPlane() []byte {<br> controlPlaneData := p.TalosConfig.MachineData<br> return []byte(controlPlaneData)<br>}</pre><p>I appreciated this is a little high-level, and i have intentionally skipped some logic to keep it abstract, but this demonstrates the basic flow in our API. At this point i also want to say i’m not, by any means a <em>hardcore</em> Golang developer, so there are perhaps other ways to do this. This works for us, and is stable for 3000+ clusters 😅</p><h3>OpenAPI (OAS)</h3><p>Any good API wouldn’t be complete with an OpenAPI implementation. The OpenAPI Specifications (OAS) provide a formal standard for describing HTTP APIs. This allows people to understand how an API works, how a sequence of APIs work together, generate client code, create tests, apply design standards, and much, much more.</p><p>We are using <a href="https://github.com/swaggo/swag">swag-go</a> for our OpenAPI setup, Swag converts Go annotations to Swagger Documentation 2.0.</p><p>Example:</p><pre>// @Summary  Get Talos Control Plane Data<br>// @Description Get Talos Control Plane Data<br>// @Tags   Talos Provisioner<br>// @Produce  text/plain<br>// @Param   device path string true &quot;Device ID&quot;<br>// @Router   /store/{device}/user-data [get]<br>//<br>// ReturnUserData method to return the user data, which is the machine data in talos.<br>func ReturnUserData(c *fiber.Ctx) error {...}</pre><p>SwagGo works by finding all functions with tags, and creating an OpenAPI specification from our definition. This is really nice as we can simply document as we code.</p><p>We add our routes to our API:</p><pre> app.Get(&quot;/swagger/*&quot;, swagger.New(swagger.Config{<br>  InstanceName:    &quot;talosprovisioner&quot;,<br>  DocExpansion:    &quot;list&quot;,<br>  TryItOutEnabled: true,<br> }))</pre><p>This creates a nice web UI that can be used for “documentation”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yr8RINajjZZqwAEAxawB1Q.png" /><figcaption>Here you get an nice overview of our API</figcaption></figure><h3>Local dev: Just — a command runner</h3><p><a href="https://github.com/casey/just">GitHub - casey/just: 🤖 Just a command runner</a></p><p>I like to use just for my local dev work, it simplifies the workflow, for example i can run just docs for creating our documentation (see above). In my justfile i have:</p><pre>docs:<br> @echo &quot;  &gt;  Generating docs&quot;<br> swag fmt -g cmd/api/main.go<br> swag init -g cmd/api/main.go --parseVendor --output docs/talosprovisioner/ --instanceName talosprovisioner</pre><p>Thus, i can simply call just docs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AacWHJL_GexLU2Bic_Aq3g.png" /></figure><p>Our application also involves a CLI tool, and prefer to build this into the project. Therefore, running something like:</p><pre>just run api &quot;--debug&quot;</pre><pre>just run cli &quot;get kubeconfig -n mynode --debug&quot;</pre><p>Simply starts the relevant application, if the folder structure permits. I tend to follow this <a href="https://github.com/golang-standards/project-layout">opinonated</a> folder structure.</p><pre># run executable for local OS<br>run target args=&quot;&quot;:<br>    @echo &quot;Running {{target}} with args {{args}}...&quot;<br>    MYENV=123 \<br>    go run -ldflags=&quot;-X &#39;main.version={{version}}&#39;&quot; cmd/{{target}}/main.go {{args}}</pre><h3>The CLI</h3><p>The CLI has to be able to retrieve kubeconfig and taslosconfig from our API. Of course, due to the nature of these files we also have some authentication to consider. I took a lot of inspiration from <a href="https://github.com/int128/kubelogin">kubelogin</a> on how they are setting up the OIDC flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0oOJg6zLbWBGnBKxLJf2UQ.png" /><figcaption>OIDC flow in our CLI app.</figcaption></figure><p>The token is then saved, and sent with requests to our API, which uses the OIDC certificate to check. This means that the Oauth2Proxy plugin must pass all api calls direct to our API, and not authenticate them itself:</p><pre>...<br>pass_basic_auth = true<br>pass_user_headers = true<br>pass_host_header = true<br>pass_access_token = true<br><br>skip_auth_routes = [<br>  &quot;^/store&quot;,<br>]<br><br>api_routes = [<br>  &quot;^/api&quot;<br>]<br>...</pre><p>So once our authentication is sorted, we can get to the fun part — i have chosen to use <a href="https://github.com/spf13/cobra">cobra</a> as my cli framework. It’s a solid framework, with a good set of features — although, now i question my life choices — it can get a little confusing to navigate. However, the result is decent. A nice, formatted cli thats easy to navigate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlQFhv6LRGcLyg3QBo0kgQ.png" /></figure><p>For now, the following commands are available:</p><p>jysk-talos-cli get kubeconfig -n node -e endpointfor retrieving our kubeconfig, we can choose -admin and the user will get (if they have permission) a certificate with a role as an admin (not cluster-admin, this is only available through talosctl)</p><p>jysk-talos-cli get talosconfig -e endpoint for retrieving our talosctl config, this is for accessing the OS API, seeing logs, mounts and all the other goos stuff Talos Linux offers.</p><p>jysk-talos-cli k9s mycluster -d mydevice this is an attempt a automatically launching k9s with the correct kubeconfig, authentication etc. The problem here is that sometimes some of the functionality simply does not work — specifically shell’ing into containers. I’m actually not sure why yet, so if you have an idea let me know. I assume it’s something to do with how the process is launched from a Golang thread? 🤷‍♂</p><p>Long term plans to work this into another cli solution that covers all of our Kubernetes platforms, however for now this gives the required access needed.</p><h3>NoCloud Boot</h3><p>So, now we have our API, and our CLI — we need to make sure all nodes when booted contact our API, with some authentication. Download the necessarily files which are customized to that node, and the flow of the installation can be given to Talos to complete. There is of course a pre-requisite to this, and that’s using the ISO to boot from. You can use a out of the box no-cloud image from Talos, or using their factory API create your own. There will be a follow-up article in how we are using packer to automate this from the CLI soon. Stay tuned!</p><h4>SMBIOS</h4><p><strong>SMBIOS (System Management BIOS)</strong> is a standard developed by the <a href="https://www.dmtf.org/standards/smbios"><strong>DMTF</strong></a><strong> </strong>that defines a data structure (and access methods) for exposing system hardware and firmware information to operating systems and management software. SMBIOS data is usually stored in the BIOS/UEFI firmware and is accessible to the operating system during boot or runtime. It is commonly used for system inventory, diagnostics, and management.</p><p>Talos can retrieve this information using <a href="https://github.com/siderolabs/go-smbios"><strong>go-smbios</strong></a> and leverage the SERIAL field. This SERIAL field is then utilized to provision cloud-init startup through no-cloud, following their <a href="https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html#method-1-line-configuration">“line configuration”</a> specification. In our case, the SERIAL can be configured to instruct Talos to fetch the necessary data from our API:</p><pre>ds=nocloud-net;s=http://api.domain.com/store/&lt;DEVICE&gt;;h=&lt;HOSTNAME&gt;</pre><blockquote>The “line configuration” is a single string of text which is passed to an instance at boot time via either the kernel command line or in the serial number exposed via DMI (sometimes called SMBIOS).</blockquote><p>All we now need to do is base64 our value and apply to the VM config, You can easily do this in the Proxmox UI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrBBGbGjnCQR7_e-05kvXQ.png" /><figcaption>Navigated to the <strong>VM</strong> &gt; <strong>Options</strong> &gt; <strong>SMBIOS</strong> <strong>Settings</strong> and fill out the serial, this will base64 the value for you.</figcaption></figure><p>However, we need to be able to do this to 3000+ nodes, right? So the following script is used to set the necessary SMBIOS settings in the VM.</p><pre>NEW_SERIAL_NUMBER=$(echo ${SMBIOSSERIAL} | base64 -w 0)<br>...<br>/usr/sbin/qm set ${VMID} --smbios1 uuid=${UUID},serial=${NEW_SERIAL_NUMBER},base64=1</pre><p>This generates the serial number, and applies to the VM, putting this together in a very rough bash script gives:</p><pre>#!/bin/bash<br>set -e<br># Generate our hostname from our hypervisor name prod-loc-pve01<br>VMNAME=$(hostname | sed -e &#39;s/pve/k8s/i&#39;)<br><br># Generate our SMBIOS Serial<br>SMBIOSSERIAL=&quot;ds=nocloud-net;s=https://talos.domain.com/store/${VMNAME}/;h=${VMNAME}&quot;<br>VMID=3002<br>TEMPLATEID=100<br><br># Create linked clone of template<br>/usr/sbin/qm clone ${TEMPLATEID} ${VMID} --name ${VMNAME}<br><br># Set Serial<br>NEW_SERIAL_NUMBER=$(echo ${SMBIOSSERIAL} | base64 -w 0)<br>SMBIOS1=$(/usr/sbin/qm config ${VMID} | grep smbios1)<br><br># Extract the UUID from the current smbios1 settings<br>UUID=$(echo ${SMBIOS1} | sed -n &#39;s/.*uuid=\([^,]*\).*/\1/p&#39;)<br><br># Update the VM with the new serial number, keeping the same UUID<br>/usr/sbin/qm set ${VMID} --smbios1 uuid=${UUID},serial=${NEW_SERIAL_NUMBER},base64=1<br><br># Update the VM&#39;s net0 device with MTU 1300<br>/usr/sbin/qm set ${VMID} --net0 model=virtio,bridge=vmbr1,mtu=1300<br><br>echo &quot;Updated VM ${VMID} with new serial number ${NEW_SERIAL_NUMBER} (UUID: ${UUID})&quot;<br><br># Add some nice tags<br>echo &quot;Tagging VM ${VMID}&quot;<br>sed -i -E &#39;s/(;)?template(;)?//g; s/^tags: ;/tags: /; s/;;/;/g; s/;$//&#39; /etc/pve/qemu-server/${VMID}.conf<br><br>#echo &quot;Adding ACLs ${VMID}&quot;<br>pvesh set /access/acl -path /vms/${VMID} -roles PVEVMUser -groups GROUP_ADMIN<br><br>echo &quot;Started VM ${VMID}&quot;<br>/usr/sbin/qm start ${VMID}</pre><p>This assumes that: we follow a naming structure on our hypervisor which we can generate a hostname for our VM, so we can dynamically give the SMBIOS string the hostname of the node.</p><p>Of course, to make things even easier, we can easily create a <strong>Terraform/OpenTofu</strong> deployment using the telmate/proxmox provider:</p><pre><br>terraform {<br>  required_providers {<br>    proxmox = {<br>      source  = &quot;telmate/proxmox&quot;<br>      version = &quot;3.0.1-rc1&quot;<br>    }<br>  }<br>}<br><br>locals {<br>  name = &quot;k8s-node-hostname&quot;<br>}<br><br>provider &quot;proxmox&quot; {<br>  pm_api_url          = &quot;https://pve.domain.com:8006/api2/json&quot;<br>  pm_api_token_id     = &quot;me@domain.com!terraform&quot;<br>  pm_api_token_secret = &quot;mykey-here&quot;<br>}<br><br>resource &quot;proxmox_vm_qemu&quot; &quot;talos-k8s01&quot; {<br>  name        = local.name<br>  desc        = &quot;${plantimestamp()}: Talos kubernetes node provisioned with Terraform&quot;<br>  target_node = &quot;hypervisor node&quot;<br><br>  cores   = 2<br>  sockets = 2<br><br>  # Same CPU as the Physical host, possible to add cpu flags<br>  # Ex: &quot;host,flags=+md-clear;+pcid;+spec-ctrl;+ssbd;+pdpe1gb&quot;<br>  cpu    = &quot;host&quot;<br>  numa   = false<br>  memory = 6144<br>  onboot = true<br>  agent  = 1<br><br>  # we can boot a no-cloud base image here.. but we want our generated image<br>  # iso = &quot;local:iso/nocloud-amd64.iso&quot;<br>  clone       = &quot;talos-template-v1.9.1-qemu&quot;<br>  full_clone = true # optional, but faster!<br><br>  bootdisk = &quot;virtio0&quot;<br><br>  # network stuff<br>  network {<br>    model  = &quot;virtio&quot;<br>    bridge = &quot;vmbr1&quot;<br>    mtu    = 1300<br>  }<br><br>  scsihw = &quot;virtio-scsi-pci&quot;<br><br>  disks {<br>    virtio {<br>      # Storage for the OS<br>      virtio0 {<br>        disk {<br>          size    = 20<br>          storage = &quot;local&quot;<br>          format  = &quot;qcow2&quot;<br>          backup  = false<br>        }<br>      }<br><br>      # Storage for workloads<br>      virtio1 {<br>        disk {<br>          size    = 10<br>          storage = &quot;local&quot;<br>          format  = &quot;qcow2&quot;<br>          backup  = true<br>        }<br>      }<br>    }<br>  }<br><br>  # connection to our API<br>  smbios {<br>    serial = &quot;ds=nocloud-net;s=https://user:pass@talos.domain.com/store/${local.name}/;h=${local.name};&quot;<br>  }<br>}</pre><p>And there you have it, you should now get a node, which boots from our template, gets configuration from our API which it’s own customised properties and boots straight into Talos OS — installs Kubernetes and away we go.. well, not quite. We have to then start to provision the node with our workloads.</p><h4>What’s missing?</h4><p>So this article assume you already have a <strong>template</strong>, ready and deployed. It also assumes you have a way of deploying workloads to the Talos nodes. <strong>All this to come in our next article</strong> — but for now, feel free to take inspiration from above.</p><p>Unfortunately, i cannot make our entire API publicly available yet, perhaps one day i will if there is interest. However, i’ve said this before in my previous post — if you are going down this road please consider Sidero Omni as a turnkey solution. It does all the above, and a lot more, a lot better.</p><h3>Lessons learnt</h3><p>Developing the API was challenging, with a few edge cases (no pun intended) that add complexity to the process. Key considerations include implementing robust authentication, securely storing and transferring encrypted data, and planning for Day 2 operations. These factors <em>significantly</em> influence the design and maintenance of the system.</p><p>The team behind Talos moves quickly, continuously improving their product, which is impressive but also means I need to ensure my API evolves in tandem to meet their standards. This ongoing maintenance, while necessary, can <strong>gradually become a form of technical debt</strong>. So, consider this a friendly warning — <strong>keeping up with a rapidly evolving ecosystem requires careful planning and effort!</strong></p><p>Deployment is a thing — a big “thing”. Line speeds in the stores vary, and there are bottle necks. This warrants it’s own article in the future on how we distribute our Talos VM’s out to the wild; safely.</p><p>I regret i have not built in any decent versioning of configuration files, this is still WIP, but should be fairly simple. <strong>Build in versioning from the start!</strong></p><p>The plus side of this is we have exactly what we need — and nothing more. We can easily extend and integrate into other services.</p><p>Think carefully if the above solution outweighs the downsides before going on this route. For now though, thanks for reading and stay tuned.</p><p>[1] The full specification of SMBIOS, if interested can be found at <a href="https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_2.7.1.pdf">DMTF</a> — it’s wild.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acdce36f60c0" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/3000-clusters-part-3-how-to-boot-talos-linux-nodes-with-cloud-init-and-nocloud-acdce36f60c0">3000+ Clusters Part 3: How to boot Talos Linux nodes with cloud-init and NoCloud</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3000+ Clusters Part 2: The journey in edge compute with Talos Linux]]></title>
            <link>https://jysk.tech/3000-clusters-part-2-the-journey-in-edge-compute-with-talos-linux-82f42bf9f958?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/82f42bf9f958</guid>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[talos-linux]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[nocloud]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 13:18:07 GMT</pubDate>
            <atom:updated>2025-01-29T13:18:07.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*YPIbVrJTGhv0hwXe5HNUYg.png" /></figure><p>Awhile back, I wrote an <a href="https://jysk.tech/unleashing-the-power-of-k3s-for-edge-computing-deploying-3000-in-store-kubernetes-clusters-part-77ecc5378d31">article</a> about deploying <a href="https://k3s.io/">Rancher’s K3s</a> nodes to our store systems. During the Proof of Concept phase, I stopped to think about what Day 2 operations actually looked like. After the realization and being hit by a train of updates, patches, and rollouts, I started searching for workarounds and eventually alternatives.</p><h4>Edge Compute</h4><p>Lets clarify one thing, <strong>Edge computing</strong> refers to the practice of processing data closer to the source of data generation (the “edge” of the network) rather than relying solely on centralized data centers or cloud infrastructure. For us, this is in-store, in warehouse etc.</p><h3>The Problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*lZm6H4C8Pb5B3a_T.gif" /></figure><p>So, lets back track a second. We have a fully functional deployment, which can be scale and deployed to thousands of hosts, so now we need to maintain this? Shouldn’t we have discovered this early on? Yes, let me explain:</p><h4>Understanding Day 0, Day 1, and Day 2 Operations</h4><p>In the world of lifecycle management, the concept of <strong>Day 0, Day 1, and Day 2</strong> are critical to understanding how to efficiently manage and maintain systems. These concepts are not just buzzwords but essential phases that ensure the success and sustainability of any deployment, and something I try to refer to in any system I design.</p><ul><li><strong>Day 0</strong>: This phase is all about planning, concept development, and architectural design. It involves thorough research, blueprint creation, and setting the <em>foundational</em> goals for the project. For our edge computing project, <strong>Day 0 meant understanding the requirements of our store systems, infrastructure designs and roadmaps to be able to decide on the architecture, thus selecting the appropriate technologies.</strong></li><li><strong>Day 1</strong>: is the phase where development and deployment take place. It includes setting up the infrastructure, configuring the systems, and deploying the software. This phase is where we bring our plans to life. In our case, it involved deploying Rancher’s K3s clusters, configuring the necessary networking and storage solutions, and ensuring nodes were operational. This is essentially where <strong><em>that train</em></strong> came..</li><li><strong>Day 2</strong>: Once the system is live, Day 2 operations begin. This phase includes maintaining, monitoring, and optimizing the system. It is during this phase that we encounter the real-world challenges of keeping the system running smoothly. <strong>For our edge computing setup, Day 2 must involve constant updates, patches, and managing rollouts without disrupting store operations.</strong></li></ul><p>I know what you are thinking — So already in Day 0, the feasibility of this system did occur, why didn’t we spot this? Well, we did — but my thoughts were:</p><blockquote>“well, we already patch hundreds/thousands of nodes anyway, in an automated fashion — what’s 3000 more? this should be fine…”. — Ryan two years ago</blockquote><p>To accomplish updates of this fashion, we would have to schedule systems to pick a time-slot, where by updates can occur. Our store systems run in a semi air-gapped environment. We use enterprise proxies, caches and all sorts of network magic to make sure our systems can operate in the case of outages, the last thing we want is a thundering heard issue for Ubuntu updates, software updates or simply containers being pulled from our central repository.</p><p>While there’s technically nothing wrong with this, and good automation is certainly possible, I started wondering if there might be a simpler solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYMaae0sCd4cJQiwtZLq6A.jpeg" /></figure><h4>The Challenge with Day 2 Operations</h4><p>Now; I will be 100% transparent, and totally honest here. We didn’t actually reach Day 2 operations of our K3s deployment, the complexity and frequency of updates and patches became apparent very early in our PoC phase. It wasn’t much so that each update required meticulous planning and execution, rather the amount of updates that should be looked after was daunting.</p><p>Monitoring the health and performance of thousands of clusters was a monumental task. We needed a solution that could simplify these operations, provide better automation, and reduce the overhead on our engineering teams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*08SEB2sPRqVLt4FSsAUw9A.png" /></figure><p>After extensive research and experimentation, we discovered Talos, a modern Kubernetes operating system designed specifically for streamlined Day 2 operations. Talos offers a minimal, immutable, and secure OS that significantly reduces the complexity of managing Kubernetes clusters at the edge. The most attractive of this offering is immutability. 🤩</p><p>It’s a bold assumption to declare that our current design will remain unchanged forever. The reality is that as technology evolves, we must adapt. Our deployments should be straightforward enough to allow for future adjustments and replacements. Selecting the right technologies that work well together can be daunting, but the CNCF landscape simplifies this task.</p><p>Personally, I’m quite indecisive. My approach changes constantly; I enjoy exploring new options and get impatient when things don’t go my way. The concept of immutability, however, calms my nerves!</p><h4>A Purpose-Built OS for Kubernetes</h4><p>There are many great posts about <strong>Talos Linux</strong> and i won’t go through the entire feature set of Talos here, the community is growing, the team has an amazing laid back approach and truly embraces the CNCF ethos. So much so they’ve pretty much open sourced everything, and offer services for homelab users or development environments. So what makes Talos Linux one of the (i think) best offerings out there today? Why did we adopt?</p><p>Talos Linux is a cutting-edge operating system specifically designed to support Kubernetes environments. Its architecture is secure, immutable, and minimal, ensuring robust performance and streamlined operations. 🥳</p><p>Some of the key points i will point out for further reading are:</p><p><a href="https://www.siderolabs.com/blog/there-are-only-12-binaries-in-talos-linux/"><strong>There are only 12 binaries in Talos Linux</strong></a></p><blockquote>There are <strong>12 unique binaries</strong> in /bin and /sbin in Talos 1.7.0. This greatly reduces the size of installation, the maintenance needed for the operating system, and the possible security vulnerabilities of the system.</blockquote><p>Ubuntu ships with <strong>2700+</strong> binaries, Amazon Linux with<strong> 1300+ </strong>and Flatcar with <strong>2300+</strong> binaries. The advantages become clear, smaller footprints, smaller attack vector.</p><p><a href="https://www.siderolabs.com/blog/bottlerocket-vs-talos/"><strong>Bottlerocket vs Talos Linux</strong></a></p><blockquote>The difference is, Talos is built only to run in Kubernetes. Other minimal distributions, like Bottlerocket, add complexity by supporting multiple workloads and orchestrators.</blockquote><p><a href="https://www.siderolabs.com/blog/when-its-good-to-shoot-your-cattle/"><strong>When it’s good to shoot your cattle</strong></a></p><blockquote>Eliminating unnecessary troubleshooting and diagnosis can be a significant time saver and boost to efficiency. Make sure you take advantage of this boost that the cloud native mindset enables!</blockquote><p>These are just some of the articles on the Talos blog i found interesting. The list goes on, but how effective is this?</p><p>Now we know a little bit about Talos, lets look at what problems we are trying to solve, and issues with doing so! As i write this, we currently have around <strong>3,275 active </strong>clusters nodes, infact we just rolled out the first upgrade to 1.9.1 this morning, “hands-free”. Our first rollout was successful, and some problems we came across sparked interest in the Talos team. After one-on-one session with their development guys, and community advocate it’s clear that their roadmap is truly community driven.</p><p>Before we dive into the <strong>Day 2 </strong>setup, lets take a quick look into how we are running Kubernetes, at scale on the edge.</p><h3>Deploying Talos at scale</h3><p>Talos can be ran in many ways, the simplest quickest method is to boot up an image on your favourite hypervisor, cloud instance, local containerization platform and utilize <strong>talosctl</strong>. I’m a sucker for quick starts, but this is no match for a productive setup, but how we can keep a productive setup as easy as a quickstart¹? With all the considerations in place to system design, topology and infrastructure, we suddenly find ourselves in a complex maze of workarounds. Talos Linux can support many variations of deployment, PXE booting, netboot with baremetal, cloud, singleboard, local — you name it. We have chose the nocloud method.</p><h3>NoCloud with Talos</h3><p>NoCloud is a cloud-init data source that allows you to provision Talos Linux without requiring a full-blown cloud provider or complex network boot setup. Instead, it uses local configuration files or user data to bootstrap the system, making it ideal for large-scale, hands off deployments.</p><p>With NoCloud, you can achieve the same level of automation and immutability as netboot, but with fewer dependencies. It’s particularly well-suited for environments like local hypervisors, single-board computers, or even bare-metal machines where network booting might be overkill.</p><p>We deploy our purposely built images to all our in-store systems, we set the <a href="https://www.talos.dev/v1.9/talos-guides/install/cloud-platforms/nocloud/#smbios-serial-number">SMBIOS</a> serial to our API (we’ll get to this), and once the image starts to boot, it will contact our provisioning API, and begin to setup our nodes.</p><p>It sounds simple, doesn’t it? Well, the reality is a bit more complex. To address these complexities, Talos offers an enterprise solution called <strong>Omni</strong>, which essentially removes the hassle of managing the “API part” of the process. Without Omni, you’d need to set up an API to handle the provisioning of user-data, meta-data, and network manifests—these are critical for defining how Talos nodes should be configured and operate. Omni streamlines this entire workflow, making it far more accessible for teams looking to deploy Talos at scale.</p><p>Read more about <a href="https://www.siderolabs.com/platform/saas-for-kubernetes/">Omni</a> and try it out for yourself, if you have a homelab — it’s a great addition ;)</p><h4>Image Creation</h4><p>For creating Talos images, we rely on <strong>Packer</strong>, a powerful tool that automates the process of building machine images. Here’s how it works: Packer pulls down the necessary Talos image using the <strong>Talos Image Factory API</strong>, writes it to disk, and then templates it for distribution. This streamlined approach ensures that our images are consistent, up-to-date, and ready for deployment across our infrastructure.</p><p>The Image Factory API is particularly handy because it allows us to customize the Talos image with pre-configured settings, kernel parameters, or other modifications tailored to our environment. Once the image is prepared, Packer handles the heavy lifting of packaging it into a format suitable for our deployment pipelines.</p><p>This process is a critical part of our workflow, and it’s something I’ll dive deeper into in a future article, where I’ll walk through the specifics of setting up Packer, integrating it with the Talos Image Factory API, and optimizing the image creation process for scalability.<strong> Stay tuned!</strong></p><h3>Provisioning Talos at scale</h3><p>The journey of provisioning our 3.5k Talos nodes was both fun and challenging, with a few hurdles along the way.</p><h4>Network Quirks</h4><p>Our store systems operate on a variety of networks, including 4G connections, dedicated MPLS lines, and more. This diversity introduces certain network limitations. For instance, due to network design, traffic often routes through a central point, which can create bottlenecks. Imagine pulling 12 container images per store across 1,000 stores — that’s 12,000 image pulls! Fortunately, newer versions of Talos support <strong>OCI image caching</strong> (which I haven’t set up yet). This was one of the pain points I raised with the Talos team, and they addressed it seriously. Thanks, guys!</p><p>Another quirk we encountered was MTU issues. You’ve probably heard the saying, “If it’s not DNS, it’s MTU”.. We had to ensure our Talos nodes were provisioned with an MTU of 1300 to avoid connectivity problems. It’s easy to waste hours troubleshooting why certain deployments seem “broken”.</p><h4>Proxy</h4><p>Yes, it’s 2025, and proxies are still a thing — for now, we just have to deal with them. We currently host a central container registry with a pull-through cache using <strong>Harbor</strong>, which does an excellent job. Harbor allows us to utilize features like image scanning, quotas, and more. However, configuring our entire setup to pull through the proxy was somewhat of a nightmare. Thankfully, <strong>containerd</strong> comes to the rescue, and its configuration can be seamlessly applied through Talos. We utilise registry mirroring, here’s an example of our registry mirror configuration in Talos:</p><pre>registries:<br>  mirrors:<br>    &quot;docker.io&quot;:<br>      endpoints:<br>        - &quot;https://cr.domain.com/v2/dockerio&quot;<br>      overridePath: true<br>    &quot;gcr.io&quot;:<br>      endpoints:<br>        - &quot;https://cr.domain.com/v2/gcr&quot;<br>      overridePath: true<br>    &quot;ghcr.io&quot;:<br>      endpoints:<br>        - &quot;https://cr.domain.com/v2/ghcr&quot;<br>      overridePath: true<br>    &quot;registry.k8s.io&quot;:<br>      endpoints:<br>        - &quot;https://cr.domain.com/v2/k8sio&quot;<br>      overridePath: true<br>    &quot;quay.io&quot;:<br>      endpoints:<br>        - &quot;https://cr.domain.com/v2/quay-proxy&quot;<br>      overridePath: true</pre><p>This configuration translates to the following config.toml for containerd:</p><pre>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry]<br>  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors]<br>    [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;docker.io&quot;]<br>      endpoint = [&quot;https://cr.domain.com/v2/dockerio&quot;]<br>    [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;gcr.io&quot;]<br>      endpoint = [&quot;https://cr.domain.com/v2/gcr&quot;]<br>    [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;ghcr.io&quot;]<br>      endpoint = [&quot;https://cr.domain.com/v2/ghcr&quot;]<br>    [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;registry.k8s.io&quot;]<br>      endpoint = [&quot;https://cr.domain.com/v2/k8sio&quot;]<br>    [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;quay.io&quot;]<br>      endpoint = [&quot;https://cr.domain.com/v2/quay-proxy&quot;]</pre><p>For more details, check out the <a href="https://github.com/containerd/containerd/blob/main/docs/cri/registry.md">containerd registry documentation</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGdtSQ-4g3AW6mlEfi6iXw.png" /><figcaption>All images from ghcr.io are being pulled through our Container Registry without any modification on the deployment.</figcaption></figure><p>The result? We can deploy images from any of these registries without hacking the deployment files.</p><h3>API Design Considerations</h3><p>For this setup to function seamlessly, all <strong>NoCloud images</strong> shall communicate with a central API capable of storing <strong>KubeConfig </strong>files — or at least the data required to generate them. Our API also needs to manage certificates and associated metadata. Since we use <strong>OIDC</strong> for user authentication across our clusters, this configuration must also be handled by the API.</p><p>Additionally, the system must support <strong>certificate rotation</strong> and provide visibility into the health and performance of our clusters in the field. To achieve this, a <strong>UI or CLI</strong> would be incredibly beneficial, offering a user-friendly way to monitor and manage clusters.</p><p>Network settings, as mentioned earlier, are another critical component. This includes configuring <strong>MTU</strong>, <strong>proxy settings</strong>, <strong>DNS</strong>, and more. We also need to inject our own <strong>Certificate Authority (CA)</strong> to handle TLS interception by our proxy. Dynamically provisioning the <strong>hostname, </strong>and node labels that provide meta data for store location on each node is another requirement.</p><p>Furthermore, the API must handle <strong>network interface configuration</strong> and manage any additional disks attached to the system.</p><p>With all these considerations in mind, one might start to question whether a custom solution is worth the effort — especially when tools like <strong>Omni</strong> or <strong>Cluster API</strong> (Sidero) already offer robust, out-of-the-box functionality.</p><p>The end result? A powerful API paired with a CLI that can:</p><ul><li>Dynamically provision and manage <strong>3,500 clusters</strong>.</li><li>Seamlessly connect to any cluster using <strong>talosctl</strong> and <strong>kubectl</strong>.</li><li>Rotate certificates and perform upgrades using native workflows.</li><li>Provide a <strong>UI</strong> embedded within our internal platform for centralized management.</li></ul><p>This combination ensures scalability, flexibility, and ease of use, making it a comprehensive solution for our large-scale deployment needs.</p><p>The following screenshot is a sneak peek at our internal store platform, with an overview of Talos nodes and their status. Notice the version discrepancy 1.9.1 vs 1.7.1 ? We are in the middle of an upgrade :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOASERleEIGqvpGYz8C2mw.png" /><figcaption>Store Platform</figcaption></figure><p>That’s all for for now.. In the next installment, I’ll take a deep dive into the inner workings of our <strong>Talos Provisioner API</strong> — the backbone of our large-scale cluster management system. I’ll walk you through its architecture, the challenges we faced during development, and how we overcame them. From handling dynamic provisioning and certificate management to integrating with OIDC and ensuring seamless upgrades, there’s a lot to unpack. I’ll also share some lessons learned and best practices for anyone looking to build or scale a similar solution.</p><p>Stay tuned for a behind-the-scenes look at how we turned a complex problem into a streamlined, scalable system that powers thousands of clusters with ease.</p><p>Until then, feel free to reach out with questions or share your own experiences in the comments — I’d love to hear how others are tackling these challenges!</p><p>Oh — and i’ll just leave this one here, you may need it! <a href="https://www.siderolabs.com/platform/saas-for-kubernetes/">https://www.siderolabs.com/platform/saas-for-kubernetes/</a></p><p>¹ An afterthought to this, talosctl actually does a very good job and deployment an “enteprise ready” cluster. However, to deploy this at large scale, another tool solution is needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82f42bf9f958" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/3000-clusters-part-2-the-journey-in-edge-compute-with-talos-linux-82f42bf9f958">3000+ Clusters Part 2: The journey in edge compute with Talos Linux</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KubeCon + CloudNativeCon Europe 2024]]></title>
            <link>https://jysk.tech/kubecon-cloudnativecon-europe-2024-694f4b95e99e?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/694f4b95e99e</guid>
            <category><![CDATA[kubecon]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloudnativecon]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Mon, 25 Mar 2024 09:16:40 GMT</pubDate>
            <atom:updated>2024-03-26T15:39:46.623Z</atom:updated>
            <content:encoded><![CDATA[<p>Article co-authored by: <a href="https://medium.com/u/5300b5548a4">Majid Att</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIhpY9bK-ITgsmBXYdkBIg.jpeg" /></figure><p>This year, we (JYSK tech) took to Paris to attend KubeCon + CloudNativeCon Europe 2024. After three days of talks, networking and workshops. We put together a small list of observations that carry us forward into the Cloud Native realm. JYSK is a <a href="https://www.cncf.io/enduser/">CNCF End User</a> member, which means we are able to observe the community and contribute to shaping the cloud native technologies that are at the core of our operational infrastructure. Our team was particularly impressed with the evolution of the Kubernetes ecosystem, reflecting a maturation that goes beyond mere container orchestration.</p><blockquote>There are 184 products, and <strong>Kubernetes</strong> is only a small part of CNCF. The CNCF has trained over 300k people in Kubernetes certification, and investment targeting “day 2” training, i.e. no longer in Kubernetes but in the tools associated with elements like open telemetry, security etc. is being looked at.</blockquote><blockquote>The spotlight is now on the community members who are involved in training. Community contributed content is key, and should be endorsed.</blockquote><blockquote><a href="https://www.youtube.com/watch?v=c-Ys4qR41e4&amp;list=PLenh213llmcZ0LfAsKPCeKOUKoHoAkuc8&amp;index=30">- theCUBE with <strong>Christophe Sauthier and Chris Aniszczyk</strong></a></blockquote><p>JYSK’s engagement with the community doesn’t stop at using the technologies but extends to active participation in the dialogue that drives innovation. This collaborative spirit is what truly defines the ethos of the CNCF, ensuring that the needs and perspectives of end users like us can help steer the future direction of cloud native projects. Looking ahead, we’re excited to implement some of the cutting-edge practices we’ve learned and to contribute our own experiences back into the CNCF community.</p><h3><strong>Topics we found interesting:</strong></h3><p>In-tree cloud providers are gone!</p><p>AI of course is gaining traction, but challenges are being seen from an operational standpoint.</p><p>Less attention toward the “DevOps” and Platform engineering mindset. It’s obvious now that the industry has adapted.</p><p>Multi-cluster, hybrid topologies.</p><p>Blowing things up is good — doing it properly is even better with Chaos Engineering (thanks to Lego)</p><p>Impressive community and focus on inclusivity.</p><h3>Kubernetes Is FINALLY Removing in-Tree Cloud Providers</h3><p>After years of development and collaboration from many contributors, the Kubernetes project is finally removing in-tree cloud providers. This is a major milestone for Kubernetes, as all components are now fully independent of cloud providers.</p><p>If you operate Kubernetes on AWS, Azure, GCE, OpenStack, or vSphere you may be affected. <strong>As of Kubernetes version 1.30, only users on GCE would be affected</strong></p><ul><li>Talk: <a href="https://www.youtube.com/watch?v=IIxQHQHOXs4">Kubernetes Is FINALLY Removing in-Tree Cloud Providers — Bridget Kromhout &amp; Chris Privitere</a></li><li>Link: <a href="https://github.com/kubernetes/enhancements/blob/master/keps/sig-cloud-provider/2395-removing-in-tree-cloud-providers/README.md#summary">KEP-2395: Removing In-Tree Cloud Provider Code</a></li></ul><h3><strong>The elephant in the room — Artificial Intelligence at scale</strong></h3><p>Unless you have been living under a rock the past year, it’s not surprising that the efforts of ChatGPT and other areas have boosted AI. KubeCon hosted an impressive mix of AI talks; was it too much? From my point of view, no — it simply shows just how much AI is paving new ways of thinking about IT. This year, for me at least was interesting to see a lot of focus on operational state. How AI can be scaled sensibly for workloads which require it. GPUs have become indispensable for handling intensive computations. However, integrating GPU acceleration within Kubernetes environments presents hurdles like resource management and complex configurations.</p><p>Companies and communities are paving the way to enable features like resource-sharing, advanced scheduling and accelerator configurations. By overcoming these challenges, Kubernetes is set to become a leading platform for AI/ML workloads, <strong>akin to Linux’s role in modern datacenters.</strong></p><ul><li>Keynote: <a href="https://www.youtube.com/watch?v=gn5SZWyaZ34"><strong>Accelerating AI Workloads with GPUs in Kubernetes — Kevin Klues &amp; Sanjay Chatterjee</strong></a></li><li>Talk<strong>: </strong><a href="https://www.youtube.com/watch?v=Q5a1v_ShPew&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=55"><strong>Distributed AI: Using NATS.Io to Seamlessly Connect AI Applications from Cloud to Edge</strong></a></li><li>Talk: <a href="https://www.youtube.com/watch?v=u8pCyZFDX_g&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=90"><strong>Gen AI at the Edge: How Cloud Native Technologies Enable the Next Wave of Intelligent Applications</strong></a></li></ul><h3><strong>From DevOps to Platform Engineering: A Crucial Transition?</strong></h3><p>In recent times, the buzz around the transformation from DevOps to Platform Engineering has been undeniable. Amidst a sea (read.. chaos) of discussions and hundreds of articles debating the evolution of this <em>discipline</em>, one thing stands <em>resoundingly</em> clear: Platform Engineering is far from being a fleeting trend or an obscure topic. It has emerged as the new standard for scaling, managing, and facilitating innovation in today’s ever growing and complex IT landscape. As we delve into realms like FinOps, sustainable computing, and just-in-time deployments, the importance of rethinking our approach to system management becomes super important.</p><blockquote>Now, more than ever,<strong> it is crucial to embrace Platform Engineering as a means to harness the full potential of modern technologies and methodologies.</strong></blockquote><p>During the conference, I was particularly drawn to the sessions hosted by CERN, focusing on their utilization of Keycloak for Single Sign-On (SSO) across their platforms. Their reasoning for selecting Keycloak was clear, but the standout aspect was their implementation approach. They successfully crafted a solution that not only serves the entire organization but has also become integral to their research endeavors. This mirrors a broader trend observed among leading entities like Bloomberg and various teams in the Norwegian public sector. These groups are exemplifying the essence of Platform Engineering by conducting meaningful research to pinpoint precisely what their “customers” require. Such an approach is crucial for establishing relevance and gaining traction in today’s competitive landscape</p><p>It’s becoming evidently clear that Platform Engineering is evolving into a distinct discipline, one that shouldn’t be adopted without careful consideration.</p><blockquote><strong>This wave of change is powerful, but navigating it requires a clear vision and a well-thought-out strategy, rather than blindly following the trend.</strong></blockquote><ul><li>Talk: <a href="https://www.youtube.com/watch?v=3WFZhETlS9s&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=18">State of Platform Maturity in the Norwegian Public Sector — Hans Kristian Flaatten</a></li><li>Keynote: <a href="https://www.youtube.com/watch?v=rHJxdheLNwY&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=7">Platform Building Blocks: How to Build ML Infrastructure with CNCF Projects</a></li><li>Talk: <a href="https://www.youtube.com/watch?v=rqDrrTKzNd8&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=183">The Hard Life of Securing a Particle Accelerator — Antonio Nappi &amp; Sebastian Lopienski, CERN</a></li></ul><h3><strong>Embracing Multi-Cluster, Hybrid Environments</strong></h3><p>Gone are the days when we have a couple of beloved clusters that we would manage with utmost care, treating them almost like pets. Today’s reality is vastly different. We operate a diverse array of clusters across various environments — be it on multiple hyperscalers, private cloud setups in both large and small data centers, or at compact edge locations. Thus the answer to the question <em>“Where do your Kubernetes nodes run?”</em> in today’s tech is becoming a straightforward <em>“Well, we’re hybrid”</em> — they run wherever is cheap, and/or closest to the customer.</p><p>This shift signifies that clusters no longer require the pampered, individualized attention they once did. The focus is now on navigating through the complex, sometimes bewildering landscape of multi-cluster environments. However, Initiatives are underway to bring some order to this chaos, with efforts like the ClusterInventoryAPI (though I’ve heard the name might be up for debate) aiming to establish common standards.</p><p>Technologies such as <strong>ClusterAPI</strong> are becoming staples for scaling and managing operations seamlessly. And then there’s the marvel of launching production-ready, mini clusters like <strong>Talos</strong> from SideroLabs. It’s a testament to the resilience of Kubernetes and its minimal requirements for rapid deployment. Remember the times we’d spend hours setting up a cluster, then celebrate each upgrade? While nostalgically fun, those days are behind us.</p><blockquote>Now, if an upgrade stumbles, the approach is ruthlessly efficient: terminate the cluster and start anew.</blockquote><p>This evolution begs the question: <strong>Is the very notion of “upgrading” becoming obsolete? Shouldn’t we just rollout an additional multi-cluster setup and shift our workloads?</strong> The answer to that question truly depends on the type of setup one has, either way in this day and age, it’s certainly a viable option.</p><ul><li>Talk: <a href="https://www.youtube.com/watch?v=ntSGFk0290w&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=21"><strong>Bloomberg’s Journey to a Multi-Cluster Workflow Orchestration Platform — Yao Lin &amp; Reinhard Tartler</strong></a></li><li>Talk: <a href="https://www.youtube.com/watch?v=qbB3TEiOb24&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=94"><strong>Simplifying Multi-Cluster and Multi-Cloud Deployments with Cilium - Liz Rice, Isovalent</strong></a></li><li>Talk: <a href="https://www.youtube.com/watch?v=Xt1cuHKjKg8&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=108"><strong>Introducing ClusterInventory and ClusterFeature API — Eduardo Arango Gutierrez &amp; Ryan Zhang</strong></a></li></ul><h3><strong>Chaos Engineering</strong></h3><p>This has been a love/hate relationship of mine for some time. The idea of wanting to do this is great, but actually doing it — can be daunting. I’m an ops guy, I love being able to keep my “customers” happy and have no interruptions.</p><blockquote>The guys at Lego gave a very motivating talk on this, and I was happy to hear that <strong>given the correct methods, and with good planning. This can be a continual process. Starting off small, and reaping benefits very quickly.</strong> I’ve heard it more and more throughout the conference, and in small talk. This if not a hot topic, is definitely something I feel the need to investigate.</blockquote><ul><li>Talk: <a href="https://www.youtube.com/watch?v=SmeekXGYuFU&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=109"><strong>Keeping the Bricks Flowing: The LEGO Group’s Approach to Platform Engineering for Manufacturing</strong></a></li></ul><h3><strong>Community and Inclusivity</strong></h3><p>From child friendly sessions, to hard-of-hearing breakouts. I was very impressed to see just how much work and effort has been put into making this happen. These concepts felt very much at home — an integral part of the conference. I even tried to take part in learning sign language!</p><p>There are concepts which help newcomers to submit code, no-code and learn the ropes of how to engage. I myself made my first commit to a Kubernetes SIG project a few months before KubeCon and was impressed in just how helpful the maintainers were in guiding through tricky parts of making sure the code was aligned with the project and documented correctly. I’m not a “hard hitter” when it comes to development, I use it to automate, tooling etc. — but it felt empowering. Although I like development, I’ll stick to my day job, ops is the future! You heard it from me first. ;)</p><p>At KubeCon this year, everywhere I turned, faces were lit up with smiles. Breaking away from my colleagues allowed us to explore more tracks independently, with plans to regroup later. The opportunity to engage and network with new, like-minded individuals was exhilarating. Yet, what stood out to me this time around was the remarkable presence of the Nordic community. It felt like a reunion; I recognized many familiar faces, and the warm greetings exchanged were a testament to the growth within then Cloud Native Nordic community.</p><blockquote><strong>This experience was a heartfelt reminder of how connected and vibrant our community has become!</strong></blockquote><p>Finally, many people who I did speak to, when sitting waiting for a talk, or standing in line at the coffee tables were first time attendees. Many of them not knowing much about Kubernetes or the Cloud Native landscape but were more than interested in hearing about how other companies experiences, and even I learnt something from talking to these groups of people. We can learn something from every corner.</p><ul><li>Keynote: <a href="https://www.youtube.com/watch?v=vwZANXuYdRI"><strong>Keynote Panel Discussion: Unity in Diversity</strong></a></li></ul><h3><strong>Other relevant talks we found interesting:</strong></h3><h4><strong>From CNI Zero to CNI Hero: The Hands on tutorial</strong></h4><p>The “K8s CNI from Zero to Hero” talk by Doug and Tomo was a journey into the world of Container Network Interfaces (CNI). Starting from scratch, we gained a comprehensive insight into the world of CNIs.</p><p>After the talk, we were left with a deeper understanding of the CNI’s inner workings but also with the understanding to solve issues and introduce new functionalities to our clusters. For those who intrested in the talk, the accompanying Git repository and demo video offer an opportunity to catch up and delve deeper into the world of Kubernetes CNI.</p><ul><li>Video &amp; GIT : <a href="https://github.com/dougbtv/cni-hero-hands-on">https://github.com/dougbtv/cni-hero-hands-on</a></li><li><strong>Talk</strong>: <a href="https://www.youtube.com/watch?v=YumoKGhuZ2o">Tutorial: From CNI Zero to CNI Hero: A Kubernetes Networking Tutorial Using CNI</a></li></ul><h4><strong>Is Your Image Really Distroless? — Laurent Goderre, Docker</strong></h4><p>Laurent Goderre’s talk “Is Your Image Really Distroless?” delves into the intricacies of crafting minimalist Docker images using multi-stage builds and the concept of distroless containers. The talk highlights the significance of multi-stage builds in Docker, emphasizing the separation of build-time dependencies from run-time dependencies.</p><p>Many applications necessitate additional tooling, such as shells, to configure the runtime environment effectively. Goderre proposes the use of <strong>init containers</strong> to address this challenge. By separating the logic required for configuring the runtime environment from the environment itself, developers can create images devoid of shells or scripting capabilities, thus enhancing container security.</p><ul><li><strong>Talk</strong>: <a href="https://www.youtube.com/watch?v=1iJTyf4O8T8">Is Your Image Really Distroless? — Laurent Goderre, Docker</a></li><li><strong>GIT</strong> : <a href="https://github.com/LaurentGoderre/kubecon-cloudnative-eu-2024-distroless">https://github.com/LaurentGoderre/kubecon-cloudnative-eu-2024-distroless</a></li></ul><h4><strong>Why Kubernetes Is Inappropriate for Platforms, and How to Make It Better</strong></h4><p>The current trend sees the ecosystem constructing platforms on Kubernetes, starting with a “hub cluster” and integrating various tools for GitOps, application descriptions, and infrastructure management. However, as these platforms evolve, they quickly encounter the inherent constraints of Kubernetes as a framework. <br> <br> In this talk, three key dimensions were highlighted to enhance Kubernetes for platform engineering, workspace hierarchy, cross-workspace API exports and cluster mounting.</p><p>KCP, described as a Kubernetes-like control plane, is introduced as a solution catering to these dimensions. It enables the management of multiple independent, isolated “clusters” known as workspaces, allowing API service providers to offer centrally managed APIs while ensuring easy consumption for users within their respective workspaces. This approach is positioned as a building block for SaaS service providers and enterprise IT departments seeking to offer Kubernetes-native APIs to isolated tenants.</p><ul><li>Video: <a href="https://www.youtube.com/watch?v=7op_r9R0fCo">https://www.youtube.com/watch?v=7op_r9R0fCo</a></li><li>Project: <a href="https://github.com/kcp-dev/kcp">https://github.com/kcp-dev/kcp</a></li></ul><h3>Projects to look out for.</h3><h4>KCL: Constraint-based Record &amp; Functional Language</h4><p>KCL was the second project from in the top 10 CNCF Projects by Number of End User Commits indicating the most active projects in the Cloud Native Computing Foundation (CNCF) ecosystem based on user contribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c8r0BYHn3OU21OmfYJLIzg.jpeg" /></figure><p>KCL is an open-source, constraint-based record and functional language that enhances the writing of complex configurations, including those for cloud-native scenarios. With its advanced programming language technology and practices, KCL is dedicated to promoting better modularity, scalability, and stability for configurations. It enables simpler logic writing and offers ease of automation APIs and integration with homegrown systems.</p><ul><li>Project: <a href="https://github.com/kcl-lang/kcl">https://github.com/kcl-lang/kcl</a></li></ul><h4><strong>Vitess</strong></h4><p>Vitess is a database clustering system for horizontal scaling of MySQL through generalized sharding.</p><p>By encapsulating shard-routing logic, Vitess allows application code and database queries to remain agnostic to the distribution of data onto multiple shards. With Vitess, you can even split and merge shards as your needs grow, with an atomic cutover step that takes only a few seconds.</p><p>Vitess has been a core component of<strong> YouTube’s</strong> database infrastructure since 2011, and has grown to encompass tens of thousands of MySQL nodes. Vitess <a href="https://vitess.io/docs/overview/history/">was born at YouTube</a> in 2010, and joined the CNCF in <a href="https://www.cncf.io/blog/2018/02/05/cncf-host-vitess/">February 2018</a>.</p><p>Some features of Vitess include <strong>online schema changes</strong>, one of the oldest MySQL problems with blocking of schemas have been addressed with Vitess <a href="https://vitess.io/docs/archive/13.0/user-guides/schema-changes/">see docs</a> — Other noteable features include scalability, performance, connection pooling, manageability, and more!</p><ul><li><strong>Project</strong>: <a href="https://vitess.io/">vitess.io</a></li><li><strong>Talk</strong>: <a href="https://www.youtube.com/watch?v=uRB-Qni_bCM&amp;list=PLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;index=40">Vitess: Introduction, New Features and the Vinted User Story</a></li></ul><h4>ClusterInventory API</h4><p>The ClusterInventory API provides a reliable, consistent, and automated approach for any multi-cluster application (framework, toolset) to discover available clusters and take actions accordingly, in a way similar to service discovery works in a microservice architecture. Through the inventory, the application can query for a list of clusters to access, or watch for an ever-flowing stream of cluster lifecycle events which the application can act upon timely, such as auto-scaling, upgrades, failures, and connectivity issues.</p><ul><li><strong>Project</strong>: <a href="https://github.com/kubernetes-sigs/cluster-inventory-api">https://github.com/kubernetes-sigs/cluster-inventory-api</a></li></ul><h4>KCP</h4><p>kcp can be a building block for SaaS service providers who need a massively multi-tenant platform to offer services to a large number of fully isolated tenants using Kubernetes-native APIs. The goal is to be useful to cloud providers as well as enterprise IT departments offering APIs within their company.</p><ul><li><strong>Project</strong>: <a href="https://github.com/kcp-dev/kcp">https://github.com/kcp-dev/kcp</a></li></ul><h4>Mint Toolkit</h4><p>Mint Toolkit, formerly DockerSlim. <strong>Mint</strong> allows developers to inspect, optimize and debug their containers using its xray, lint, build, debug, run, images, merge, registry, vulnerability (and other) commands.<strong> It simplifies and improves your developer experience</strong> building, customizing and using containers. <strong>It makes your containers better, smaller and more secure</strong> while providing advanced visibility and improved usability working with the original and minified containers.</p><ul><li><strong>Project</strong>: <a href="https://github.com/mintoolkit/mint">https://github.com/mintoolkit/mint</a></li></ul><h4>Talos</h4><p><strong>Talos</strong> is a modern OS for running Kubernetes: secure, immutable, and minimal. Talos is fully open source, production-ready, and supported by the people at <a href="https://www.siderolabs.com/">Sidero Labs</a> All system management is done via an API — <strong>there is no shell or interactive console</strong>. Benefits include:</p><ul><li><strong>Security</strong>: Talos reduces your attack surface: It’s minimal, hardened, and immutable. All API access is secured with mutual TLS (mTLS) authentication.</li><li><strong>Predictability</strong>: Talos eliminates configuration drift, reduces unknown factors by employing immutable infrastructure ideology, and delivers atomic updates.</li><li><strong>Evolvability</strong>: Talos simplifies your architecture, increases your agility, and always delivers current stable Kubernetes and Linux versions.</li></ul><p><strong>Project</strong>: <a href="https://github.com/siderolabs/talos">https://github.com/siderolabs/talos</a></p><h3>All KubeCon + CloudNativeCon 2024 Talks</h3><p>CNCF was pretty fast at getting pretty much the entire even out on YouTube, they have provided a nice playlist with everything.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLj6h78yzYM2N8nw1YcqqKveySH6_0VnI0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhjddDoV83Co%2Fhqdefault.jpg%3Fsqp%3D-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ%3D%3D%26rs%3DAOn4CLCw7tZqleK3EVP-el6XnmcA9uqXPQ%26days_since_epoch%3D19806&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="853" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fba70208a13ee36fe03be0d7872cb3f/href">https://medium.com/media/2fba70208a13ee36fe03be0d7872cb3f/href</a></iframe><h3>Final Remarks</h3><p>The above is not by any means the entire round-up of KubeCon + CloudNativeCon 2024, only our views — there are hundreds more talks, workshops and sessions at the event. If you are interested, I urge you to attend. Keep an open mind, and plan. I’ve found it’s also refreshing to pick some talks at random, perhaps ones which do not 100% relate to your current interests and or position, ideas can come from any corner!</p><p>See you at the next KubeCon, and if you cannot hold until then — there is always <strong>Kubernetes Community Days</strong> <strong>in Denmark </strong>this year! Stay tuned or visit <a href="https://kcddenmark.dk/">https://kcddenmark.dk/</a> !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=694f4b95e99e" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/kubecon-cloudnativecon-europe-2024-694f4b95e99e">KubeCon + CloudNativeCon Europe 2024</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hoppscotch Open API Development — Postman Alternative]]></title>
            <link>https://jysk.tech/hoppscotch-open-api-development-postman-alternative-05daae5d2529?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/05daae5d2529</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 07:01:59 GMT</pubDate>
            <atom:updated>2024-03-23T12:52:50.215Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hoppscotch Open API Development — Postman Alternative</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p-RM0VPXBPIFwni8EQAUaw.jpeg" /></figure><p>· <a href="#eb7e">Hoppscotch: Is it Time to Switch from Postman?</a><br>· <a href="#b217">Quick Review</a><br> ∘ <a href="#9367">Open Source</a><br> ∘ <a href="#91a6">Features</a><br> ∘ <a href="#a896">Enterprise Support (Just incase)</a><br> ∘ <a href="#e1e9">Hoppscotch CLI</a><br>· <a href="#3994">The Setup</a><br> ∘ <a href="#7ca0">Installation (Docker)</a><br> ∘ <a href="#2abb">Installation (Kubernetes)</a><br> ∘ <a href="#1fe7">Setup</a><br>· <a href="#c225">Features to note</a><br> ∘ <a href="#325f">Testing</a><br> ∘ <a href="#5853">Live Data</a><br> ∘ <a href="#e2bc">Workspaces</a><br> ∘ <a href="#e064">Shortcuts / Spotlight</a><br>· <a href="#fbf4">Round up</a><br>· <a href="#53c1">Links</a></p><h3>Hoppscotch: Is it Time to Switch from Postman?</h3><p>If you work with APIs, you’ve probably used Postman. It’s super popular but there’s a new player in town called Hoppscotch. With the recent changes in PostMan, I personally have started to look elsewhere into other available tools.</p><p>My needs are quite basic: I do a bit of API testing for my microservices, but I don’t deal lot with load testing (else i’ll do this in other applications). Essentially, I’m looking for a tool where I can save my API requests, support OpenAPI for importing Swagger files, offer a sleek interface, and allow for easy modifications of headers. While it’s possible to manage these tasks with cURL commands and a neat file system, it’s just more convenient to have an app where I can have all my API requests easily on hand.</p><p>I’ve grown less fond of Postman lately, primarily because it leans heavily on cloud-based features, meaning everything, including sensitive API keys, ends up on the cloud. Plus, there’s no truly free version of Postman anymore, which adds another layer of complication for those of us looking for a straightforward, no-cost solution.</p><p>Enter Hoppscotch!</p><blockquote><em>Hoppscotch is a lightweight, web-based API development suite. It was built from the ground up with ease of use and accessibility in mind providing all the functionality needed for API developers with minimalist, unobtrusive UI.</em></blockquote><blockquote>Open-source and lightweight<br>Cross-platform support<br>Self-Host-able and free to use</blockquote><p>Exactly what I was looking for! Too good to be true right?</p><h3>Quick Review</h3><p>One big plus for Hoppscotch is that it’s really easy to use. Unlike Postman, which can get a bit complicated, Hoppscotch has a clean design that’s quick to load and simple to navigate.</p><p>Hoppscotch may not have all of Postman’s tricks, but it’s got the basics down. It’s great for the usual stuff like checking out REST and GraphQL APIs and even WebSockets. It’s got what you need without making things too complex.</p><h4>Open Source</h4><p>We’re big fans of open source at JYSK Tech, and Hoppscotch’s open source spirit is perhaps its standout feature. This approach offers an openness and a chance for community participation that closed-source options like Postman just can’t. For our team of DevOps engineers and developers, the freedom to inspect, tweak, and enhance the code is incredibly useful. Whenever we spot an opportunity for improvement or have a brainwave, we’re equipped and ready to jump in and contribute, because that’s the open source way.</p><h4>Features</h4><p>Hoppscotch isn’t just a Postman clone; it’s a sleek, fast, and user-friendly alternative that’s definitely worth trying. While it may not yet dethrone Postman, especially for power users who depend on advanced features, it offers a compelling choice for developers who prefer open source solutions and those who require a fast and lean tool.</p><p>If you haven’t yet given Hoppscotch a whirl, it’s time to hop (haha) over and see for yourself. It’s an exciting time in API tooling, and Hoppscotch is one to watch — or even to start using over its heavyweight counterpart.</p><p>While Hoppscotch covers the basics well, its feature set is not as comprehensive as Postman’s. Advanced features like detailed API monitoring, mock servers, and certain automation capabilities might be missing or underdeveloped.</p><h4>Enterprise Support (Just incase)</h4><p>Enterprise support should always be a key factor, especially when working within a large organization. Any tool we consider has the potential to serve a broader team and could eventually become an integral part of our developers’ and operations engineers’ toolkit. In such instances, features like SAML-based single sign-on, on-premises deployment options, and comprehensive audit logs are crucial. Hoppscotch does offer an Enterprise Cloud Edition with these features and priority support.</p><p>However, at the moment, our focus is on rapidly rolling out an open source community edition. We value full data ownership and want to maintain control over our API development and testing processes. With Hoppscotch, we have the ability to self-host on our own infrastructure, which aligns with our current needs.</p><h4>Hoppscotch CLI</h4><p>Hoppscotch offers several methods to work with and set up your APIs. You can use its command-line interface (CLI) to operate the Hoppscotch platform from a terminal or within an automated setup. This feature allows for executing API tests, handling automated API checks, among other tasks.</p><h3>The Setup</h3><p>Initially, one can try Hoppscotch by just visiting hoppscotch.io — you are presented with an online playground.</p><p>I usually spin up a local instance for testing, most of the installation/configuration can be found in their git repo: <a href="https://github.com/hoppscotch/hoppscotch">https://github.com/hoppscotch/hoppscotch</a></p><h4>Installation (Docker)</h4><p>The easiest way to get running on your local machine for a quick test-run is by using docker compose. I have included a deployment with the All-in-one image (AIO) that includes all services. The alternative would be to run each service seperatley. Currently there are three services plus a DB that is required.</p><p>docker-compose.yaml</p><pre>version: &quot;3.7&quot;<br><br>services:<br>  # The service that spins up all 3 services at once in one container<br>  hoppscotch-aio:<br>    container_name: hoppscotch-aio<br>    image: hoppscotch/hoppscotch<br>    env_file:<br>      - ./.env<br>    environment:<br>      - DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch?connect_timeout=300<br>    depends_on:<br>      hoppscotch-db:<br>        condition: service_healthy<br>    ports:<br>      - &quot;3000:3000&quot;<br>      - &quot;3100:3100&quot;<br>      - &quot;3170:3170&quot;<br><br>  # The preset DB service, you can delete/comment the below lines if<br>  # you are using an external postgres instance<br>  # This will be exposed at port 5432<br>  hoppscotch-db:<br>    image: postgres:15<br>    ports:<br>      - &quot;5432:5432&quot;<br>    user: postgres<br>    environment:<br>      # The default user defined by the docker image<br>      POSTGRES_USER: postgres<br>      # NOTE: Please UPDATE THIS PASSWORD!<br>      POSTGRES_PASSWORD: testpass<br>      POSTGRES_DB: hoppscotch<br>    healthcheck:<br>      test:<br>        [<br>          &quot;CMD-SHELL&quot;,<br>          &quot;sh -c &#39;pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}&#39;&quot;<br>        ]<br>      interval: 5s<br>      timeout: 5s<br>      retries: 10<br>    volumes:<br>      - hoppscotch-db:/var/lib/postgresql/data<br><br>volumes:<br>  hoppscotch-db:</pre><pre>git clone https://github.com/hoppscotch/hoppscotch<br>cd hoppscotch<br>mkdir jysktech<br>cp .env.example jysktech/.env</pre><p>Place the above docker-compose file into the jysktech folder, and run:</p><pre>cd jysktech<br>docker compose up -d</pre><p>One we’re up and running we need to run some migrations to initilise the DB. This is super easy:</p><pre>docker exec -it hoppscotch-aio /bin/sh<br>&gt; pnpx prisma migrate deploy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVLQGuSyuP0JDHEEj-kR-A.png" /><figcaption>DB Migrations</figcaption></figure><p>Once it’s up and running we should be presented with a web url at http://localhost:3000 now i can see fire off my API requests to see where the ISS is :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHU6dktg2XKbvszT09eyuA.png" /><figcaption>Hoppscotch UI</figcaption></figure><p>The admin dashboard is located at <a href="http://localhost:3100/">http://localhost:3100</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjPPSDb5jlY7nXvKCF0Irg.png" /><figcaption>Admin Dashboard</figcaption></figure><p>A more detailed comprehensive guide to setup (and db setup) please refer to their <a href="https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#install-and-build">documentation</a></p><h4>Installation (Kubernetes)</h4><p>Hoppscotch does not yet provide an official helmchart for us to use, yet. So i have made one you can find on our <a href="https://github.com/jysk-oss/helmcharts/tree/main/hoppscotch">JYSK OSS repo</a>.</p><h4>Setup</h4><p>Setup is straightforward — which i will leave for the documentation to explain. Some things to note:</p><ul><li>The first user on the admin dashboard is the admin</li><li>The application only works with all the invite features with a valid SMTP server</li><li>OIDC Support is in the making, there is an open PR for this <a href="https://github.com/hoppscotch/hoppscotch/pull/3266">here</a></li></ul><h3>Features to note</h3><p>There are some really solid features in Hoppscotch, that will actually get you a long way. If you are coming from a Postman background, features like environments, variables, import from openapi specification etc are all there. If you are new — these features are very handy when creating microservices and progressing through environments. Open API specification import is super, as this enables entire API specifications, help documentation and such to be imported locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SppwaIfCfT5iINzqz7Dw7w.png" /><figcaption>Imported Pet Store API</figcaption></figure><h4>Testing</h4><p>Its REST API Testing function is a no-fuss way to send requests and analyze responses, making it a breeze for anyone from beginners to seasoned pros. GraphQL API Testing is equally streamlined, with introspection that helps users quickly navigate through schemas and test out their queries.</p><h4>Live Data</h4><p>For those dealing with live data, the Realtime API Testing feature is a game-changer, supporting protocols like WebSocket, EventSource, and MQTT for testing that keeps pace with live updates. The Environments feature is a handy way to keep variables organized and consistent, which is super helpful when you’re juggling different stages of development.</p><h4>Workspaces</h4><p>Workspaces in Hoppscotch are all about teamwork, making it easy to share and manage API tests and environments with colleagues. The Interceptor is another nifty feature that lets you peek into browser traffic, offering a clear view of what’s happening with your API calls for better debugging.</p><h4>Shortcuts / Spotlight</h4><p>Keyboard fans will appreciate the Shortcuts, which make quick work of common tasks in Hoppscotch with just a keystroke. For those who like to get hands-on, the Scripts feature lets you write your own JavaScript to automate tests, making complex scenarios much less of a headache.</p><p>The Spotlight search acts like a quick-find for the app’s many corners, saving tons of time. And lastly, Inspections give you a deep dive into API responses, which is essential for making sure everything’s running as it should.</p><h4>Organising stuff</h4><p>When it comes to keeping things neat, Collections let you group your API requests, which is a big help when you’re dealing with a bunch of them. The History feature is like a breadcrumb trail of your past requests, saving you from redoing setups over and over.</p><h4>Security</h4><p>On the security front, Authorization options are robust, supporting a range of standards to ensure your secure API testing goes off without a hitch. Customization means you can tweak Hoppscotch to your liking, from the look and feel to the way requests are made.</p><h3>Round up</h3><p>Hoppscotch is pretty much a Swiss Army knife for anyone tinkering with APIs — super user-friendly, versatile, and packed with features. Whether you’re into REST, GraphQL, or keeping things lively with Realtime APIs, it’s got you covered.</p><p>Having integrated Hoppscotch into my workflow, I’ve noticed that I’m relying less on Postman. I’ve even transitioned all my Postman collections into Hoppscotch.</p><p>The next step for me is to set up a managed version for my teammates and the wider organization to benefit from, in a more stable and productive setting. This will also help us overcome common hurdles such as dealing with local CA certificates, proxies, and other such impediments that often slow down our progress.</p><h3>Links</h3><ul><li>Website: <a href="https://hoppscotch.io/">https://hoppscotch.io</a></li><li>Documentation: <a href="https://docs.hoppscotch.io/documentation/getting-started/introduction">https://docs.hoppscotch.io/documentation/getting-started/introduction</a></li><li>Github: <a href="https://github.com/hoppscotch/hoppscotch">https://github.com/hoppscotch/hoppscotch</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05daae5d2529" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/hoppscotch-open-api-development-postman-alternative-05daae5d2529">Hoppscotch Open API Development — Postman Alternative</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inspect Deployment Network Traffic in Kubernetes]]></title>
            <link>https://jysk.tech/inspect-deployment-network-traffic-in-kubernetes-8a348110df4d?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a348110df4d</guid>
            <category><![CDATA[netshoot]]></category>
            <category><![CDATA[ebpf]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[kubeshark]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 07:01:43 GMT</pubDate>
            <atom:updated>2023-09-20T06:39:02.570Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deep Dive — Inspect Deployment Network Traffic in Kubernetes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lF3puWwexQ4dQg902BsJVg.png" /></figure><p>In today’s intricate world of microservices and distributed applications, understanding and monitoring network traffic is paramount for maintaining security, performance, and seamless user experiences. Kubernetes, the de facto orchestrator for containerized applications, has transformed the way developers deploy and manage applications at scale. But with this power comes complexity, especially when it comes to understanding how network packets flow within and between pods, services, and external entities. How does one tap into this myriad web of network interactions?</p><p>In this blog post, we will delve into the essentials of network traffic within Kubernetes clusters, explore tools and techniques for packet capturing, and unearth best practices to ensure our efforts are both efficient and safe. Whether you’re a system administrator seeking to troubleshoot a pesky network anomaly, a security professional hunting for signs of malicious activity, or a developer eager to optimize communication between services, this guide promises to be a valuable ally on your journey.</p><p>There are a few tools covered in this post, whilst troubleshooting network traffic is not limited to these — I have personally found these to be very helpful in the past few years. Some are easier than others, some require more in-depth knowledge of specific tools. In my personal opinion, one should choose the right tool for the job, and it’s nice to have a toolbox with many to choose from.</p><h3>Hubble eBPF</h3><p>Project: <a href="https://github.com/cilium/hubble">https://github.com/cilium/hubble</a></p><p>Amidst the growing buzz around Cilium, Hubble emerges into the spotlight. A rising number of users are transitioning to the Cilium CNI, drawn by its exceptional flexibility and comprehensive toolset.</p><p>Cilium Hubble is a powerful observability platform tailored for the cloud-native age. Building on Cilium’s robust networking, security, and load balancing capabilities, Hubble provides real-time visibility into the network traffic of Kubernetes clusters, ensuring developers and operators can seamlessly monitor, troubleshoot, and secure their applications. In a world where microservices are never ending, Hubble stands as an indispensable lens if one is running Cilium, offering a clear view of the mesh of communications within modern environments.</p><p>Hubble taps into the rich data provided by eBPF to deliver real-time insights into network traffic, application interactions, and potential security violations within Kubernetes clusters. By leveraging eBPF’s efficient and granular packet filtering capabilities, Hubble offers unparalleled visibility into microservices communication without imposing significant overhead. It captures metadata for every network flow, enabling teams to troubleshoot issues, monitor application interactions, and ensure robust security postures in their cloud-native applications.</p><p>eBPF is a subject on it’s own, but this is touched on from a very nice presentation by Sebastian Wicki, Isovalent. Where he explores the foundations of eBPF and the usecases. along with Hubble.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8WCbGSCyDSo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8WCbGSCyDSo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8WCbGSCyDSo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c51ef179cf3784a72ddca5989d6276da/href">https://medium.com/media/c51ef179cf3784a72ddca5989d6276da/href</a></iframe><h3>Setup &amp; Installation</h3><p>First thing is to enable hubble. If you have not done already, we need to run cilium hubble enable --ui consult the documentation for more information and setup. One we have hubble enabled, we can then install the <a href="https://docs.cilium.io/en/stable/gettingstarted/hubble_setup/">hubble cli</a>.</p><p>When we are ready, a quick check:</p><pre>jysk@jysk:~$ cilium status<br>    /¯¯\<br> /¯¯\__/¯¯\    Cilium:             OK<br> \__/¯¯\__/    Operator:           OK<br> /¯¯\__/¯¯\    Envoy DaemonSet:    disabled (using embedded mode)<br> \__/¯¯\__/    Hubble Relay:       OK<br>    \__/       ClusterMesh:        disabled<br><br>DaemonSet         cilium             Desired: 1, Ready: 1/1, Available: 1/1<br>Deployment        cilium-operator    Desired: 1, Ready: 1/1, Available: 1/1<br>Deployment        hubble-relay       Desired: 1, Ready: 1/1, Available: 1/1<br>Deployment        hubble-ui          Desired: 1, Ready: 1/1, Available: 1/1<br>Containers:       cilium-operator    Running: 1<br>                  hubble-relay       Running: 1<br>                  cilium             Running: 1<br>                  hubble-ui          Running: 1<br><br>jysk@jysk:~$ hubble list node<br>NAME   STATUS      AGE      FLOWS/S   CURRENT/MAX-FLOWS<br>jysk   Connected   14m53s   76.66     4095/4095 (100.00%)</pre><p>From here, we can immediatley start to use hubble observe to inspect our deployments. For this, i will be running a troubleshooting container image called netshoot which i will actually like to demo a little later in this post. For now though, we&#39;re going to enter our container and issue a basic ping.</p><pre># Get running netshoot pod,deployment<br>jysk@jysk:~$ kubectl get pod,deployment -n jysk-system<br>NAME                                                   READY   STATUS    RESTARTS   AGE<br>pod/netshoot-b78cd67fb-w5np7                           1/1     Running   0          10h<br>NAME                                               READY   UP-TO-DATE   AVAILABLE   AGE<br>deployment.apps/netshoot                           1/1     1            1           10h<br><br># issue a basic ping<br>jysk@jysk:~$ kubectl exec pod/netshoot-b78cd67fb-w5np7 -n jysk-system -- ping 10.0.30.1<br>PING 10.0.30.1 (10.0.30.1) 56(84) bytes of data.<br>64 bytes from 10.0.30.1: icmp_seq=1 ttl=253 time=0.563 ms<br>64 bytes from 10.0.30.1: icmp_seq=2 ttl=253 time=0.497 ms</pre><p>In a second terminal we can use hubble observe, for basic packet tracing.</p><pre>jysk@jysk:~$ hubble observe --pod jysk-system/netshoot-b78cd67fb-w5np7 --protocol icmp<br>Aug 21 17:38:40.178: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:38:40.178: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:38:46.303: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:38:46.304: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:38:52.447: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:38:52.448: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:38:58.591: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:38:58.592: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:39:04.736: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:39:04.736: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:39:10.847: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:39:10.848: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:39:16.991: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:39:16.992: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:39:22.111: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:39:22.112: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)<br>Aug 21 17:39:28.223: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) -&gt; 10.0.30.1 (world) to-stack FORWARDED (ICMPv4 EchoRequest)<br>Aug 21 17:39:28.224: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;- 10.0.30.1 (world) to-endpoint FORWARDED (ICMPv4 EchoReply)</pre><p>This is great! now we can start to see what’s actually “on the wire” from our deployments.</p><p>Lets setup a small http server and try to observe some L7 comms.</p><pre># Deploy<br>jysk@jysk:~$ kubectl create deployment nginx --image registry.jysk.com/dockerhub/library/nginx -n jysk-system<br>deployment.apps/nginx create<br><br># Basic HTTP req. <br>jysk@jysk:~$ kubectl exec pod/netshoot-b78cd67fb-w5np7 -n jysk-system -- curl -sI http://nginx<br>HTTP/1.1 200 OK<br>Server: nginx/1.25.2<br>Date: Mon, 21 Aug 2023 18:04:06 GMT<br><br>jysk@jysk:~$ hubble observe --pod jysk-system/nginx-7cd6548575-k8768<br>Aug 21 18:07:33.818: jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) &lt;&gt; jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) post-xlate-fwd TRANSLATED (TCP)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) -&gt; jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: SYN)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) &lt;- jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: SYN, ACK)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) -&gt; jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: ACK)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) &lt;&gt; jysk-system/nginx-7cd6548575-k8768 (ID:8484) pre-xlate-rev TRACED (TCP)<br>Aug 21 18:07:33.819: jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) &lt;&gt; jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) pre-xlate-rev TRACED (TCP)<br>Aug 21 18:07:33.819: jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) &lt;&gt; jysk-system/netshoot-b78cd67fb-w5np7 (ID:21977) pre-xlate-rev TRACED (TCP)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) -&gt; jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: ACK, PSH)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) &lt;- jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: ACK, PSH)<br>Aug 21 18:07:33.819: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) -&gt; jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: ACK, FIN)<br>Aug 21 18:07:33.820: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) &lt;- jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: ACK, FIN)<br>Aug 21 18:07:33.820: jysk-system/netshoot-b78cd67fb-w5np7:53278 (ID:21977) -&gt; jysk-system/nginx-7cd6548575-k8768:80 (ID:8484) to-endpoint FORWARDED (TCP Flags: ACK)</pre><p>Apparently, one can issue a --protocol http filter, but that did not work for some reason - which I must investigate. The CLI is a very powerful tool, but hubble also comes with a UI. Which can be started with cilium hubble ui.</p><p>To be able to inspect at Layer 7, we need to enable this explicitly such that traffic is routed through a L7 proxy see <a href="https://docs.cilium.io/en/latest/observability/visibility/">Layer 7 Protocol Visibility</a> for more info. In our setup we will simply annotate our deployments with Egress/80/TCP/HTTP. Of course, now by doing this one can expect some security issues related to packet inspection on the L7 level. Please read through the [Security Implications](Security Implications) as there are options for redaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWMDOyhPQ7fu1r3SDZ1LwQ.png" /><figcaption>Hubble UI</figcaption></figure><p>Whilst I personally prefer the terminal experience, the hubble UI does a nice job in showing traffic, and with more complex communication paths it’s easy to get a good overview.</p><h3>Notes</h3><p>There are some caveats with Hubble, as with any inspection tool it has overhead. Hubble with no exception. The problem with Hubble is that one cannot be selective over the information it collects, it’s all or nothing. WIth the aid of eBPF this isn’t too wild, but it needs to be a consideration.</p><p>A great blog post from Isovalent <a href="https://isovalent.com/blog/post/hubble-series-re-introducing-hubble/">Re-introducing Hubble</a></p><h3>Kubeshark</h3><p>Project: <a href="https://kubeshark.co/">https://kubeshark.co/</a></p><p>Kubeshark is a tool designed to amplify the capabilities of network analysis within Kubernetes clusters. Using advanced packet capture technologies like <a href="https://ebpf.io/">eBPF</a> (Extended Berkeley Packet Filter) and <a href="https://www.ntop.org/products/packet-capture/pf_ring/">PF_RING</a> (type of network socket that dramatically improves packet capture speed), combined with custom kernel modules, Kubeshark captures cluster-wide L4 traffic (TCP &amp; UDP) and efficiently stores it in distributed PCAP (Packet Capture) storage. The tool stands out in its ability to dissect a multitude of application layer protocols, from HTTP variants and AMQP (Advanced Message Queuing Protocol) to Redis and DNS, not leaving behind the recognition of gRPC over HTTP/2 and GraphQL over both HTTP/1.1 and HTTP/2.</p><p>One of its notable features is its adept use of extended BPF (eBPF) which traces function calls in both kernel and user spaces. What makes Kubeshark particularly compelling is its capacity to sniff encrypted traffic (like TLS) within the cluster using eBPF, without the need for decryption. This is achieved by ingeniously hooking into specific functions within the OpenSSL library and Go’s crypto/tls package.</p><p>In addition (and this is very nice!) Kubeshark is service mesh-aware, being able to identify popular solutions like Istio and Linkerd, particularly those harnessing the power of Envoy Proxy.</p><p>However, Kubeshark isn’t just about observation; it’s also about action. With the amalgamation of scripting languages, hooks, helpers, and jobs, it can detect anomalous network behaviors and swiftly trigger actions through a range of integrations, from Slack notifications to data storage solutions like AWS S3 and Elasticsearch. This blend of deep analysis and proactive response solidifies Kubeshark’s position as an essential tool for DevOps and networking professionals navigating the Kubernetes landscape.</p><p>Kubeshark gives the opportunity of two deployment scenarios:</p><p><strong>On-demand traffic investigation</strong> Facilitated via a CLI tool accessible to anyone with kubectl permissions. or</p><p><strong>Long-lived deployments</strong> Made possible using a helm chart to cater to varied needs like collaborative debugging, network monitoring, telemetry, and forensics.</p><p>Notably, Kubeshark operates seamlessly without prerequisites such as CNI, service-mesh, or coding. It doesn’t demand the use of proxies, sidecars, or any architectural modifications.</p><p>Kubeshark boasts four main software components:</p><p>The <strong>CLI</strong>, Written in Go, this binary distribution facilitates on-the-fly, lightweight use of Kubeshark without leaving any permanent traces. Through direct communication with the Kubernetes API, it positions containers optimally for effective traffic analysis.</p><p><strong>Kubeshark dashboard</strong> which is constructed as a React application, this dashboard interfaces with the Hub using WebSockets, showcasing the captured traffic in a real-time feed.</p><p><strong>Kubeshark Hub</strong> which is positioned as a gateway to the Workers, the Hub hosts an HTTP server. Its primary roles involve accepting and managing WebSocket connections, receiving dissected traffic from the workers, and streaming these results back to the user.</p><p>Finally, a <strong>worker</strong>: Deployed as a DaemonSet, ensuring that each node in the cluster is under Kubeshark’s purview. The worker is the heart of the network analysis, capturing packets from all interfaces, reassembling TCP streams, and storing relevant data as PCAP files. It communicates the collected traffic to the Hub via WebSocket connections.</p><p>Additionally, Kubeshark uses a distributed PCAP-based storage system, wherein each Worker stores the captured L4 streams on the node’s root file system. Furthermore, its design emphasizes low network overhead, transmitting only essential traffic fragments upon request, ensuring efficient network operations.</p><h3>Setup &amp; Installation</h3><p>Installation of Kubeshark is very simple, although you should be aware of firing off shell scripts directly from the web — it’s super simple to get started, one could also do this in an ubuntu container for example. Installation documentation can be found <a href="https://docs.kubeshark.co/en/install">here</a></p><pre>➜  ~ sh &lt;(curl -Ls https://kubeshark.co/install)<br><br>🦈  Started to download Kubeshark<br>########################################################################################################################################################### 100.0%<br><br>⬇️  Kubeshark is downloaded into /Users/rgo/kubeshark<br>Do you want to install system-wide? Requires sudo 😇 (y/N)? N<br>✅ You can use the  ./kubeshark  command now.<br><br>Please give us a star 🌟 on https://github.com/kubeshark/kubeshark if you ❤️  Kubeshark!</pre><p>By running kubeshark tap it will by default capture all traffic, and throw us into a web UI. Instantly we start to see what the traffic flow looks like within our cluster. One can also filter using kubeshark tap &quot;nginx*&quot;</p><pre>➜  ~ kubeshark tap<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:50 &gt; Using Docker: registry=docker.io/kubeshark/ tag=latest<br>2023-09-12T19:01:07+02:00 INF versionCheck.go:23 &gt; Checking for a newer version...<br>2023-09-12T19:01:07+02:00 WRN tapRunner.go:61 &gt; Storage limit cannot be modified while persistentstorage is set to false!<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:66 &gt; Kubeshark will store the traffic up to a limit (per node). Oldest TCP/UDP streams will be removed once the limit is reached. limit=200Mi<br>2023-09-12T19:01:07+02:00 INF common.go:69 &gt; Using kubeconfig: path=store-k3s.yaml<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:83 &gt; Telemetry enabled=true notice=&quot;Telemetry can be disabled by setting the flag: --telemetry-enabled=false&quot;<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:85 &gt; Targeting pods in: namespaces=[&quot;&quot;]<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: cilium-operator-75f67d4c9-drcnt<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: svclb-cilium-ingress-a7998e18-j5zm9<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: local-path-provisioner-845998b5d6-76f7q<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: coredns-5f58d47db4-qvlqn<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: metrics-server-84c965cd47-qrpq2<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: external-secrets-6977b958d4-9xn5m<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: cilium-qwf4c<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: external-secrets-webhook-5db5d87567-cc68r<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: external-secrets-cert-controller-89c86685b-q8gk9<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: hubble-relay-5447546447-x29c8<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: hubble-ui-694cf76f4c-ssqc8<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: nginx-7cd6548575-c2zsq<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: netshoot-b78cd67fb-c42lp<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: notification-controller-5998f78db8-hwdhf<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: kustomize-controller-65b9565bd8-lwnmj<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: source-controller-55c549947b-2rbnz<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: helm-controller-578d9c7969-5zxxl<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: kubeshark-hub<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:146 &gt; Targeted pod: kubeshark-front<br>2023-09-12T19:01:07+02:00 INF tapRunner.go:95 &gt; Waiting for the creation of Kubeshark resources...<br>2023-09-12T19:01:08+02:00 INF helm.go:128 &gt; Downloading Helm chart: repo-path=Caches/helm/repository url=https://github.com/kubeshark/kubeshark.github.io/releases/download/kubeshark-50.2/kubeshark-50.2.tgz<br>2023-09-12T19:01:09+02:00 INF helm.go:147 &gt; Installing using Helm: kube-version=&quot;&gt;= 1.16.0-0&quot; release=kubeshark source=[&quot;https://github.com/kubeshark/kubeshark/tree/master/helm-chart&quot;] version=50.2<br>2023-09-12T19:01:10+02:00 INF helm.go:61 &gt; creating 11 resource(s)<br>2023-09-12T19:01:11+02:00 INF tapRunner.go:106 &gt; Installed the Helm release: kubeshark<br>2023-09-12T19:01:11+02:00 INF tapRunner.go:177 &gt; Added: pod=kubeshark-hub<br>2023-09-12T19:01:11+02:00 INF tapRunner.go:268 &gt; Added: pod=kubeshark-front<br>2023-09-12T19:01:13+02:00 INF proxy.go:31 &gt; Starting proxy... namespace=default proxy-host=127.0.0.1 service=kubeshark-hub src-port=8898<br>2023-09-12T19:01:15+02:00 INF proxy.go:31 &gt; Starting proxy... namespace=default proxy-host=127.0.0.1 service=kubeshark-front src-port=8899<br>2023-09-12T19:01:15+02:00 INF tapRunner.go:476 &gt; Kubeshark is available at: url=http://127.0.0.1:8899<br>2023-09-12T19:01:18+02:00 INF tapRunner.go:450 &gt; Hub is available at: url=http://127.0.0.1:8898</pre><p>Navigate to the service map to visualise this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moFT5B0S7vVW1nb0I8U01w.png" /><figcaption>Kubeshark UI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xD-8XDdwJi7pGqiuSzbn3w.png" /><figcaption>Kubeshark Service Map</figcaption></figure><p>If you are familiar with Wireshark syntax, we can filter out specifics. Example, to exclude all KubeDNS requests:</p><p>dst.name != &quot;kube-dns&quot; and dst.namespace != &quot;kube-system&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*RoJjoc7jwK5HzABFI8dsGA.png" /></figure><h3>Tips</h3><p>Kubeshark can sniff the encrypted traffic (TLS) in your cluster using eBPF without actually doing decryption. It hooks into entry and exit points in certain functions inside the OpenSSL library and Go’s crypto/tls package.</p><p>See their <a href="https://docs.kubeshark.co/en/encrypted_traffic">documentation</a> for more details!</p><p>In addition there is a nice overview of performance in relation to the technology used in packet capturing: <a href="https://docs.kubeshark.co/en/performance">https://docs.kubeshark.co/en/performance</a> with a comparioson over AF_PACKET,AF_XDP and PF_RING. Each technology serves different purposes!</p><blockquote><strong><em>AF_PACKET</em></strong><em> provides raw access to network packets at the link-layer level and is useful for packet capturing and analysis.</em></blockquote><blockquote><strong><em>AF_XDP</em></strong><em> allows high-performance packet processing in the kernel space using eBPF, suitable for tasks like packet filtering and forwarding.</em></blockquote><blockquote><strong><em>PF_RING</em></strong><em> is a framework that offers efficient packet capture and processing, often with kernel bypass techniques, for applications requiring high-speed network analysis.</em></blockquote><h3>Netshoot</h3><p>Project: <a href="https://github.com/nicolaka/netshoot">https://github.com/nicolaka/netshoot</a></p><p>Netshoot is personally one of my favourite “toolbox” type of setups. It literally has everthing one will ever need i troubleshooting.</p><p>Netshoot is a highly versatile Docker container tailored for network troubleshooting. Designed for DevOps engineers, network administrators, and anyone who needs to diagnose network issues within container environments, Netshoot packages a suite of powerful tools under one umbrella.</p><p>Key Features:</p><p>Netshoot comes with a range of tools like netstat, ifconfig, ping, traceroute, and many others. This makes it a one-stop-shop for most network diagnosis needs. However, Even with its vast toolkit, Netshoot is optimized to be lightweight, ensuring minimal overhead when deployed in container environments.</p><p>Being a Docker container, integrating Netshoot into any containerized infrastructure is seamless. This means engineers can swiftly deploy it, diagnose, and then dispose of it without affecting existing workloads.</p><p>Given the following usage scenario — Suppose you’re experiencing packet losses between microservices in a Kubernetes cluster. Instead of individually installing network tools on every node or service, you can deploy Netshoot and immediately access its toolkit to diagnose the issue.</p><p>For anyone working in container environments, especially DevOps engineers, Netshoot is an indispensable tool. It simplifies the often complex task of network troubleshooting, making it easier to maintain and optimize infrastructures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1j-TZ8dOHcpz_7yuRzEY-g.png" /></figure><h3>Tips</h3><p>Netshoot (community) now includes a <a href="https://github.com/nilic/kubectl-netshoot">kubectl netshoot</a></p><blockquote><em>A kubectl plugin to easily spin up and access a netshoot container. netshoot is a network troubleshooting Swiss-army knife which allows you to perform Kubernetes troubleshooting without installing any new packages in your containers or cluster nodes.</em></blockquote><h3>Conclusion</h3><p>In the realm of network observability and troubleshooting within Kubernetes environments, several tools have carved out distinct niches. Cilium’s Hubble, tapping into the power of eBPF, offers an impressive real-time observability platform, showcasing the intricacies of network traffic in cloud-native deployments. Its insights are amplified by the foundational explorations on eBPF by experts like Sebastian Wicki.</p><p>Kubeshark, on the other hand, elevates network analysis by incorporating advanced packet capture technologies. Notably, its capacity to trace encrypted traffic without decryption is groundbreaking. With service mesh-awareness and versatile deployment options, Kubeshark stands as a robust solution for DevOps and network professionals.</p><p>Yet, amidst these advanced tools, Netshoot stands out with its simplistic yet highly effective approach. As a personal favorite, Netshoot serves as a comprehensive “toolbox” for network troubleshooting in container environments. It bundles essential network tools, ensuring that DevOps engineers and network administrators have everything at their fingertips for swift diagnosis. Lightweight and seamlessly integrated into containerized systems, Netshoot is an invaluable asset for those looking to optimize and maintain their infrastructures efficiently.</p><p>Keep in mind, it’s all about selecting the <strong>right tool for the job!</strong>. With the aforementioned tools at our disposal, diagnosing issues in our deployments becomes a straightforward affair.</p><p>Until next time — happy debugging!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a348110df4d" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/inspect-deployment-network-traffic-in-kubernetes-8a348110df4d">Inspect Deployment Network Traffic in Kubernetes</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of k3s for Edge Computing: Deploying 3000+ in-store Kubernetes Clusters —…]]></title>
            <link>https://jysk.tech/unleashing-the-power-of-k3s-for-edge-computing-deploying-3000-in-store-kubernetes-clusters-part-77ecc5378d31?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/77ecc5378d31</guid>
            <category><![CDATA[flux-cd]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[k3]]></category>
            <category><![CDATA[cilium]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 06:01:43 GMT</pubDate>
            <atom:updated>2023-09-13T14:56:46.775Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unleashing the Power of k3s for Edge Computing: Deploying 3000+ in-store Kubernetes Clusters — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*_4h86ZnyM6syz2tXvDvQWw.png" /></figure><p>· <a href="#361f">The Design</a><br>· <a href="#a1fc">The Cattle Approach: Simplifying k3s Installation and Recovery</a><br>· <a href="#7ed8">The Installation</a><br>· <a href="#7f4b">1. Setup our environment</a><br>· <a href="#abd3">2. Download Cilium, FluxCD</a><br>· <a href="#deed">3. Custom Configuration</a><br>· <a href="#4995">4. K3s Installation</a><br>· <a href="#fed1">5. Cilium Installation</a><br>· <a href="#830e">6. FluxCD Installation</a><br>· <a href="#8e5b">Putting it all together</a><br>· <a href="#ea6d">Uninstalling our environment</a><br>· <a href="#5b11">What’s next?</a></p><h3>Design and Installation Proof of Concept</h3><p>The initial instalment of our three-part series delves into how JYSK employs Kubernetes across more than 3000 stores, harnessing the power of edge computing to <strong>bolster</strong> our infrastructure’s competitive advantage.</p><p>In today’s rapidly evolving tech landscape, edge computing has emerged as a game-changer, allowing data processing closer to its source — be it a device, a store sensor, or a point-of-sale system. This decentralization boosts performance, reduces latency, and paves the way for real-time insights, especially crucial for the retail industry. But how do we efficiently manage and deploy applications at such a vast scale, especially when we’re talking about 3000+ locations?</p><p>Enter k3s: a lightweight, fast, and simplified Kubernetes distribution tailored for edge and resource-constrained environments. In this blog post, we will delve into our journey of leveraging k3s to deploy Kubernetes clusters across thousands of stores, discussing the challenges, the triumphs, and the future of edge computing in retail. Join us as we explore the intricacies and advantages of this groundbreaking approach.</p><h3>The Design</h3><p>When diving into the technical intricacies of deploying Kubernetes clusters, especially on such an expansive scale, simplicity becomes paramount. k3s, with its inherent lightweight nature, was a perfect fit.</p><p>K3s eliminates the need for extraneous features and external dependencies. With just a single binary for both server and agent, the installation process is straightforward. We’re not juggling with a multitude of configurations or elaborate setups; instead, we can get a cluster up and running in minutes. This simplicity not only accelerates deployment timelines but also ensures consistency and reduces potential points of failure.</p><p>Modern application deployment, particularly at scale, demands not just efficiency but also a high degree of precision. In our quest to ensure robust application deployments across our stores, we’ve adopted the GitOps approach. GitOps, with its declarative, version-controlled, and automated methodology, guarantees that we can roll out applications seamlessly, with the exact configuration and version we desire.</p><p>However, our application ecosystem isn’t a monolith. Different applications have varying network requirements. Some need to communicate with specific networks that are tagged at the hypervisor level. These unique networking demands could complicate deployments, but this is where Cilium steps in to streamline the process.</p><p>Cilium, an advanced networking and security CNI, enables fine-grained network visibility and control without modifying application code. Using Cilium, we can assign specific network interfaces to pods based on their requirements. This ensures that our applications not only deploy successfully but also communicate effectively with the necessary resources.</p><p>Our basic requirements are:</p><ul><li>Straightforward deployment</li><li>Minimal use of resources</li><li>Utilisation of familiar frameworks</li><li>Different interfaces tailored to specific deployments</li><li>Quick recovery with minimal upkeep</li><li>Compliance with stringent network guidelines, like corporate proxies and isolated access.</li></ul><h3>The Cattle Approach: Simplifying k3s Installation and Recovery</h3><p>In the realm of infrastructure management, there’s an adage that one should treat servers as “cattle, not pets.” This philosophy underscores our approach to k3s installation. While the Kubernetes ecosystem offers a plethora of deployment tools like Ansible, Terraform, and more, it’s essential that our installation method remains straightforward and reproducible. Our focus isn’t just on the initial deployment but also on ensuring a hassle-free recovery process.</p><p>By treating each k3s cluster as ‘cattle’, we ensure that our systems are both disposable and replaceable. If an issue arises with a particular cluster, we don’t invest hours attempting to diagnose and remedy it. Instead, our process is straightforward: uninstall, re-initialize, and provision. Within minutes, the store location can have its cluster back online and functioning optimally.</p><p>This approach not only reduces downtime but also alleviates the pressure on our technical teams. No longer bogged down by the tedious process of troubleshooting individual cluster hiccups, they can focus on more strategic, value-driven tasks. The end result? An infrastructure that’s resilient, scalable, and primed for the demands of modern retail. With k3s at its core, and a cattle approach to management, we ensure consistency and reliability across all our store locations, day in and day out.</p><h3>The Installation</h3><p>The installation process is pretty simple, in the form of a bash script (yes, good old bash). We can easily startup a cluster.</p><p>The only other customisation for the environment is the installation of our custom CA’s as we ssl-intercept on our corporate proxy.</p><h3>1. Setup our environment</h3><p>This was done on a minimal ubuntu installation. Although k3s doesn’t really say we need to disable swap — it’s standard practice for a full Kubernetes installation.</p><pre>jysk@jysk:~$ sudo sed -ri &#39;/\sswap\s/s/^#?/#/&#39; /etc/fstab<br>jysk@jysk:~$ sudo swapoff -a<br>jysk@jysk:~$ free -h<br>               total        used        free      shared  buff/cache   available<br>Mem:           3.8Gi       300Mi       2.9Gi        32Mi       649Mi       3.2Gi<br>Swap:             0B          0B          0B<br>jysk@jysk:~$</pre><p>In JYSK we have a corporate proxy which protects our systems from direct access to the net. To make this work with K3s — and other deployments we need to specify this in our session. K3s automatically takes these settings and applies them to the installation.</p><pre>export HTTP_PROXY=&quot;http://&lt;proxy&gt;:8080&quot;<br>export HTTPS_PROXY=&quot;http://&lt;proxy&gt;:8080&quot;<br>export NO_PROXY=&quot;jysk.com,jysk.local,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,localhost&quot;<br>export KUBECONFIG=/etc/rancher/k3s/k3s.yaml<br>export GITHUB_TOKEN=&lt;token&gt;</pre><h3>2. Download Cilium, FluxCD</h3><p>Download Cilium, straight from the horses mouth — see their <a href="https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/">quickstart</a> for more info on this. The benefit of fetching directly is we can fetch the latest stable version. We also fetch FluxCD as we will be using this as part of our GitOps deployment process, a <a href="https://fluxcd.io/flux/get-started/">quickstart</a> guide can also be found for FluxCD</p><pre># Download Cilium<br>echo &quot;Downloading Cilium...&quot;<br>CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)<br>CLI_ARCH=amd64<br>if [ &quot;$(uname -m)&quot; = &quot;aarch64&quot; ]; then CLI_ARCH=arm64; fi<br>curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}<br>sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum<br>sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin<br>rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}</pre><pre>    # Download flux<br>    echo &quot;Downloading FluxCD..&quot;<br>    curl -s <a href="https://fluxcd.io/install.sh">https://fluxcd.io/install.sh</a> | bash -</pre><h3>3. Custom Configuration</h3><p>The custom configuration is probably JYSK specific, but we deploy out own internal registry where we also proxy out to external registries, among the obvious bandwidth savings we can also scan these public images as we pull them down.</p><p>K3s looks at /etc/rancher/k3s/registries.yaml for these settings, and after some trial and error we managed to proxy the most common registries that k3s, cilium and flux uses. Add more if you need to!</p><pre># Configure mirrors<br>echo &quot;Configuring mirrors (JYSK CR)&quot;<br>mkdir -p /etc/rancher/k3s/ &amp;&amp; \<br>cat &gt; /etc/rancher/k3s/registries.yaml &lt;&lt; EOF<br>mirrors:<br>quay.io:<br>    endpoint:<br>    - &quot;https://&lt;internal cr&gt;/v2&quot;<br>    rewrite:<br>    &quot;(.*)&quot;: &quot;quay-proxy/\$1&quot;<br>ghcr.io:<br>    endpoint:<br>    - &quot;https://&lt;internal cr&gt;/v2&quot;<br>    rewrite:<br>    &quot;(.*)&quot;: &quot;ghcr/\$1&quot;<br>docker.io:<br>    endpoint:<br>    - &quot;https://&lt;internal cr&gt;/v2&quot;<br>    rewrite:<br>    &quot;(.*)&quot;: &quot;dockerio/\$1&quot;<br>EOF</pre><p>The above configuration enables mirrors to be utilized when pulling from specific repositories. This setting is global, i.e. if we were to pull an image from ghcr.io, it will automatically use our internal CR, which in-turn proxies out — smart!</p><h3>4. K3s Installation</h3><p>After scanning through the docs, a few tweaks were needed to enable Cilium to work properly and also change the default registry to our own internal registry.</p><pre># Install K3s<br>echo &quot;Installing K3s!&quot;<br>curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC=&quot;\<br>--flannel-backend=none \<br>--disable=traefik \<br>--disable-network-policy \<br>--system-default-registry=&lt;internal cr&gt;/dockerio \<br>--kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname \<br>&quot; sh -</pre><h3>5. Cilium Installation</h3><p>Cilium installation also follows the documentations reccomended approach, with a few extra tweaks.</p><p>hubble.relay.enabled and hubble.ui.enabled is not really needed, but nice to have. If we really need to cut down on our resources, these shouldn&#39;t be deployed.</p><p>ingressController.enabled and ingressController.loadbalancerMode gives us the ability to utilise the built in Envoy ingress controller - if we need that. Again, if we are looking at a slim install, we don&#39;t need this.</p><p>To enable Cilium to route traffic to different interfaces based on which pod the request originates from, we need to implement a CiliumEgressGatewayPolicy. For this to be done, we need to enable egressGateway.enabled , bpf.masquerade and disable the l7Proxy. Further information on this can be seen in their <a href="https://docs.cilium.io/en/stable/network/egress-gateway/#enable-egress-gateway">docs</a></p><p>The final cilium status command is useful to gate the installation script before we continue to install FluxCD. This basically pauses until the CNI is ready.</p><pre># Install Cilium<br>echo &quot;Installing CNI Cilium...&quot;<br>cilium install \<br>  --set hubble.relay.enabled=true \<br>  --set hubble.ui.enabled=true \<br>  --set ingressController.enabled=true \<br>  --set ingressController.loadbalancerMode=shared \<br>  --set egressGateway.enabled=true \<br>  --set bpf.masquerade=true \<br>  --set kubeProxyReplacement=strict \<br>  --set l7Proxy=false \<br>  --set egressGateway.installRoutes=true<br><br>echo &quot;Checking CNI...&quot;<br>cilium status \<br>--wait</pre><h3>6. FluxCD Installation</h3><p>For the icing on the cake, we also install FluxCD, we have already created a bootstrap deployment ready for our needs so we just point to our repo and off we go.</p><pre>echo &quot;Installing FluxCD..&quot;<br>flux bootstrap github \<br>--owner=jysk-ops \<br>--repository=store-k3s \<br>--token-auth</pre><p>Once our installation is complete we should have a fully functional cluster. Our Flux setup installs extra services such as ExternalSecrets along with a ClusterSecretStore and we also configure a CiliumEgressGatewayPolicy.</p><p>See the related blog post on this one!</p><h3>Putting it all together</h3><p>For user convenience, we can utilize tools like CloudInit, Ansible, and others to set up our cluster. <strong>Stay tuned for more details in our upcoming post.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1FCdVB13roujUs7ZcpVS4w.gif" /><figcaption>Basic Installation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bo_C3jY6i4QHDHlc3qT_ZQ.png" /><figcaption>Check Cluster is Running</figcaption></figure><p>Resource usage after the install is pretty decent. It uses a little more RAM than expected, but we have also added externalsecrets, netshoot and some other bits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VEcwQaLkY_uIQC3hgwctZg.png" /></figure><h3>Uninstalling our environment</h3><p>To uninstall our cluster, we can simply run the standard k3s uninstall script — this will of course remove everything we have just setup.</p><pre>/usr/local/bin/k3s-uninstall.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQXDsOpWq4zUKfpHQEJHrA.gif" /></figure><h3>What’s next?</h3><p>So there you have it, a quick and easy way to install a simple K3s setup with Cilium and FluxCD that adheres to our corporate proxies and internal network structures to get the best of both worlds.</p><p>It’s important to highlight that the aforementioned is merely a <strong>prototype</strong>. In the subsequent two articles, we’ll refine the setup for a production environment, delve into large-scale deployment, and examine the FluxCD bootstrap installation. Furthermore, we’ll investigate the resources integrated into our cluster and Cilium’s CiliumEgressGatewayPolicy, facilitating the routing of traffic from pods to a designated interface.</p><p>Stay Tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77ecc5378d31" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/unleashing-the-power-of-k3s-for-edge-computing-deploying-3000-in-store-kubernetes-clusters-part-77ecc5378d31">Unleashing the Power of k3s for Edge Computing: Deploying 3000+ in-store Kubernetes Clusters —…</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transient Tech: JYSK’s Journey to On-Demand Development with Ephemeral Workspaces]]></title>
            <link>https://jysk.tech/transient-tech-jysks-journey-to-on-demand-development-with-ephemeral-workspaces-aa7cde99f575?source=rss-fd75f4513228------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa7cde99f575</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[coders]]></category>
            <dc:creator><![CDATA[Ryan Gough]]></dc:creator>
            <pubDate>Fri, 08 Sep 2023 11:05:07 GMT</pubDate>
            <atom:updated>2023-09-13T16:53:07.132Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdDYjr22iPDMr7uoV-x7Uw.png" /></figure><p>· <a href="#2e86">Benefits of Ephemeral Environments</a><br>· <a href="#e22c">How does JYSK implement this?</a><br>· <a href="#443c">Getting Started</a><br>· <a href="#9f6e">Coder deployment</a><br>· <a href="#7e8b">Coder CLI installation and setup</a><br>· <a href="#75c8">Creating a Basic Workspace</a><br>· <a href="#ccb4">Tips &amp; Tricks</a><br>· <a href="#b25d">Automatic Port Forwarding</a><br>· <a href="#7054">Using SCP to transfer files</a><br>· <a href="#aaf2">Predefined Templates</a><br>· <a href="#ce9f">SSH keypairs</a><br>· <a href="#3d7f">Remove all workspaces, templates at once</a><br>· <a href="#da8f">Conclusion</a></p><p>In recent years, ephemeral dev environments have become increasingly popular among developer/ops engineers. They provide a convenient and efficient way to create temporary development environments. Unlike traditional development environments that require complex setup and configuration, ephemeral environments can be created on-demand, used for a specific task, and discarded once the task is complete. This approach has several advantages, including reducing the overhead of managing complex development environments, improving reproducibility, and increasing flexibility.</p><p>In JYSK Ops we have started to adopt such environments, what we call as “JYSK Workspaces”, and in this blog post / deep-dive , we will explore the concept of ephemeral coding environments in more detail, discussing their benefits, use cases, and how they can be implemented… or at least try to.</p><h3>Benefits of Ephemeral Environments</h3><p>Ephemeral development environments have several benefits and not just for development teams:</p><ol><li><strong>Increased Flexibility:</strong> Environments can be quickly spun up and down, providing teams with greater flexibility to adapt to changing requirements and workloads. This is particularly useful for DevOps teams that need to support multiple projects simultaneously.</li><li><strong>Improved Reproducibility:</strong> Ephemeral environments can be created from the same configuration files and scripts, ensuring that every developer is working with an identical environment. This can help to improve the reproducibility of builds and deployments, reducing the likelihood of errors or inconsistencies.</li><li><strong>Reduced Overhead:</strong> Ephemeral environments eliminate the need for maintaining and updating long-lived development environments, reducing the overhead and costs associated with managing complex development infrastructure.</li><li><strong>Increased Security:</strong> These environments can be designed to be more secure than traditional development environments, as they can be destroyed after use, reducing the risk of sensitive data being left on the system. In addition to, these environments reduce their blast radius.</li><li><strong>Simplified Testing:</strong> Ephemeral environments can be used to quickly spin up test environments that are identical to production, allowing for more accurate testing and reducing the risk of bugs or errors being introduced during deployment.</li></ol><p>Overall, ephemeral development environments can help DevOps teams to improve their efficiency, agility, and security, while also reducing the complexity and overhead of managing development infrastructure.</p><h3>How does JYSK implement this?</h3><p>At JYSK Ops, we’ve begun embracing what we term “JYSK Workspaces”. In this article/deep-dive, we aim to delve deeper into the idea of ephemeral coding environments, touching on their advantages, applications, and methods of implementation… or we’ll give it our best shot.</p><p>The requirements for coding ing JYSK ops are currently quite flexible. We have basic style guides but do not mandate the language, allowing us a wide range of choices. In our development department, there of course are specifics, and these are created by developers; for developers. While this freedom has its advantages, it also has downsides. Implementing guidelines in our ops-development environment assures the business that essential parameters, such as using our developer security platform and adhering to coding standards, are being followed.</p><p>I recently participated in a CNCF workshop where they showcased Sysdig’s Falco Container Runtime Monitor. see <a href="https://community.cncf.io/events/details/cncf-aarhus-presents-what-the-hell-is-going-on-inside-my-container-and-kafka-at-scale-on-k8s/">what the hell is going on inside my container</a>. They utilized GitHub’s Codespaces for this, and I was instantly hooked. The convenience of accessing a project, making edits, and committing changes all through a browser from any location truly sparked my interest.</p><p>Today, our operations teams remain dedicated across various sectors, from Store IT operations that support specific applications/environments to our network infrastructure which is embarking on a robust automation journey. While these departments aren’t centered on development, they can seamlessly integrate with the established DevOps principles within our business. This fosters a tighter connection between operations and development, promoting a more cohesive workflow.</p><p>Why not establish a secure environment where our operations teams can write code, aligned with the existing business standards? A workspace that’s both secure and efficient, equipped with our built-in proxy configuration and locally configured repositories. Where one can either initiate a new project or fetch an existing one. Upon committing, pipelines handle everything else, leading to teams or individuals who can swiftly produce results and access a comprehensive suite of scanning, building, and deploying pipelines without further requests. If this is already a staple in most of our development sectors, why not extend it to operations — or even further?!</p><h3>Getting Started</h3><p>This assume we already have a working Kubernetes cluster. Currently i am using a dev environment we have internally for this, but something like k3s/k0s etc will also work fine.</p><p>If users are to provision their own persistent volumes, some shared storage is needed. We are using an <a href="https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner">NFS Provisioner</a>.</p><h3>Coder deployment</h3><p>A basic helm install on our Kubernetes setup is all it takes. We are adding some extra variables on deployment for integration with our OIDC — Keycloak.</p><p>Coder have an excellent guide on getting this up and running <a href="https://coder.com/docs/v2/latest/install/kubernetes">here</a> so I will not repeat. For this demo i am using coder v2 — helm repo add coder-v2 <a href="https://helm.coder.com/v2">https://helm.coder.com/v2</a></p><p>The only modifications are:</p><pre>- name: CODER_ACCESS_URL<br>  value: &#39;https://workspaces-poc.jysk.local&#39;<br>- name: CODER_WILDCARD_ACCESS_URL<br>  value: &#39;*.workspaces-poc.jysk.local&#39;<br>- name: CODER_OIDC_SIGN_IN_TEXT<br>  value: &#39;Sign in with Keycloak&#39;<br>- name: CODER_OIDC_ICON_URL<br>  value: &#39;https://upload.wikimedia.org/wikipedia/commons/2/29/Keycloak_Logo.png&#39;<br>- name: CODER_OIDC_ISSUER_URL<br>  value: &#39;https://&lt;oidc domain&gt;/auth/realms/dev&#39;<br>- name: CODER_OIDC_EMAIL_DOMAIN<br>  value: &#39;jysk.com&#39;<br>- name: CODER_OIDC_CLIENT_ID<br>  value: &#39;workspaces-poc&#39;<br>- name: CODER_OIDC_CLIENT_SECRET<br>  valueFrom:<br>    secretKeyRef:<br>      name: &#39;oidc-secret&#39;<br>      key: &#39;secret&#39;<br>- name: CODER_OIDC_IGNORE_EMAIL_VERIFIED`<br>  value: &#39;true&#39;</pre><p>CODER_OIDC_CLIENT_SECRET comes from the secret oidc-secret</p><pre>k create secret generic oidc-secret -n coder --from-literal=secret=&lt;your secret here&gt;</pre><p>If one were to utilize a corporate proxy with TLS interception we need to give our coder installation the needed CAs, the following is added to our values.yaml file</p><pre>certs:<br>  secrets:<br>    - name: &#39;certs&#39;<br>      key: &#39;jysk_ca_bundle.cer&#39;</pre><p>We will also need a secret for the PostgresSQL DB, and can be set with CODER_PG_CONNECTION_URL. If this is not set, then coder will use an internal Postgres DB however this will of course be temporary and removed when the container dies.</p><pre>k create secret generic coder-db-url -n coder \<br>   --from-literal=url=&quot;postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable&quot;</pre><p>Other than that it’s a basic update/install</p><pre>➜  coder git:(main) ✗ helm upgrade -i coder coder-v2/coder --namespace coder -f values.yamlRelease &quot;coder&quot; has been upgraded. Happy Helming!</pre><pre>NAME: coder<br>LAST DEPLOYED: Mon Aug 14 09:09:17 2023<br>NAMESPACE: coder<br>STATUS: deployed<br>REVISION: 23<br>TEST SUITE: None<br>NOTES:<br>Enjoy Coder! Please create an issue at <a href="https://github.com/coder/coder">https://github.com/coder/coder</a> if you run</pre><h3>Coder CLI installation and setup</h3><p>In addition to the environment, we also need a client cli. This give the ability to easily interact with the new coder installation. Consult the coder v2 <a href="https://coder.com/docs/v2/latest/install">docs</a> for more info, but it can easily be installed with:</p><pre>curl -fsSL https://coder.com/install.sh | sh</pre><p>When installed, we need to connect our cli to our new instance, as we have defined the ingress as workspaces-poc.jysk.local and our auth method OIDC then we can use:</p><pre>➜  coder git:(main) ✗ coder login https://workspaces-poc.jysk.local/<br>Your browser has been opened to visit:<br><br>https://workspaces-poc.jysk.local/cli-auth<br><br>&gt; Paste your token here: &lt;token&gt;<br>&gt; Welcome to Coder, rgo! You&#39;re authenticated.</pre><p>From here on our we mostly use the cli to configure our workspaces. Lets make a basic workspace so we can edit this tech blog.</p><h3>Creating a Basic Workspace</h3><p>The coder <a href="https://coder.com/docs/v2/latest/templates#add-a-template">docs</a> actually have a really nice example of a basic setup. However, we require a little more configuration for an enterprise setup. Namely, we want proxy support and our own CA’s installed. In addition, there are also some environment settings and some basic lint packages installed.</p><p>Before we proceed — lets make a custom container image to deploy for our ubuntu workspace. Again, we are running a an air-gapped setup, thus we pull down through a proxy, install our certificates and forward proxy settings for apt, in addition we run the code-server setup in our container. This is mainly to improve deployment speed.</p><pre>FROM &lt;domain&gt;/dockerhub/codercom/enterprise-base:ubuntu<br><br>USER root<br><br>RUN cd /tmp &amp;&amp; curl -O http://&lt;domain&gt;/JYSK_certificates.zip<br>RUN mkdir -p /usr/local/share/ca-certificates/jysk &amp;&amp; \<br>    unzip -j /tmp/JYSK_certificates.zip *.cer -d /usr/local/share/ca-certificates/jysk<br>RUN cd /usr/local/share/ca-certificates/jysk &amp;&amp; for file in *.cer; do mv &quot;$file&quot; &quot;${file%.cer}.crt&quot;; done<br>RUN /usr/sbin/update-ca-certificates<br><br>RUN echo &#39;Acquire::http::proxy &quot;http://&lt;proxy address&gt;:8080&quot;;&#39; &gt; /etc/apt/apt.conf.d/proxy.conf<br>RUN echo &#39;Acquire::https::proxy &quot;http://&lt;proxy address&gt;:8080&quot;;&#39; &gt;&gt; /etc/apt/apt.conf.d/proxy.conf<br><br># install the latest version<br>RUN curl -fsSL https://code-server.dev/install.sh -v | sh<br>USER coder</pre><p>This is built, and pushed to our internal container registry:</p><pre>docker build -t &lt;domain&gt;/devops/jysk-enterprise-base:ubuntu<br>docker push</pre><p>After addressing this, we can establish our initial template, which we’ll name jysk-ubuntu-workspace. By executing coder templates init, a list of templates will be presented, choose the Kubernetes template, and it will produce a Terraform file.</p><p>We’ve updated the Terraform manifest and integrated our container image (previously created) within the &quot;kubernetes_deployment&quot; &quot;main&quot; block&#39;s container definition. Finally, we&#39;ve incorporated startup configurations that install a sample VSCode extension like code-spell-checker, set up basic Git defaults such as name and email, and naturally, incorporated our essential proxy settings and CA certificates for the node.</p><p><strong>TIP! If using a forward proxy, take note of the </strong><strong>$KUBERNETES_PORT_443_TCP_ADDR added to the </strong><strong>NO_PROXY environment variable. This is needed so that coder doesn&#39;t try and contact the mothership (the coder container) through our proxy!</strong></p><pre>resource &quot;coder_agent&quot; &quot;main&quot; {<br>  ...<br><br>  startup_script         = &lt;&lt;-EOT<br>    set -e<br>    /usr/bin/code-server --install-extension streetsidesoftware.code-spell-checker<br>    /usr/bin/code-server --auth none --port 13337 &gt;/tmp/code-server.log 2&gt;&amp;1 &amp;<br>  EOT</pre><pre>  env = {<br>    GIT_AUTHOR_NAME     = &quot;${data.coder_workspace.me.owner}&quot;<br>    GIT_COMMITTER_NAME  = &quot;${data.coder_workspace.me.owner}&quot;<br>    GIT_AUTHOR_EMAIL    = &quot;${data.coder_workspace.me.owner_email}&quot;<br>    GIT_COMMITTER_EMAIL = &quot;${data.coder_workspace.me.owner_email}&quot;</pre><pre>    HTTP_PROXY  = &quot;http://&lt;proxy address&gt;:8080&quot;<br>    HTTPS_PROXY = &quot;http://&lt;proxy address&gt;:8080&quot;<br>    NO_PROXY    = &quot;jysk.com,jysk.local,$KUBERNETES_PORT_443_TCP_ADDR&quot;<br>    NODE_EXTRA_CA_CERTS = &quot;/etc/ssl/certs/ca-certificates.crt&quot;<br>  }</pre><pre>  ...</pre><p>Finally, we can now create our template.</p><pre># Create the template<br>coder templates create jysk-ubuntu<br><br># Check it has been applied<br>code template list</pre><p>Once our template is created, we can then launch our workspace — this can be done via the web UI or command line. Any of the users that have access to the system can now login, and create their own personal workspace. In the CLI we can create a basic workspace:</p><pre># Create a workspace from our jysk-ubuntu template<br>coder create --template=&quot;jysk-ubuntu&quot; jysk-tech<br><br># Make sure we are up and running<br>coder list -a<br><br># We can also check this in our k8s api<br>kubectl get pod -n coder</pre><p>A full demo of the setup:</p><p><a href="https://asciinema.org/a/yksi0IYWouJwgLTRCtgdXZdXy">untitled</a></p><p>We can also create a workspace via the UI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bqiRMGZfYhWfvzRYPavuQ.gif" /></figure><h3>Tips &amp; Tricks</h3><h3>Automatic Port Forwarding</h3><p>Coder automatically publishes any ports opened within your VSCode. So for example, when creating this blog post i am working within my workspace, and have hugo serve running in my intergrated terminal. This then provides me with a URL, so i can see live updates as i type.</p><p>One small caveat with this is that you need to have a wildcard tls certificate as coder uses subdomains to determine the port that needs to be forward.</p><pre>hugo serve -b https://443--main--jysk-tech--rgo.workspaces-poc.jysk.local/ -p 443</pre><p>Of-course the URL will differ on your installation, but the basic idea is that i can write and view at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gTcd44a8mrJK6WaWvjq5dQ.png" /><figcaption><em>VSCode and Hugo</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pU8afIvYw50iburT5KPM7g.png" /></figure><h3>Using SCP to transfer files</h3><p>Whilst writing this blog, in coder i needed to be able to transfer some of the demo files and screenshots. Coder gives an SSH option that’s very simple to setup.</p><p>Transfering files can also utilize this method:</p><pre># Setup the .ssh/config file for your instance <br>coder config-ssh<br><br># transfer the file<br>scp /Users/rgo/Screenshots/ssh.png  coder.jysk-tech:website/content/posts/ephemeral-environments/</pre><p>In addition to this you can just drag &amp; drop files into the UIs folder structure.</p><h3>Predefined Templates</h3><p>Some of the great features of coder is pre-defined workspaces. In JYSK we have created templates for Golang, Powershell, basic Ubuntu and even a VNC Remote Desktop. Applied with some default business configuration it makes spinning up a new workspace easy. This cuts time in onboarding consultants and third party users.</p><h3>SSH keypairs</h3><p>By default, coder creates an ssh key for every user on the system. Therefore, on the users profile you can find the public part which can be used in Github. This makes pulling down repositories a breeze!</p><h3>Remove all workspaces, templates at once</h3><p><strong>The below commands will remove all workspaces and templates — including any user data! Use with care.</strong></p><p>Remove all workspaces:</p><pre>for i in `coder list -a | tail -n +2`; do coder delete $i -y<br>done</pre><p>Remove all templates:</p><pre>for i in `coder template list  | tail -n +2`; do coder template delete $i -y<br>done</pre><h3>Conclusion</h3><p>Ephemeral dev environments, like the “JYSK Workspaces” we’ve introduced at JYSK Ops, represent a paradigm shift in how developer/ops engineers approach their work. These environments, which can be spun up on-demand and discarded post-task, usher in enhanced efficiency, reproducibility, and adaptability. As the tech landscape continues to evolve, embracing such innovations ensures that we remain agile, reducing unnecessary overheads and fostering an environment conducive to streamlined operations and optimal productivity.</p><p>Although this has been a proof of concept within the company, we have been using it on/off for some months. Interest has grown and eventually this will be set into a productive setting where we can make better use.</p><p>For now though, it’s a great playground to test coder on!</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa7cde99f575" width="1" height="1" alt=""><hr><p><a href="https://jysk.tech/transient-tech-jysks-journey-to-on-demand-development-with-ephemeral-workspaces-aa7cde99f575">Transient Tech: JYSK’s Journey to On-Demand Development with Ephemeral Workspaces</a> was originally published in <a href="https://jysk.tech/">JYSK Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>