<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jake C</title>
    <description>The latest articles on DEV Community by Jake C (@greedykomdodragon).</description>
    <link>https://dev.to/greedykomdodragon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2437670%2Ffd5f52f4-e92f-4774-959d-aafea39be266.jpg</url>
      <title>DEV Community: Jake C</title>
      <link>https://dev.to/greedykomdodragon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/greedykomdodragon"/>
    <language>en</language>
    <item>
      <title>Kontroler: "DogFood" Testing</title>
      <dc:creator>Jake C</dc:creator>
      <pubDate>Sun, 19 Jan 2025 22:07:23 +0000</pubDate>
      <link>https://dev.to/greedykomdodragon/kontroler-dogfood-testing-2m5a</link>
      <guid>https://dev.to/greedykomdodragon/kontroler-dogfood-testing-2m5a</guid>
      <description>&lt;p&gt;Kontroler my latest project that’s all about workflows and now self-testing! At its core, it’s a workflow orchestration tool, but what sets it apart is how with some additional components we can being to "dogfood" the tool. In plain terms, it uses its own features to test its functionality, proving it works while continually improving itself. Pretty neat, right?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why aim for Self-Testing the tool?
&lt;/h2&gt;

&lt;p&gt;I’ve always loved automation. It’s the secret sauce behind smooth CI pipelines, quick deployments, and less developer frustration. But when I set out to build Kontroler, I didn’t just want another tool that runs workflows. I wanted something that could prove it works — without relying on third-party testing tools.&lt;/p&gt;

&lt;p&gt;That’s where self-testing came in. It’s like giving the tool a built-in stress test. If it can handle its own workflows without breaking, you know it has some foundation we can build upon. Watching it tackle quality control all on its own is both practical and kind of satisfying.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Kontroler Tests Itself
&lt;/h2&gt;

&lt;p&gt;To get Kontroler to self-test it required building some additional components. Two new services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A GitHub webhook listener to handling the incoming webhooks, read the infra directory and create both the Dag &amp;amp; DagRun.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Kontroler webhook listener to handling outgoing events from kontroler. Kontroler can provide webhooks to listen for when a task ends, providing information such as the status and the task it links to.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As mentioned, a new directory was added to the repo called &lt;code&gt;.kontrolerci&lt;/code&gt; that contains some yaml files that determine how the Dag/CI pipeline will work. Here is an example of how to create a simple go builder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;build-server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;golang:1.23.5-bullseye&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;echo "Navigating to server directory"&lt;/span&gt;
    &lt;span class="s"&gt;cd server&lt;/span&gt;
    &lt;span class="s"&gt;go mod tidy&lt;/span&gt;
    &lt;span class="s"&gt;echo "Building server application"&lt;/span&gt;
    &lt;span class="s"&gt;go build -o main cmd/main.go&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to see the full directory go to the repo at: &lt;a href="https://github.com/GreedyKomodoDragon/Kontroler" rel="noopener noreferrer"&gt;https://github.com/GreedyKomodoDragon/Kontroler&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What does it test?
&lt;/h2&gt;

&lt;p&gt;Currently the pipeline covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installing Packages (npm, Go)&lt;/li&gt;
&lt;li&gt;Linting (Go)&lt;/li&gt;
&lt;li&gt;Unit testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tests help provide confidence in the system, and the fact the CI pipeline ran also provides a end to end test to show Kontroler is correctly allocating tasks and outputing the webhooks when required.&lt;/p&gt;

&lt;p&gt;This is what it looks like within Github's UI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tqqijjchi9a3ogmhxap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8tqqijjchi9a3ogmhxap.png" alt="Screenshot of Github Events" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fun (and Frustration) of Dogfooding
&lt;/h2&gt;

&lt;p&gt;The first time it managed to get the whole way through the pipeline was a magically moment, seeing all those green ticks was more satisfying than I imagined it would be. Kontroler was really being used, even if it was just myself using it.&lt;/p&gt;

&lt;p&gt;But, let’s be real, building something that tests itself isn’t sunshine and rainbows. There were so many issues and bugs I came across. Like trying to understanding why my client was no longer authenticating to kontroler, or why if I put something into the tmp folder the pods started exiting with errors.&lt;/p&gt;

&lt;p&gt;But by dogfooding the tool I can now see the flaws in the tool and begin to fix them!&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next for Kontroler?
&lt;/h2&gt;

