<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The Hypervisor: Cloud]]></title><description><![CDATA[A series of posts on the topic of Cloud Computing]]></description><link>https://www.thehypervisor.blog/s/cloud-computing</link><image><url>https://substackcdn.com/image/fetch/$s_!eCSK!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf7f1646-9248-40c8-a717-6f1ed8bb8d61_800x800.png</url><title>The Hypervisor: Cloud</title><link>https://www.thehypervisor.blog/s/cloud-computing</link></image><generator>Substack</generator><lastBuildDate>Sat, 16 May 2026 02:30:02 GMT</lastBuildDate><atom:link href="https://www.thehypervisor.blog/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Matthew Leone]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[thehypervisor@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[thehypervisor@substack.com]]></itunes:email><itunes:name><![CDATA[Matthew Leon]]></itunes:name></itunes:owner><itunes:author><![CDATA[Matthew Leon]]></itunes:author><googleplay:owner><![CDATA[thehypervisor@substack.com]]></googleplay:owner><googleplay:email><![CDATA[thehypervisor@substack.com]]></googleplay:email><googleplay:author><![CDATA[Matthew Leon]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Getting Started with Traefik: The Modern Load Balancer]]></title><description><![CDATA[Exploring a next-gen cloud-optimized reverse-proxy and load-balancer]]></description><link>https://www.thehypervisor.blog/p/getting-started-with-traefik</link><guid isPermaLink="false">https://www.thehypervisor.blog/p/getting-started-with-traefik</guid><dc:creator><![CDATA[Matthew Leon]]></dc:creator><pubDate>Sun, 12 Jan 2025 05:20:07 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/99227bf7-5d72-4c4c-b5b8-53f9c66e77f3_225x225.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><code>In cloud computing, efficient management of resources is critical, especially for web and distributed systems. There are many technologies that enable these systems to perform in an optimized manner. One such family of technologies is called the reverse-proxy AKA the load-balancer.<br><br>The reverse-proxy / load-balancer is a core component of service-oriented architected systems. In this style of software architecture, the system runs light-weight software services that are decoupled from each other and expose interfaces to enable features and implement functional requirements. We also see that there are numerous instances of the same service that allow the system to distribute its workloads across as opposed to pushing them through a single service. The job of the reverse-proxy / load-balancer is to enable the distribution of workloads across service instances in order to increase reliability of the system substantially.</code></p><p><code>There are several projects that implement this technology. A few of them are HAProxy, nginx, Envoy, and Traefik. They all have their tradeoffs, but today I want to show the power of Traefik.<br><br>First, it will be helpful to discuss some recurring issues with a lot of reverse-proxies.<br></code></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thehypervisor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><code>Thanks for reading The Hypervisor! Subscribe for free to receive new posts and support my work.</code></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ol><li><p><code>A lot of manual and static configuration is required to configure and maintain reverse-proxies.These two points can make developing distributed systems challenging. The reason why is because these systems need to be told what services running on a given host need to be connected to and fed traffic. Adding services may require complex configuration changes, and may also require the system to be taken down to bring on more services running on a host.</code></p><p></p></li><li><p><code>Enabling security protocols like SSL can be painful for the services added to the proxy. On load-balancers, there may be a large subsystem designed just for handling the certificates that a service handles, which means making direct changes to the host environment, requiring complex maintenance that can disrupt the services.</code></p><p></p></li></ol><p><code>Traefik does a beautiful job of handling these at the expense of a little bit more over-head than non-cloud optimized reverse-proxies like HAProxy and nginx.<br></code></p><p><code>Traefik has a very simple system for enabling a self-managing service easily, which we will do now. It runs on top of docker, and you manage it by making changes to a container management system like kubernetes or docker compose. This guide uses docker compose.<br><br>The requirements for running Traefik are relatively straightforward. Assuming you are running an ubuntu server, you can perform the following 3 steps to prep your system to run Traefik in a containerized environment:<br><br>1: Install ca-certificates and curl:</code></p><pre><code><code>sudo apt-get update &amp;&amp; sudo apt-get install -y ca-certificates curl</code></code></pre><p><code>2: Install docker and docker compose by following the guide. I would recommend using the apt method, but use whatever works best for you: https://docs.docker.com/desktop/setup/install/linux/ubuntu/<br><br>3: Install the docker packages:</code></p><pre><code><code>sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</code></code></pre><p><code>Once you have performed these steps, you are all set to run Traefik.</code></p><p><code><br>There are a couple more steps for actually running Traefik, though. Those steps are to create a traefik and docker-compose configurations:<br><br>1: Create the traefik configuration:<br><br>The goal of this step is to set up a repository or directory such that it can pull and run a Traefik docker container in a proxy network and connect it to a service running on the same host.<br></code></p><p><code>In a base directory or repository, run the following:</code></p><pre><code><code>mkdir -p config

