{"id":1314,"date":"2023-11-27T12:00:00","date_gmt":"2023-11-27T20:00:00","guid":{"rendered":"https:\/\/letsbuildroboticswithshadow8472.com\/?p=1314"},"modified":"2023-11-27T02:41:06","modified_gmt":"2023-11-27T10:41:06","slug":"rocky-server-stack-deep-dive-2023-part-5","status":"publish","type":"post","link":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/2023\/11\/27\/rocky-server-stack-deep-dive-2023-part-5\/","title":{"rendered":"Rocky Server Stack Deep Dive: 2023 Part 5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Good Morning from my Robotics Lab! This is Shadow_8472 and today I am learning more about Podman Quadlets for my homelab. Let\u2019s get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Systemd and Quadlets<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">From my incomplete research going into this topic, I already know Quadlets is a system for efficiently integrating Podman containers in with Systemd. It was merged into Podman v4.4, and I had a small pain of a time trying to find a distribution with both that and legacy BIOS support along with a list of other requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But what is Systemd? In short: Systemd is the init process \u2013a process that manages other processes\u2013 used by most Linux distributions that aren\u2019t trying to optimize for a low RAM or storage footprint. As it turns out, I\u2019ve already had minimal exposure to it while writing unit files for NFS [auto]mounts and a static IP address on Debian. Systemd in turn bases units off these unit files to manage the operating system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>While Systemd unit files defining Podman containers can be written by hand, Quadlets can automate their creation based off simpler unit files of its own: .container, .network, .volume, and .kube. The first three look similar enough to concepts I\u2019m familiar enough with that I figure I could hack an example into doing what I need.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But I\u2019m interested in pods. With .pod unit files only a controversial feature request at best, that leaves me to explore .kube files, which run Kubernetes YAML files. I know nothing about writing Kubernetes YAML files from scratch, and I refuse to cram for them Thanksgiving week.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My project died here for a few hours. One Systemd tutorial brought up Syncthing in an example, and I spent a while on a tangent looking at that, but it too is too large to cram for this week. I unenthusiastically browsed back to Kubernetes, and found:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">podman generate kube<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looks like I just might get away with adapting my scripts after all this week. With this in mind, I copied over my files from my laptop\u2019s Debian drive to its new-last-week Rocky 9 installation. Focusing on Nextcloud, I cleared out my dead-end work with Fuse, abstracted volumes, and other junk before realizing BusyBox was likely a more suitable testing grounds.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My First Kuberneties File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I came up with the following bash script for such a pod:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman pod stop busyBoxPod<br>podman pod rm busyBoxPod<br>podman pod create busyBoxPod<br>podman create \\<br>    --pod busyBoxPod \\<br>    --name BusyBox \\<br>    --volume fastvolume:\/root\/disk \\<br>    -it \\<br>    --rm \\<br>    busybox<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And here is<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Save the output of this file and use kubectl create -f to import\n# it into Kubernetes.\n#\n# Created with podman-4.6.1\napiVersion: v1\nkind: Pod\nmetadata:\n  creationTimestamp: \"2023-11-23T01:29:45Z\"\n  labels:\n    app: busyBoxPod\n  name: busyBoxPod\nspec:\n  containers:\n  - image: docker.io\/library\/busybox:latest\n    name: BusyBox\n    stdin: true\n    tty: true\n    volumeMounts:\n    - mountPath: \/root\/disk\n      name: fastvolume-pvc\n  volumes:\n  - name: fastvolume-pvc\n    persistentVolumeClaim:\n      claimName: fastvolume<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I saved this output as busyBoxPod.yml and returned to Nextcloud.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nextcloud put up a small tantrum getting re-updated for Podman 4.6.1. I had to look up how to Podman Secrets, and apply :z to volumes to satisfy SELinux. Redis however, refused to accept a password from Podman Secrets, so I rolled back that change. The pod should insulate it anyway. I got it to a point where it needed a domain name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Branching out to bring up Pi-Hole and Caddy, I learned how the default Unbound configuration for the container I used only forwards DNS requests to Cloudflare. I\u2019ll want to fix this later. I used firewall-cmd to forward ports for HTTP, HTTPS, and DNS to underprivileged ports for rootless containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Takeaway<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">UNCLE! I find more and more of my time supposedly working on server is procrastinating and stressing over either minutia or blankly staring at my screens when I muster enough focus to ignore distractions. There&#8217;s no way around it; I\u2019m officially burned out on this project. I\u2019ll maybe come back to it after the new year. I really wanted to get my .kube files working for at least Pi-Hole and Caddy, but it\u2019s going to be a hard pass at the moment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final Question<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019m considering covering a free\/open source game or few over December. What are your recommendations?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I look forward to hearing from you on my <a href=\"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/discord-invite\/\" target=\"_blank\" rel=\"noreferrer noopener\">Socials<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good Morning from my Robotics Lab! This is Shadow_8472 and today I am learning more about Podman Quadlets for my homelab. Let\u2019s get started! Systemd and Quadlets From my incomplete research going into this topic, I already know Quadlets is a system for efficiently integrating Podman containers in with Systemd. It was merged into Podman &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/2023\/11\/27\/rocky-server-stack-deep-dive-2023-part-5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rocky Server Stack Deep Dive: 2023 Part 5&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[195],"tags":[214,211,138,309],"class_list":["post-1314","post","type-post","status-publish","format-standard","hentry","category-server","tag-homelab","tag-nextcloud","tag-podman","tag-quadlets"],"_links":{"self":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/1314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/comments?post=1314"}],"version-history":[{"count":2,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/1314\/revisions"}],"predecessor-version":[{"id":1316,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/1314\/revisions\/1316"}],"wp:attachment":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/media?parent=1314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/categories?post=1314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/tags?post=1314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}