P5.1: Migrate minikube from podman to QEMU2 driver #38

Merged
eblume merged 16 commits from feature/p5.1-qemu2-migration into main 2026-01-21 16:03:38 -08:00
4 changed files with 106 additions and 0 deletions
Showing only changes of commit 40376b635f - Show all commits

Add LaunchDaemon/LaunchAgent for persistent NFS and minikube mounts

- LaunchDaemon: mounts sifaka:/volume1/torrents to /Volumes/torrents-nfs at boot
- LaunchAgent: runs minikube mount to pass through to /mnt/torrents in VM
- Handlers to load both services when plist files change

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Erich Blume 2026-01-21 08:22:53 -08:00

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.blumeops.minikube-mount</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>
# Wait for minikube to be running
for i in {1..60}; do
if /opt/homebrew/bin/minikube status | grep -q "Running"; then
break
fi
sleep 5
done
# Wait for NFS mount to be available
for i in {1..30}; do
if mount | grep -q "/Volumes/torrents-nfs"; then
break
fi
sleep 2
done
# Start the mount (this blocks until killed)
exec /opt/homebrew/bin/minikube mount /Volumes/torrents-nfs:/mnt/torrents
</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/minikube-mount.err</string>
<key>StandardOutPath</key>
<string>/tmp/minikube-mount.log</string>
</dict>
</plist>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.blumeops.nfs-torrents</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/mount</string>
<string>-t</string>
<string>nfs</string>
<string>-o</string>
<string>resvport,rw</string>
<string>sifaka:/volume1/torrents</string>
<string>/Volumes/torrents-nfs</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/nfs-torrents.err</string>
<key>StandardOutPath</key>
<string>/tmp/nfs-torrents.log</string>
</dict>
</plist>

View file

@ -12,3 +12,16 @@
ansible.builtin.command:
cmd: minikube ssh --native-ssh=false "sudo systemctl restart containerd"
changed_when: true
- name: Load NFS mount LaunchDaemon
ansible.builtin.command:
cmd: launchctl load /Library/LaunchDaemons/com.blumeops.nfs-torrents.plist
become: true
failed_when: false
changed_when: true
- name: Load minikube mount LaunchAgent
ansible.builtin.command:
cmd: launchctl load {{ ansible_env.HOME }}/Library/LaunchAgents/com.blumeops.minikube-mount.plist
failed_when: false
changed_when: true

View file

@ -106,3 +106,31 @@
changed_when: minikube_registry_config.rc == 0
when: minikube_final_status.rc == 0 and 'Running' in minikube_final_status.stdout
notify: Restart containerd in minikube
# Set up persistent NFS mount from sifaka and minikube mount passthrough
# NFS mount uses LaunchDaemon (runs as root at boot)
# Minikube mount uses LaunchAgent (runs in user GUI session at login)
- name: Create NFS mount point
ansible.builtin.file:
path: /Volumes/torrents-nfs
state: directory
mode: "0755"
become: true
- name: Install NFS mount LaunchDaemon
ansible.builtin.copy:
src: com.blumeops.nfs-torrents.plist
dest: /Library/LaunchDaemons/com.blumeops.nfs-torrents.plist
owner: root
group: wheel
mode: "0644"
become: true
notify: Load NFS mount LaunchDaemon
- name: Install minikube mount LaunchAgent
ansible.builtin.copy:
src: com.blumeops.minikube-mount.plist
dest: "{{ ansible_env.HOME }}/Library/LaunchAgents/com.blumeops.minikube-mount.plist"
mode: "0644"
notify: Load minikube mount LaunchAgent