<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>nomad &amp;mdash; Jerry of the Week</title>
    <link>https://write.in0rdr.ch/tag:nomad</link>
    <description>ˈdʒɛri - Individual who sends life against the grain no matter the consequences</description>
    <pubDate>Fri, 17 Apr 2026 11:03:04 +0000</pubDate>
    <item>
      <title>Nomad authentication with OpenBao</title>
      <link>https://write.in0rdr.ch/nomad-authentication-with-openbao</link>
      <description>&lt;![CDATA[I started to use OpenBao as OpenID connect provider to authenticate my Nomad home lab.&#xA;&#xA;#nomad #openbao #jenkins #homelab&#xA;!--more--&#xA;&#xA;I have two automatic/system jobs that require a Token.&#xA;&#xA;The backup cron job is taking Nomad snapshots in regular intervals. The snapshot API requires a management token and the Nomad policy capability for snapshots with the operator are not implemented yet.&#xA;The Jenkins server runs Nomad jobs using the Nomad cloud plugin. This system needs a Token to access the Nomad API (AppRole not compatible, see below).&#xA;&#xA;I still keep my bootstrapping token around just in case I ever need it. That&#39;s ok unlike to procedures with OpenBao root tokens..&#xA;&#xA;  The bootstrap token can be deleted and is like any other token, care should be taken to not revoke all management tokens.&#xA;&#xA;Name             Type        Global  Accessor ID  Expired&#xA;Bootstrap Token  management  true              false&#xA;Snapshot         management  false             false&#xA;OIDC-vault       client      true              false&#xA;Jenkins          client      false             false&#xA;&#xA;The auth method in Nomad is still called Vault, never mind..&#xA;&#xA;The access for human users is authenticated by an OIDC provider in my OpenBao server.&#xA;&#xA;Because I already had an identity and alias setup (userpass authentication) including a group, I only needed to configure the provider and the assignment to the group to allow authentication with the new provider.&#xA;&#xA;In the OpenBao server, the default provider and the allowall assignment cannot be deleted. I assume it is similar to the “master” realm in a Keycloak instance 🤔.&#xA;&#xA;bao-openidconnect-vault.svg&#xA;&#xA;I had to define a NOMADTOKEN as “Jenkins credential”, because the Nomad cloud plugin for Jenkins cannot read secrets from OpenBao using an AppRole (the Nomad jobs spawned by the plugin can do this, just not the plugin itself).&#xA;&#xA;When I type nomad login in the shell, the browser opens and I can authenticate with OpenBao. What could be improved is outputting the OIDC redirect URI in the terminal. This is helpful when you need to login from disconnected machines (i.e., not the shell on your local machine).&#xA;&#xA;div style=&#34;text-align:center; font-size: 0.8em&#34;&#xD;&#xA;a href=&#34;https://write.in0rdr.ch/feed&#34;&amp;#128732; RSS/a | a href=&#34;https://m.in0rdr.ch/in0rdr&#34;&amp;#128024; Fediverse/a | a href=&#34;https://chat.in0rdr.ch/#/guest?join=p0c@conference.in0rdr.ch&#34;&amp;#128172; XMPP/a&#xD;&#xA;/div]]&gt;</description>
      <content:encoded><![CDATA[<p>I started to use <a href="https://openbao.org/docs/secrets/identity/oidc-provider">OpenBao as OpenID connect provider</a> to authenticate my Nomad home lab.</p>

<p><a href="https://write.in0rdr.ch/tag:nomad" class="hashtag"><span>#</span><span class="p-category">nomad</span></a> <a href="https://write.in0rdr.ch/tag:openbao" class="hashtag"><span>#</span><span class="p-category">openbao</span></a> <a href="https://write.in0rdr.ch/tag:jenkins" class="hashtag"><span>#</span><span class="p-category">jenkins</span></a> <a href="https://write.in0rdr.ch/tag:homelab" class="hashtag"><span>#</span><span class="p-category">homelab</span></a>
</p>

<p>I have two automatic/system jobs that require a Token.</p>
<ul><li>The backup cron job is taking Nomad snapshots in regular intervals. The <a href="https://developer.hashicorp.com/nomad/api-docs/operator/snapshot">snapshot API</a> requires a management token and the <a href="https://github.com/hashicorp/nomad/issues/23614">Nomad policy capability for snapshots with the operator</a> are not implemented yet.</li>
<li>The Jenkins server runs Nomad jobs using the <a href="https://github.com/jenkinsci/nomad-plugin">Nomad cloud plugin</a>. This system needs a Token to access the Nomad API (AppRole not compatible, see below).</li></ul>

<p>I still keep my bootstrapping token around just in case I ever need it. That&#39;s <a href="https://developer.hashicorp.com/nomad/tutorials/archive/access-control-bootstrap">ok</a> unlike to procedures with OpenBao root tokens..</p>

<blockquote><p>The bootstrap token can be deleted and is like any other token, care should be taken to not revoke all management tokens.</p></blockquote>

<pre><code>Name             Type        Global  Accessor ID  Expired
Bootstrap Token  management  true    ***          false
Snapshot         management  false   ***          false
OIDC-vault       client      true    ***          false
Jenkins          client      false   ***          false
</code></pre>

<p>The auth method in Nomad is still called Vault, never mind..</p>

<p>The access for human users is authenticated by an <a href="https://developer.hashicorp.com/nomad/tutorials/archive/sso-oidc-vault">OIDC provider in my OpenBao server</a>.</p>

<p>Because I already had an identity and alias setup (userpass authentication) including a group, I only needed to configure the provider and the assignment to the group to allow authentication with the new provider.</p>

<p>In the OpenBao server, the <a href="https://openbao.org/docs/concepts/oidc-provider/#oidc-providers"><code>default</code> provider</a> and the <a href="https://openbao.org/docs/concepts/oidc-provider/#assignments"><code>allow_all</code> assignment</a> cannot be deleted. I assume it is similar to the “master” realm in a Keycloak instance 🤔.</p>

<p><img src="https://code.in0rdr.ch/pub/blog/bao-openidconnect-vault.svg" alt="bao-openidconnect-vault.svg"></p>

<p>I had to define a <code>NOMAD_TOKEN</code> as “Jenkins credential”, because the Nomad cloud plugin for Jenkins cannot read secrets from OpenBao using an AppRole (the Nomad jobs spawned by the plugin can do this, just not the plugin itself).</p>

<p>When I type <code>nomad login</code> in the shell, the browser opens and I can authenticate with OpenBao. What could be improved is outputting the OIDC redirect URI in the terminal. This is helpful when you need to login from disconnected machines (i.e., not the shell on your local machine).</p>

<div style="text-align:center; font-size: 0.8em">
<a href="https://write.in0rdr.ch/feed">🛜 RSS</a> | <a href="https://m.in0rdr.ch/in0rdr">🐘 Fediverse</a> | <a href="https://chat.in0rdr.ch/#/guest?join=p0c@conference.in0rdr.ch">💬 XMPP</a>
</div>
]]></content:encoded>
      <guid>https://write.in0rdr.ch/nomad-authentication-with-openbao</guid>
      <pubDate>Sat, 15 Nov 2025 20:22:29 +0000</pubDate>
    </item>
    <item>
      <title>Jenkins works</title>
      <link>https://write.in0rdr.ch/jenkins-works</link>
      <description>&lt;![CDATA[I was dabbling around with Jenkins in my Nomad cluster lately. In this post I quickly share my experiences and what I learned along the way.&#xA;&#xA;#cicd #coding #jenkins #nomad&#xA;!--more--&#xA;&#xA;You may ask why I spend time to setup a good old Jenkins while everyone else seems to jump on some newer CI systems (GitLab, Forgejo, etc.)? Well, as said, it&#39;s still good old Jenkins and I assume it will be around for some more time.&#xA;&#xA;To run Jenkins agents on a Nomad cluster I followed Ola Ogunseghas instructions and example code here:&#xA;&#xA;https://faun.pub/jenkins-build-agents-on-nomad-workers-626b0df4fc57&#xA;https://github.com/GastroGee/jenkins-nomad/blob/main/jenkins-controller/nomad.yaml&#xA;&#xA;It involves installing the Nomad plugin for Jenkins and configuring this &#34;Nomad cloud&#34; (that&#39;s how the integration is called in Jenkins) with a template for the Jenkins agents.&#xA;&#xA;Obviously, I wanted to integrate Jenkins with my Git repos. The most straight forward way seemed to use post-receive hooks to nudge Jenkins on every push. This has worked fabulously so far.&#xA;&#xA;Even though the runners are spawned as Nomad jobs, I still wanted to run other Docker containers in the pipeline. This is where it got very confusing for me, because of the different Docker plugins for Jenkins. Most notably, there exist at least these two plugins:&#xA;&#xA;docker-workflow, runs the Docker container from the Jenkins agent&#xA;docker-plugin, runs Jenkins agents as Docker containers&#xA;&#xA;I decided to go with the former &#34;docker-workflow&#34; plugin because I already deployed the Jenkins agents as Nomad jobs. docker-workflow can run arbitrary containers from any Docker image, whereas the docker-plugin needs to be based on the Jenkins inbound-agent image to be able to connect to the Jenkins server.&#xA;&#xA;I wanted the containers that are launched from Jenkins to be contained in a another users namespace. There exists the option to rebuild the inbound-agent with user-supplied attributes for uid/gid, but since I wanted to modify the image anyways I simply forked and built my own agent images, mostly inspired by the example for running Docker inside the agent.&#xA;&#xA;At this stage, my tooling was sophisticated enough I could run a simple gitleaks container on each push to scan for secrets. I&#39;m always afraid to publish secrets accidentally (it happened to me before).&#xA;&#xA;Furthermore, I needed to establish some kind of build process, so I can also build images with Jenkins and directly push them to my local image registry. After some reading, I discarded the thought to use Kaniko because it still requires nodes in the native architecture of the respective build for multi-architecture builds.&#xA;&#xA;Therefore, I followed RedHat best-practices to integrate Buildah, which is also the tool I use to build multi-arch container images locally on my laptop.&#xA;&#xA;If you are interested in more example code, here the link to some of the key components:&#xA;&#xA;jenkins.yaml.tmpl.html Jenkins infrastructure code&#xA;jenkins.nomad.html Jenkins nomad job&#xA;docker-agent Modified Jenkins inbound-agent with Docker and Buildah&#xA;&#xA;I&#39;m not finished with playing around, because I still haven&#39;t figured out some things fully yet (e.g., how to properly use jlink in multi-arch builds) and because I&#39;m also curious how other members of the community use Jenkins on Nomad.&#xA;&#xA;div style=&#34;text-align:center; font-size: 0.8em&#34;&#xD;&#xA;a href=&#34;https://write.in0rdr.ch/feed&#34;&amp;#128732; RSS/a | a href=&#34;https://m.in0rdr.ch/in0rdr&#34;&amp;#128024; Fediverse/a | a href=&#34;https://chat.in0rdr.ch/#/guest?join=p0c@conference.in0rdr.ch&#34;&amp;#128172; XMPP/a&#xD;&#xA;/div]]&gt;</description>
      <content:encoded><![CDATA[<p>I was dabbling around with Jenkins in my Nomad cluster lately. In this post I quickly share my experiences and what I learned along the way.</p>

<p><a href="https://write.in0rdr.ch/tag:cicd" class="hashtag"><span>#</span><span class="p-category">cicd</span></a> <a href="https://write.in0rdr.ch/tag:coding" class="hashtag"><span>#</span><span class="p-category">coding</span></a> <a href="https://write.in0rdr.ch/tag:jenkins" class="hashtag"><span>#</span><span class="p-category">jenkins</span></a> <a href="https://write.in0rdr.ch/tag:nomad" class="hashtag"><span>#</span><span class="p-category">nomad</span></a>
</p>

<p>You may ask why I spend time to setup a good old Jenkins while everyone else seems to jump on some newer CI systems (GitLab, Forgejo, etc.)? Well, as said, it&#39;s still good old Jenkins and I assume it will be around for some more time.</p>

<p>To run Jenkins agents on a Nomad cluster I followed Ola Ogunseghas instructions and example code here:</p>
<ul><li><a href="https://faun.pub/jenkins-build-agents-on-nomad-workers-626b0df4fc57">https://faun.pub/jenkins-build-agents-on-nomad-workers-626b0df4fc57</a></li>
<li><a href="https://github.com/GastroGee/jenkins-nomad/blob/main/jenkins-controller/nomad.yaml">https://github.com/GastroGee/jenkins-nomad/blob/main/jenkins-controller/nomad.yaml</a></li></ul>

<p>It involves installing the <a href="https://plugins.jenkins.io/nomad">Nomad plugin for Jenkins</a> and configuring this “Nomad cloud” (that&#39;s how the integration is called in Jenkins) with a template for the Jenkins agents.</p>

<p>Obviously, I wanted to integrate Jenkins with my <a href="https://code.in0rdr.ch">Git repos</a>. The most straight forward way seemed to use <a href="https://plugins.jenkins.io/git/#plugin-content-push-notification-from-repository">post-receive hooks</a> to nudge Jenkins on every push. This has worked fabulously so far.</p>

<p>Even though the runners are spawned as Nomad jobs, I still wanted to run other Docker containers in the pipeline. This is where it got very confusing for me, because of the different Docker plugins for Jenkins. Most notably, there exist at least these two plugins:</p>
<ul><li><a href="https://plugins.jenkins.io/docker-workflow">docker-workflow</a>, runs the Docker container from the Jenkins agent</li>
<li><a href="https://plugins.jenkins.io/docker-plugin">docker-plugin</a>, runs Jenkins agents as Docker containers</li></ul>

<p>I decided to go with the former “docker-workflow” plugin because I already deployed the Jenkins agents as Nomad jobs. <code>docker-workflow</code> can run arbitrary containers from any Docker image, whereas the <code>docker-plugin</code> needs to be based on the <a href="https://hub.docker.com/r/jenkins/inbound-agent">Jenkins <code>inbound-agent</code> image</a> to be able to connect to the Jenkins server.</p>

<p>I wanted the containers that are launched from Jenkins to be contained in a another users namespace. There exists the option to rebuild the <code>inbound-agent</code> with user-supplied attributes for uid/gid, but since I wanted to modify the image anyways I simply forked and <a href="https://github.com/jenkinsci/docker-agent/compare/master...in0rdr:docker-agent:debug/podman_x86_64?diff=unified">built my own agent</a> images, mostly inspired by the <a href="https://github.com/jenkinsci/docker-inbound-agents/blob/master/docker/Dockerfile">example for running Docker</a> inside the agent.</p>

<p>At this stage, my tooling was sophisticated enough I could run a simple <a href="https://gitleaks.io/">gitleaks</a> container on each push to scan for secrets. I&#39;m always afraid to publish secrets accidentally (it happened to me before).</p>

<p>Furthermore, I needed to establish some kind of build process, so I can also build images with Jenkins and directly push them to my local image registry. After some reading, I discarded the thought to use Kaniko because it still requires nodes in the native architecture of the respective build for <a href="https://github.com/GoogleContainerTools/kaniko?tab=readme-ov-file#creating-multi-arch-container-manifests-using-kaniko-and-manifest-tool">multi-architecture builds</a>.</p>

<p>Therefore, I followed RedHat <a href="https://developers.redhat.com/blog/2019/08/14/best-practices-for-running-buildah-in-a-container">best-practices</a> to integrate Buildah, which is also the tool I use to build multi-arch container images locally on my laptop.</p>

<p>If you are interested in more example code, here the link to some of the key components:</p>
<ul><li><a href="https://code.in0rdr.ch/nomad/file/hcl/default/jenkins/templates/jenkins.yaml.tmpl.html">jenkins.yaml.tmpl.html</a> Jenkins infrastructure code</li>
<li><a href="https://code.in0rdr.ch/nomad/file/hcl/default/jenkins/jenkins.nomad.html">jenkins.nomad.html</a> Jenkins nomad job</li>
<li><a href="https://code.in0rdr.ch/nomad/file/docker/docker-jenkins-inbound-agent/Dockerfile.html">docker-agent</a> Modified Jenkins inbound-agent with Docker and Buildah</li></ul>

<p>I&#39;m not finished with playing around, because I still haven&#39;t figured out some things fully yet (e.g., how to properly use <a href="https://community.jenkins.io/t/usage-of-jlink-in-jenkinsci-docker-agent/15456">jlink in multi-arch builds</a>) and because I&#39;m also curious <a href="https://discuss.hashicorp.com/t/jenkins-nomad-plugin/67020">how other members of the community use Jenkins on Nomad</a>.</p>

<div style="text-align:center; font-size: 0.8em">
<a href="https://write.in0rdr.ch/feed">🛜 RSS</a> | <a href="https://m.in0rdr.ch/in0rdr">🐘 Fediverse</a> | <a href="https://chat.in0rdr.ch/#/guest?join=p0c@conference.in0rdr.ch">💬 XMPP</a>
</div>
]]></content:encoded>
      <guid>https://write.in0rdr.ch/jenkins-works</guid>
      <pubDate>Sun, 09 Jun 2024 19:32:05 +0000</pubDate>
    </item>
  </channel>
</rss>