(…)
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.
(…)
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.
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 of0
instead. - GOARCH: Target architecture, defaults to host.
- GOOS: Target operating system, defaults to host.
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.
(…)
(…)
(…)
(…)
(…)
(…)
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.
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.
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
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!"