<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Tag: RHEL - Ryan Daniels</title>
	<atom:link href="https://ryandaniels.ca/blog/tag/rhel/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Fri, 17 Jan 2025 02:33:13 +0000</lastBuildDate>
	<language>en-CA</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://ryandaniels.ca/wp-content/uploads/2019/07/img_5907-small-blur-square-100x100.jpg</url>
	<title>Tag: RHEL - Ryan Daniels</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">22628916</site>	<item>
		<title>bootc (Bootable Containers): One Container Image to rule them all</title>
		<link>https://ryandaniels.ca/blog/bootc-bootable-containers-one-container-image-to-rule-them-all/</link>
		
		<dc:creator><![CDATA[Ryan Daniels]]></dc:creator>
		<pubDate>Fri, 17 Jan 2025 02:13:15 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Atomic]]></category>
		<category><![CDATA[bootc]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Immutable]]></category>
		<category><![CDATA[RHEL]]></category>
		<guid isPermaLink="false">https://ryandaniels.ca/?p=4319</guid>

					<description><![CDATA[<p>bootc has the potential to be groundbreaking (for Enterprise server Linux). A scalable and immutable OS for servers. (Although I like the term Atomic better).</p>
<p>The post <a href="https://ryandaniels.ca/blog/bootc-bootable-containers-one-container-image-to-rule-them-all/">bootc (Bootable Containers): One Container Image to rule them all</a> appeared first on <a href="https://ryandaniels.ca/">Ryan Daniels</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>bootc has the potential to be groundbreaking (for Enterprise server Linux). A scalable and immutable OS for servers. (Although I like the term Atomic better).</p>



<p>Earlier in 2024 Red Hat announced <a href="https://www.redhat.com/en/blog/introducing-image-mode-red-hat-enterprise-linux">&#8220;Image Mode&#8221; for Red Hat Enterprise Linux</a>. Currently Image Mode is in &#8220;Technology Preview&#8221; for RHEL. This is powered by Bootable Containers (or bootc for short). Fedora is also using this new technology, and they have great <a href="https://docs.fedoraproject.org/en-US/bootc/getting-started/">documentation</a>.</p>



<p>To summarize what bootc does,<br>from the Fedora Documentation:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>The <a href="https://containers.github.io/bootc/">bootc documentation</a> summarizes bootable containers as &#8220;transactional, in-place operating system updates using OCI/Docker container images&#8221;. In other words, updates to the operating system (OS) are shipped by using container images. That implies that the Linux kernel, the bootloader, drivers, etc. are all part of the container image which renders the container image &#8220;bootable&#8221;.</p>
</blockquote>



<p>These deployments are atomic, meaning they are (mostly) read-only by default.</p>



<p>Updates are easy, just re-build the Container Image and by default the bootc host will update (and reboot) on it&#8217;s own.</p>



<figure class="wp-block-image size-thumbnail"><a href="https://ryandaniels.ca/wp-content/uploads/2024/12/bootc_updates.png" rel="lightbox[4319]"><img fetchpriority="high" decoding="async" width="300" height="178" src="https://ryandaniels.ca/wp-content/uploads/2024/12/bootc_updates-300x178.png" alt="bootc update flow" class="wp-image-4347" srcset="https://ryandaniels.ca/wp-content/uploads/2024/12/bootc_updates-300x178.png 300w, https://ryandaniels.ca/wp-content/uploads/2024/12/bootc_updates.png 658w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption class="wp-element-caption">Image Credit: <a href="https://docs.fedoraproject.org/en-US/bootc/getting-started/#_updating_bootable_containers">Fedora docs</a></figcaption></figure>



<h2 class="wp-block-heading">What makes bootc so exciting?</h2>



<p>One Container Image to rule them all.<br>Sorry, I meant to say: One Container Image to keep every server up to date, automatically.</p>



<p>Every server automatically checks for a new container image. When there&#8217;s a new image, the server automatically updates. If the update or reboot fails, no problem. It will &#8220;auto-heal&#8221;. (there&#8217;s a buzz word I haven&#8217;t heard in a while!)</p>



<p>There is also no chance of a different package version being installed during a rolling update of many servers (when external repositories are not in your control).</p>



<p>If you need more than one image (if you have many different workloads on your servers then don&#8217;t put everything into one image!), it&#8217;s pretty simple to have a single &#8220;base image&#8221; and many specialized images built from that.</p>



<h2 class="wp-block-heading">What could be better?</h2>



<ul class="wp-block-list">
<li>Updates require a reboot.. for any update, any package install.</li>



<li>There is still possibility for configuration drift in /etc</li>



<li>Initial install can be difficult.</li>



<li>Can&#8217;t easily add extra (non-root) disk (via the Dockerfile/Containerfile).</li>



<li>Some packages can&#8217;t be installed into a Container.</li>



<li>No release notes or changelog to see what packages change.</li>



<li>Day 2 configuration changes are somewhat painful. Redeploying the entire OS isn&#8217;t great if you want to be truly immutable.</li>



<li>Ansible doesn&#8217;t detect a bootc server any different from a normal RHEL or Fedora installation. But trying to install a package on a bootc server will obviously fail the Ansible Playbook. This makes re-using Ansible Roles difficult.</li>



<li>Simple things like user management are not simple considering <a href="https://containers.github.io/bootc/building/users-and-groups.html">issues with drift</a>. This means using <a href="https://ryandaniels.ca/blog/ansible-user-management/">Ansible for User Management</a> doesn&#8217;t really make sense anymore.</li>



<li>Advanced automatic update mechanism not included, like rolling updates of a 5 node cluster.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p>I think bootc has the potential for amazing things in 2025 (and beyond). An Atomic server OS that scales. Even with the above somewhat long list of needed improvements, I&#8217;m still very excited. Is it too early to start using Bootable Containers in production? I don&#8217;t think so.</p>



<p></p>
<p>The post <a href="https://ryandaniels.ca/blog/bootc-bootable-containers-one-container-image-to-rule-them-all/">bootc (Bootable Containers): One Container Image to rule them all</a> appeared first on <a href="https://ryandaniels.ca/">Ryan Daniels</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4319</post-id>	</item>
		<item>
		<title>Docker and Trouble with Red Hat Enterprise Linux 9: iptables</title>
		<link>https://ryandaniels.ca/blog/docker-and-trouble-with-red-hat-enterprise-linux-9-iptables/</link>
		
		<dc:creator><![CDATA[Ryan Daniels]]></dc:creator>
		<pubDate>Sun, 19 Mar 2023 19:18:17 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RHEL]]></category>
		<guid isPermaLink="false">https://ryandaniels.ca/?p=2846</guid>

					<description><![CDATA[<p>Red Hat Enterprise Linux 9 (RHEL 9) and Docker don't get along very well. Running a container that requires older iptables (and not nftables) can be a problem.</p>
<p>The post <a href="https://ryandaniels.ca/blog/docker-and-trouble-with-red-hat-enterprise-linux-9-iptables/">Docker and Trouble with Red Hat Enterprise Linux 9: iptables</a> appeared first on <a href="https://ryandaniels.ca/">Ryan Daniels</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Red Hat Enterprise Linux 9 (RHEL 9) and Docker don&#8217;t get along very well sometimes. It turns out, running a container that requires older iptables (and not nftables) can be a problem.<br>This is a problem for other Operating Systems too that use nftables, but let&#8217;s focus on RHEL 9 today. </p>



<h2 class="wp-block-heading">Problem with running a newer OS (like RHEL 9)</h2>



<p>Wow, RHEL 9 is using a modern kernel and toolchain. Ok, now I can continue.</p>



<p>Some newer Linux Operating Systems are moving away from <a href="https://en.wikipedia.org/wiki/Iptables" target="_blank" rel="noreferrer noopener">iptables</a> and changing to <a href="https://en.wikipedia.org/wiki/Nftables" target="_blank" rel="noreferrer noopener">nftables</a>. This can be a problem when an app is expecting iptables. Normally the OS can load the older iptables, but you can run into problems when running containers. </p>



<h3 class="wp-block-heading">Error from GitLab Runner</h3>



<p>It&#8217;s even more fun trying to figure out what&#8217;s going on when running on a GitLab Runner.</p>



<p>This is the error from a GitLab Runner job:</p>



<pre class="wp-block-code"><code>ERROR: error during connect: Get https://docker:2376/v1.40/info: dial tcp: lookup docker on 8.8.8.8:53: server misbehaving</code></pre>



<h3 class="wp-block-heading">Error when running Docker container</h3>



<p>This is the error when running a container using Docker:</p>



<pre class="wp-block-code"><code># docker run --rm -it --privileged --name dind docker:19.03-dind

...
INFO&#91;2023-03-18T21:03:46.764203869Z] Loading containers: start.                   
WARN&#91;2023-03-18T21:03:46.774269934Z] Running iptables --wait -t nat -L -n failed with message: `iptables v1.8.4 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.`, error: exit status 3 
INFO&#91;2023-03-18T21:03:46.801647539Z] stopping event stream following graceful shutdown  error="&lt;nil&gt;" module=libcontainerd namespace=moby
...
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.8.4 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
 (exit status 3)</code></pre>



<p>So here we can see the problem. Our container is trying to use iptables and it&#8217;s not working.</p>



<p>But, if you run a newer Docker in Docker (DinD) container, it works! And then the old container also starts to work (this is, until a reboot of the host). The culprit? iptables, and a clever trick in newer DinD containers to workaround this issue..</p>



<h2 class="wp-block-heading">Enable iptables from inside a Container</h2>



<p>If you run a container as privileged, you can actually trigger the host OS to load the iptables kernel modules! </p>



<p>This was found from Docker in Docker (DinD) adding a <a href="https://github.com/docker-library/docker/blob/849b56e6c81dc509da780121352f844e8f26bb7a/23.0/cli/modprobe.sh" target="_blank" rel="noreferrer noopener">custom modprobe script</a> (called from the <a href="https://github.com/docker-library/docker/blob/94129ecd12de7acbc9d5a15d25d535ee091770b1/23.0/dind/dockerd-entrypoint.sh#L152" target="_blank" rel="noreferrer noopener">entrypoint script</a>), which is essentially just running this command:</p>



<pre class="wp-block-code"><code># ip link show ip_tables</code></pre>



<p>The Docker in Docker modprobe script gives credit to:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" width="550" height="273" src="https://ryandaniels.ca/wp-content/uploads/2023/02/Luca_Bruno-ip_link_show_module-dark.png" alt="Loading Linux kernel modules the 'alternative' way: 'ip link show $module'. No need for modprobe binary, kernel object files. This fixes the problem with RHEL 9 and iptables with Docker" class="wp-image-2847" srcset="https://ryandaniels.ca/wp-content/uploads/2023/02/Luca_Bruno-ip_link_show_module-dark.png 550w, https://ryandaniels.ca/wp-content/uploads/2023/02/Luca_Bruno-ip_link_show_module-dark-300x149.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></figure></div>


<h2 class="wp-block-heading">Enable iptables on Red Hat Enterprise Linux 9</h2>



<p>But if your container isn&#8217;t using this &#8216;ip link show ip_tables&#8217; trick, the container will have problems. You need to enable the iptables legacy module on your host OS.</p>



<p>To have iptables loaded and ready to go, you can also run the above trick directly on the host. But the &#8220;proper&#8221; way is to use modprobe when the OS boots.</p>



<pre class="wp-block-code"><code># modprobe ip_tables</code></pre>



<p>That will dynamically enable the older iptables. But after a reboot the change is gone, so to make a persistent change:</p>



<pre class="wp-block-code"><code>echo ip_tables &gt; /etc/modules-load.d/ip_tables.conf</code></pre>



<p>Reboot and check:</p>



<pre class="wp-block-code"><code># lsmod|grep -E "^ip_tables|^iptable_filter|^iptable_nat"
ip_tables              28672  0</code></pre>



<p>Now the older containers will also work (that need iptables (legacy).</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Red Hat doesn&#8217;t recommend running Docker (instead they recommend Podman). Probably for these reasons. And I wonder if this problem also has something to do with the underlying and undocumented way that <a href="https://ryandaniels.ca/blog/docker-iptables-input-chain/">Docker uses iptables INPUT chain</a>.</p>
<p>The post <a href="https://ryandaniels.ca/blog/docker-and-trouble-with-red-hat-enterprise-linux-9-iptables/">Docker and Trouble with Red Hat Enterprise Linux 9: iptables</a> appeared first on <a href="https://ryandaniels.ca/">Ryan Daniels</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2846</post-id>	</item>
	</channel>
</rss>
