Skip to content

iWas-Coder/kurama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kurama (九喇嘛)

assets/logo.png

GNU GPL v3.0

(…)

This work and all its documentation is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License.
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.
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.

Table of Contents

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:

$  go build [-v] -o kurama

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:

$  buildah build -t kurama

The same variables defined before can be passed in as build args, e.g.:

$  buildah build -t kurama --build-arg="GOARCH=arm64"

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:

$  helm package chart

It will output a compressed archive named kurama-<VERSION>.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:

$  helm [-n <NS>] upgrade --install [--atomic --create-namespace] kurama oci://ghcr.io/iwas-coder/kurama

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):

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

Usage

This is a basic definition example of the KuramaJob custom resource:

apiVersion: kurama.io/v1
kind: KuramaJob
metadata:
  name: hello-world
spec:
  steps:
    - name: run-echo
      command: |
        echo "Hello, World!"