Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iwas-coder/kurama

A simple, blazingly fast, cloud-native job scheduler and orchestrator written in Go.
https://github.com/iwas-coder/kurama

api controller crd crd-controller job-queue job-scheduler kubernetes kubernetes-controller orchestrator

Last synced: 7 days ago
JSON representation

A simple, blazingly fast, cloud-native job scheduler and orchestrator written in Go.

Awesome Lists containing this project

README

        

#+AUTHOR: Wasym A. Alonso
#+TITLE: Kurama (九喇嘛)

#+CAPTION: Kurama logo
[[assets/logo.png]]

# Repository info badges
#+begin_html
GNU GPL v3.0
#+end_html

(...)

# GNU GPLv3+ License notice
#+BEGIN_QUOTE
This work and all its documentation is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License. @@html:
@@
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@html:
@@
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#+END_QUOTE

* Table of Contents :toc:
- [[#architecture][Architecture]]
- [[#controller][Controller]]
- [[#build-binary][Build binary]]
- [[#build-image][Build image]]
- [[#api][API]]
- [[#build-binary-1][Build binary]]
- [[#build-image-1][Build image]]
- [[#ui][UI]]
- [[#build-binary-2][Build binary]]
- [[#build-image-2][Build image]]
- [[#helm-chart][Helm Chart]]
- [[#create][Create]]
- [[#deploy][Deploy]]
- [[#manually][Manually]]
- [[#argo-cd][Argo CD]]
- [[#usage][Usage]]

* Architecture

(...)

* Controller

The Kurama Controller is the main component, where all the Kubernetes recources management logic is located. The package is hosted in the ~./pkg/controller/~ directory.

** Build binary

The ~kurama~ binary can be built with the following command:
#+begin_src sh
$ go build [-v] -o kurama
#+end_src
Some things can be tweaked by using these ENV vars:
- *CGO_ENABLED:* The default is ~1~, which means the resulting binary will be dynamically linked with some system libraries (e.g. ~libc~, etc.). If wanted to build the binary statically, it can be passed a value of ~0~ instead.
- *GOARCH:* Target architecture, defaults to host.
- *GOOS:* Target operating system, defaults to host.

** Build image

To build the container image which will be deployed later to a Kubernetes cluster, execute the following command:
#+begin_src sh
$ buildah build -t kurama
#+end_src
The same variables defined before can be passed in as build args, e.g.:
#+begin_src sh
$ buildah build -t kurama --build-arg="GOARCH=arm64"
#+end_src

This image is hosted here at *GHCR*, specifically under ~ghcr.io/iwas-coder/kurama~, and it's updated regularly.

* API

(...)

** Build binary

(...)

** Build image

(...)

* UI

(...)

** Build binary

(...)

** Build image

(...)

* Helm Chart

** Create

To package the given *Helm Chart* (under the ~chart/~ directory) it's as easy as executing:
#+begin_src sh
$ helm package chart
#+end_src
It will output a compressed archive named ~kurama-.tgz~, which can be used later on as an alternative method to deploy the app.

** Deploy

*** Manually

Kurama is packaged within a *Helm Chart*, whose source code is hosted under the ~chart/~ directory. Thus, can be easily deployed to a cluster by executing the following commands:
#+begin_src sh
$ helm [-n ] upgrade --install [--atomic --create-namespace] kurama oci://ghcr.io/iwas-coder/kurama
#+end_src
The GHCR OCI URL can be replaced by the path to a locally packaged chart (/explained in the section right above/), if preferred.

*** Argo CD

Kurama can also be deployed to a cluster via Argo CD and its declarative approach. This is an example of an Argo CD's ~Application~ resource which deploys Kurama to its own namespace (the ~argo-cd~ namespace should be replaced by its given name when Argo CD was installed):
#+begin_src yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kurama
namespace: argo-cd
finalizers: [resources-finalizer.argocd.argoproj.io]
spec:
project: default
source:
repoURL: https://github.com/iWas-Coder/kurama
targetRevision: HEAD
path: chart
destination:
server: https://kubernetes.default.svc
namespace: kurama
syncPolicy:
syncOptions: [CreateNamespace=true]
automated:
prune: true
selfHeal: true
#+end_src

* Usage

This is a basic definition example of the ~KuramaJob~ custom resource:
#+begin_src yaml
apiVersion: kurama.io/v1
kind: KuramaJob
metadata:
name: hello-world
spec:
steps:
- name: run-echo
command: |
echo "Hello, World!"
#+end_src