&lt;p&gt;There are so many things to fix &amp;amp; add thanks to dogfooding the tool, we are aiming to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow podTemplate to be overidden at runtime, adds more flexibility to the tool which a workflow like a CI pipeline needs&lt;/li&gt;
&lt;li&gt;Provide functionality to create PVCs within the DagRun CRD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will continue to "dogfood" the tool and use it to further productionize the tool!&lt;/p&gt;

</description>
      <category>go</category>
      <category>tooling</category>
      <category>kubernetes</category>
      <category>testing</category>
    </item>
    <item>
      <title>Introducing Kontroler: A Kubernetes Scheduling Engine for DAGs</title>
      <dc:creator>Jake C</dc:creator>
      <pubDate>Thu, 21 Nov 2024 16:14:32 +0000</pubDate>
      <link>https://dev.to/greedykomdodragon/introducing-kontroler-a-kubernetes-scheduling-engine-for-dags-2h5m</link>
      <guid>https://dev.to/greedykomdodragon/introducing-kontroler-a-kubernetes-scheduling-engine-for-dags-2h5m</guid>
      <description>&lt;h2&gt;
  
  
  What is Kontroler?
&lt;/h2&gt;

&lt;p&gt;Kontroler is an open-source Kubernetes scheduling engine designed to simplify the management of Directed Acyclic Graphs (DAGs). With Kontroler, you can define workflows in YAML, run tasks as containerized jobs, and even visualize them through an optional web-based UI. Whether you need to execute workflows on a schedule or respond to real-time events, Kontroler offers a flexible, Kubernetes-native solution.&lt;/p&gt;

&lt;p&gt;That said, I must caveat that Kontroler is currently in its alpha state. It is ideal for experimentation and prototyping but may not yet be ready for production use. As a side project, Kontroler does not come with support, so use it in production at your own risk!&lt;/p&gt;

&lt;p&gt;If you'd like to check out the GitHub repository, here it is: &lt;a href="https://github.com/GreedyKomodoDragon/Kontroler" rel="noopener noreferrer"&gt;https://github.com/GreedyKomodoDragon/Kontroler&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use Kontroler?
&lt;/h2&gt;

&lt;p&gt;Managing workflows on Kubernetes can be challenging. While Kubernetes offers powerful primitives like CronJobs and Jobs, coordinating complex workflows with dependencies, retries, and dynamic triggers often requires custom scripts or external tools. Kontroler simplifies this process by providing a Kubernetes-native solution to define, schedule, and manage workflows as Directed Acyclic Graphs (DAGs).&lt;/p&gt;

&lt;p&gt;Here’s what makes Kontroler stand out:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Gitops DAG Management with YAML
&lt;/h3&gt;

&lt;p&gt;Kontroler enables you to define your entire workflow—including tasks, dependencies, retry logic, and conditional execution—using straightforward YAML files. This approach keeps your workflows declarative, version-controlled, and easy to share across teams.&lt;/p&gt;

&lt;p&gt;Wrap them in a Helm chart and use an automated deployment system such as ArgoCD or FluxCD, and you’ve got your DAGs managed within a GitOps workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Supports Event-Driven and Scheduled Workflows
&lt;/h3&gt;

&lt;p&gt;Whether you need workflows to run on a regular schedule (like CronJobs) or react to real-time triggers (such as a message from a queue), Kontroler has you covered. It seamlessly integrates both scheduling paradigms, making it versatile for a wide range of use cases.&lt;/p&gt;

&lt;p&gt;Kontroler operates using DagRuns (a Custom Resource Definition, or CRD, that Kontroler can monitor). To execute a DAG run, you simply create a DagRun, and Kontroler manages the execution. By exposing this functionality outside the controller, Kontroler allows seamless integration with external systems. See an example of a DagRun below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kontroler.greedykomodo/v1alpha1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DagRun&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app.kubernetes.io/name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dagrun&lt;/span&gt;
    &lt;span class="na"&gt;app.kubernetes.io/instance&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dagrun-sample&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dagrun-sample&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;dagName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dag-sample&lt;/span&gt;
  &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;first&lt;/span&gt;
      &lt;span class="na"&gt;fromSecret&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;secret-name-new&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;second&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;value_new&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You simply provide the name of the DAG, optionally including any parameters. Parameters will use their default values if none are specified.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Integrates Seamlessly with Containers
&lt;/h3&gt;