touch config/acme.json
chmod 600 config/acme.json

touch config/traefik.yml
chmod 644 config/traefik.yml</code></code></pre><p><code>and then place the following content in traefik.yml:</code></p><pre><code><code>entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure:
    address: ":443"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
    network: proxy

certificatesResolvers:
  letsencrypt:
    acme:
      email: *your_email*
      storage: acme.json
      httpChallenge:
        entryPoint: web
</code></code></pre><p><code>&#8230;and make sure to replace your_email in the file with the email that you want to coordinate with letsencrypt.</code></p><p><code>After this has been completed, create a docker-compose.yml file in the same directory as the config directory, and place the following content in it:</code></p><pre><code><code>networks:

  proxy:
    external: true

services:

  traefik:
    image: traefik:v2.10
    container_name: traefik
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.yml:/traefik.yml:ro
      - ./config/acme.json:/acme.json
    networks:
      - proxy

  site:
    build: .
    image: site
    volumes:
      - .:/site/app
      - /site/app/node_modules
      - /site/app/.next
      - ./site/public:/usr/src/app/public
    networks:
      - proxy
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.myservice-http.rule=PathPrefix(`/`)"
      - "traefik.http.routers.myservice-http.entrypoints=web"
      - "traefik.http.routers.myservice-https.rule=PathPrefix(`/`)"
      - "traefik.http.routers.myservice-https.entrypoints=websecure"
      - "traefik.http.routers.myservice-https.tls=true"
      #- "traefik.http.routers.nextjs-https.tls.certresolver=letsencrypt"
      - "traefik.http.services.nextjs.loadbalancer.server.port=3000"

</code></code></pre><p><code>This docker compose configuration launches a Traefik container in the proxy network and passes the configuration that we just created to it. We also give it ports 80 and 443 from the host, because this example is running a web application and it needs HTTP and HTTPS ports. Notice that the certresolve label is commented out. The reason why is because we aren&#8217;t trying to forward traffic to a specific site to the app, we are just forwarding all traffec based on the http.rule and the https.rules give by the &#8216;/&#8217; above it.<br><br><br>After that we run the following to launch the configuration:</code></p><pre><code><code>docker network create proxy
docker build --force-rm -t site .
docker compose up</code></code></pre><p><code>Assuming that everything is set up properly, we should see that Traefik launches and handles everything from the configuration setup to coordinating with letsencrypt for enabling TLS for the traffic that we receive. We should see an output that looks similar to the following:</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pzgJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pzgJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 424w, https://substackcdn.com/image/fetch/$s_!pzgJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 848w, https://substackcdn.com/image/fetch/$s_!pzgJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 1272w, https://substackcdn.com/image/fetch/$s_!pzgJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pzgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png" width="1414" height="844" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:844,&quot;width&quot;:1414,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:128221,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pzgJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 424w, https://substackcdn.com/image/fetch/$s_!pzgJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 848w, https://substackcdn.com/image/fetch/$s_!pzgJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 1272w, https://substackcdn.com/image/fetch/$s_!pzgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cf3a33f-194f-4054-be76-90edd4503b16_1414x844.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><code>Just to summarize, the beauty of Traefik is that we have a simple system for running and handling web applications and servers. Traefik enables me to host however many services I want, but in my case, it automatically handles my website&#8217;s encryption. This comes at the tradeoff of high-performance, but if your usecase is focused more on the features, then Traefik is an incredibly powerful tool that makes building and running a website simple.</code></p><p><code>The source code for this example can be downloaded and ran by doing the following:</code></p><pre><code><code>git clone https://github.com/leonematt/research
cd research/cloud/load-balancers/traefik/example
./install.sh
./run.sh</code></code></pre><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thehypervisor.blog/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><code>Thanks for reading The Hypervisor! Subscribe for free to receive new posts and support my work.</code></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>