aboutsummaryrefslogtreecommitdiff
path: root/lume/src/notes
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-01-23 22:10:42 -0500
committerXe Iaso <me@xeiaso.net>2025-01-23 22:10:53 -0500
commit8034def6a1b5a492fc447a89943e788f8760491f (patch)
tree30358b8cde4a5ce9ca960c1b2d73389202265219 /lume/src/notes
parent1cdbc5075ff449945166d5d8bd980cf92e7e3a8f (diff)
downloadxesite-8034def6a1b5a492fc447a89943e788f8760491f.tar.xz
xesite-8034def6a1b5a492fc447a89943e788f8760491f.zip
use oracle linux on a macbook for battery life
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'lume/src/notes')
-rw-r--r--lume/src/notes/2025/k8s-dev-mac-oracle-linux.mdx44
1 files changed, 44 insertions, 0 deletions
diff --git a/lume/src/notes/2025/k8s-dev-mac-oracle-linux.mdx b/lume/src/notes/2025/k8s-dev-mac-oracle-linux.mdx
new file mode 100644
index 0000000..11608bb
--- /dev/null
+++ b/lume/src/notes/2025/k8s-dev-mac-oracle-linux.mdx
@@ -0,0 +1,44 @@
+---
+title: "Life pro tip: Oracle Linux is the best local VM for MacBooks"
+desc: "No, seriously. It sips battery life. I don't get it either."
+date: 2025-01-23
+---
+
+Part of working on Anubis means that I need a local Linux environment on my MacBook. Ideally, I want Kubernetes so that I have a somewhat cromulent setup.
+Most of my experience using a local Kubernetes cluster on a MacBook is with [Docker Desktop](https://www.docker.com/products/docker-desktop/). I have a love/hate relationship with Docker Desktop. Historically it's been a battery hog and caused some really weird issues.
+
+I tried to use Docker Desktop on my MacBook again and not only was it a battery hog like I remembered; whenever the Kubernetes cluster is running the machine fails to go to sleep when I close it. I haven't been able to diagnose this despite help from mac expert friends in an infosec shitposting slack. I've resigned myself to just shutting down the Docker Desktop app when I don't immediately need Docker.
+
+I have found a solution thanks to a very unlikely Linux distribution: [Oracle Linux](https://www.oracle.com/linux/). Oracle Linux is downstream of Red Hat Enterprise Linux, and more importantly they ship a "no thinking required" template for [UTM](https://mac.getutm.app). Just download the aarch64 UTM image from their [cloud images page](https://yum.oracle.com/oracle-linux-templates.html), extract it somewhere, rename the `.utm` file to the name of your VM, double click, copy the password, log in, change your password on first login, and bam. You get a Linux environment.
+
+It is glorious.
+
+Additionally, [k3s](https://k3s.io) works seamlessly on it. Just run the curl2bash, copy `/etc/rancher/k3s/k3s.yaml` to your `~/.kube/config` (or change the IP address in the file and install it to your MacBook via a bridged network), and you have a fully working Kubernetes cluster with [Traefik](https://traefik.io/) preinstalled.
+
+They also have a [`HelmChart` custom resource](https://docs.k3s.io/helm#using-the-helm-controller) that lets you install Helm releases declaratively. Here's how my VM gets `cert-manager`:
+
+```yaml
+apiVersion: helm.cattle.io/v1
+kind: HelmChart
+metadata:
+ name: cert-manager
+ namespace: kube-system
+spec:
+ repo: https://charts.jetstack.io
+ chart: cert-manager
+ targetNamespace: cert-manager
+ createNamespace: true
+ set:
+ installCRDs: "true"
+ "prometheus.enabled": "false"
+```
+
+I love it.
+
+The best part is that this setup is more complicated than the Docker Desktop VM, yet it _sips_ battery life. Opening the Docker Desktop app can cause my MacBook's fans to spin up and stay on at a dull roar. Oracle Linux in UTM leaves the fans silent and doesn't show up in the top energy users list.
+
+This is frankly nuts and I'm going to be taking advantage of this as much as I can for local development.
+
+I need to figure out a good way to run a Docker registry in the k3s node or something so I can do builds and test runs on an airplane, but this is a solveable issue with enough time and effort.
+
+I'm still just flabbergasted at how well put together Oracle Linux is though, it's very minimal, but very well documented [on Oracle's site](https://docs.oracle.com/en/operating-systems/oracle-linux/9/). I don't know if I'd feel comfortable using it in prod yet, but I'm very happy with it.