&lt;p&gt;As a Kubernetes-native application, Kontroler leverages the platform’s advantages. From simple scripts to complex applications, Kontroler’s container-first design ensures that any workload can be easily integrated into a DAG.&lt;/p&gt;

&lt;p&gt;To further reduce duplication of effort, we are adding support for Tasks as CRDs.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Offers Optional UI for Better Visibility
&lt;/h3&gt;

&lt;p&gt;While YAML is excellent for infrastructure as code, visualizing workflows and tracking their execution can significantly simplify debugging and optimization. Kontroler offers an optional web-based UI for creating and monitoring DAGs, providing teams with an intuitive way to manage workflows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsgax0i1f4n44pbrdlyi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsgax0i1f4n44pbrdlyi.png" alt="Screenshot of the Graphs/DAGs shown in Kontroller" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the screenshot above it shows you the:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connections between tasks&lt;/li&gt;
&lt;li&gt;In a DagRun it will show the status&lt;/li&gt;
&lt;li&gt;Pod Outcomes if you click on the network&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under the hood, this functionality is powered by vis-network, an open-source project for creating graphs. You can find their GitHub repository &lt;a href="https://github.com/visjs/vis-network" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Initially, we developed our own graphing tool but found it difficult to scale and challenging to make complex graphs readable. As a result, we adopted this open-source solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Flexible Pod Templates for Advanced Configurations
&lt;/h3&gt;

&lt;p&gt;Kontroler’s pod templates let you customize your tasks with advanced Kubernetes features like secrets, PVCs, node affinity, security contexts, and more. This gives you fine-grained control over how tasks are executed, ensuring compatibility with your cluster's specific requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flexibility of Datastores
&lt;/h2&gt;

&lt;p&gt;One of the key challenges in managing workflows is ensuring that the underlying infrastructure can scale with your needs. Kontroler offers flexible database support and logging capabilities to make it easier for teams to manage DAGs and capture detailed execution logs. Whether you're working with a lightweight setup or a more robust production environment, Kontroler has options that can fit your needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  SQLite (Default + Small Scale)
&lt;/h3&gt;

&lt;p&gt;For smaller setups or during development, SQLite is the default database used by Kontroler. It’s simple, lightweight, and doesn’t require much configuration. If you’re just getting started or running Kontroler for testing purposes, SQLite is a convenient choice as it works "out-of-the-box" with no additional database setup.&lt;/p&gt;

&lt;p&gt;If you prefer to use SQLite, you don’t need to make any additional changes to the deployment. Just follow the installation instructions, and Kontroler will handle the rest.&lt;/p&gt;

&lt;h3&gt;
  
  
  PostgreSQL (For Production/Large Scale)
&lt;/h3&gt;

&lt;p&gt;For larger, production-grade deployments, PostgreSQL is the recommended database for storing DAGs and DagRuns. Kontroler uses PostgreSQL to provide higher performance, scalability, and reliability needed for handling large volumes of workflow data. Kontroler is compatible with PostgreSQL 16 and above&lt;/p&gt;

&lt;h2&gt;
  
  
  Log Collection
&lt;/h2&gt;

&lt;p&gt;For many Kubernetes users, centralized log storage is a crucial requirement for observability and troubleshooting. Kontroler integrates seamlessly with Amazon S3 for log storage, making it easy to collect, store, and analyze logs from DAG executions. This integration ensures that you can capture detailed logs, keep them long-term for auditing, and use them for post-mortem analysis when something goes wrong.&lt;/p&gt;

&lt;p&gt;We are testing with MinIO to avoid costs, but under the hood, it uses the AWS S3 API and should be able to detect your IAM attributes to grant access to your S3 buckets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Remarks
&lt;/h2&gt;

&lt;p&gt;We hope you’ll check out Kontroler! You can find it here: &lt;a href="https://github.com/GreedyKomodoDragon/Kontroler" rel="noopener noreferrer"&gt;https://github.com/GreedyKomodoDragon/Kontroler&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Although still in alpha, Kontroler has significant potential for teams looking to streamline their Kubernetes operations. As it evolves, Kontroler aims to become a powerful tool for orchestrating workflows in Kubernetes, delivering the reliability and scalability teams need to automate complex processes with ease.&lt;/p&gt;

&lt;p&gt;Kontroler is constantly improving, so keep an eye out for future updates! If you’d like to contribute to the project, we welcome all forms of contributions.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>docker</category>
      <category>go</category>
    </item>
  </channel>
</rss>
