<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Containers on Krkn</title><link>https://krkn-chaos.dev/tags/containers/</link><description>Recent content in Containers on Krkn</description><generator>Hugo</generator><language>en</language><atom:link href="https://krkn-chaos.dev/tags/containers/index.xml" rel="self" type="application/rss+xml"/><item><title>Package and Test the Image</title><link>https://krkn-chaos.dev/docs/developers-guide/custom-scenario/package-and-test/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krkn-chaos.dev/docs/developers-guide/custom-scenario/package-and-test/</guid><description>&lt;p>&lt;strong>Starting point:&lt;/strong> the &lt;a href="https://krkn-chaos.dev/docs/developers-guide/custom-scenario/implement-plugin/">plugin methods are implemented&lt;/a>.
&lt;strong>Result:&lt;/strong> a locally tested image that clients can discover through its labels.&lt;/p>
&lt;h2 id="build-the-custom-krkn-base">
 Build the custom Krkn base
 &lt;a class="td-heading-self-link" href="#build-the-custom-krkn-base" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>&lt;code>Dockerfile.base&lt;/code> overlays the local Python package on the published runtime:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-dockerfile" data-lang="dockerfile">&lt;span class="line">&lt;span class="cl">&lt;span class="k">FROM&lt;/span>&lt;span class="s"> quay.io/krkn-chaos/krkn:latest&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="k">COPY&lt;/span> --chown&lt;span class="o">=&lt;/span>krkn:krkn __init__.py &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> /home/krkn/kraken/krkn/scenario_plugins/dev_demo/__init__.py&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="k">COPY&lt;/span> --chown&lt;span class="o">=&lt;/span>krkn:krkn dev_demo_scenario_plugin.py &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> /home/krkn/kraken/krkn/scenario_plugins/dev_demo/dev_demo_scenario_plugin.py&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">podman build &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -f &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$KRKN_DEV_PLUGIN_DIR&lt;/span>&lt;span class="s2">/Dockerfile.base&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -t &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$KRKN_BASE_IMAGE&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="nv">$KRKN_DEV_PLUGIN_DIR&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>

&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Tip: Dockerfile path and build context are different&lt;/h4>

 &lt;code>-f&lt;/code> selects the Dockerfile; the final argument selects the directory available
to its &lt;code>COPY&lt;/code> instructions. &lt;code>-t&lt;/code> assigns a local image name. Keeping both paths
absolute makes this command work from any directory. Nothing is pushed to a
registry at this stage.

&lt;/div>

&lt;p>This build context is the plugin repository. Using Krkn&amp;rsquo;s upstream container
Dockerfile unchanged would clone Krkn from GitHub during the build and omit the
local plugin. If you change the core engine or &lt;code>krkn-lib&lt;/code>, build a runtime that
includes those changes explicitly.&lt;/p></description></item><item><title>Scenario Image Contract</title><link>https://krkn-chaos.dev/docs/developers-guide/krknctl-edits/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krkn-chaos.dev/docs/developers-guide/krknctl-edits/</guid><description>&lt;p>Krknctl and Krkn Operator discover scenario definitions from container image
metadata. To add a custom scenario, publish an image with the expected labels
and configure its registry in the client. You do not need to add the scenario
to krknctl&amp;rsquo;s source code when the existing input types cover its parameters.&lt;/p>
&lt;p>The &lt;a href="https://krkn-chaos.dev/docs/developers-guide/custom-scenario/package-and-test/">packaging lab&lt;/a>
builds this contract without rebuilding krkn-hub. The definitions are implemented
in krknctl&amp;rsquo;s &lt;a href="https://github.com/krkn-chaos/krknctl/blob/main/pkg/typing/field.go">input field parser&lt;/a>
and &lt;a href="https://github.com/krkn-chaos/krknctl/blob/main/pkg/typing/types.go">type validators&lt;/a>.&lt;/p>
&lt;h2 id="image-labels">
 Image labels
 &lt;a class="td-heading-self-link" href="#image-labels" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>&lt;code>krknctl.is_a_scenario&lt;/code>&lt;/strong> identifies scenario images when set to &lt;code>&amp;quot;true&amp;quot;&lt;/code>.&lt;/li>
&lt;li>&lt;strong>&lt;code>krknctl.title&lt;/code>&lt;/strong> and &lt;strong>&lt;code>krknctl.description&lt;/code>&lt;/strong> describe the scenario.&lt;/li>
&lt;li>&lt;strong>&lt;code>krknctl.input_fields&lt;/code>&lt;/strong> contains a JSON array of field descriptors.&lt;/li>
&lt;li>&lt;strong>&lt;code>krknctl.kubeconfig_path&lt;/code>&lt;/strong> appears in the companion image as metadata.
The clients used in this lab do not read it to configure the kubeconfig mount.
Set the &lt;a href="https://krkn-chaos.dev/docs/developers-guide/krknctl-edits/#kubeconfig-mount-path">runtime mount path&lt;/a> independently.&lt;/li>
&lt;li>&lt;strong>&lt;code>krknctl.privileged&lt;/code>&lt;/strong> declares a privilege requirement. It is not an RBAC
grant; actual permissions depend on the client, runtime, and target credentials.&lt;/li>
&lt;li>&lt;strong>&lt;code>krknctl.has_rollback&lt;/code>&lt;/strong> describes rollback capability. Set it to match
implemented behavior, not to indicate an intended future feature.&lt;/li>
&lt;/ul>
&lt;p>The base image can also supply global input labels such as
&lt;code>krknctl.input_fields.global&lt;/code>. Keep scenario-specific fields in the scenario
label rather than copying every framework setting into it.&lt;/p></description></item><item><title>Publishing Through Krkn-hub</title><link>https://krkn-chaos.dev/docs/developers-guide/editing-krkn-hub/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krkn-chaos.dev/docs/developers-guide/editing-krkn-hub/</guid><description>&lt;p>Krkn-hub maintains the community collection of packaged scenario images. Add
your scenario there when you want it distributed through that collection.
The &lt;a href="https://krkn-chaos.dev/docs/developers-guide/custom-scenario/">custom scenario lab&lt;/a> builds and
publishes its own image directly, so it does not require changes to this
repository.&lt;/p>
&lt;p>Before contributing packaging, validate the Python plugin, configuration
template, metadata, and executable startup script. Use the
&lt;a href="https://krkn-chaos.dev/docs/developers-guide/testing-changes/">testing guide&lt;/a> to cover success and
failure paths.&lt;/p>
&lt;h2 id="add-the-scenario-package">
 Add the scenario package
 &lt;a class="td-heading-self-link" href="#add-the-scenario-package" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>Create a scenario directory in
&lt;a href="https://github.com/krkn-chaos/krkn-hub">krkn-hub&lt;/a> using a neighboring scenario
as a reference. A package normally includes:&lt;/p></description></item></channel></rss>