KOSI Language Reference

This Guide explains the basic Structure of the package.kosi File using the if and cmd Plugins

package.kosi File

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/sina/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files = 
{
  input="template.yaml";
}

containers = 
{
    example=["docker.io", "nginx", "latest"];
}

install 
{
    cmd(command='"echo using if plugin"');
    if(condition='"{{values.firstparam}}<2"')
    then
    {
        cmd(command='"echo using templated values."')
        cmd(command='"echo {{values.firstparam}} is smaller than 2"');
    }
    else
    {
        cmd(command='"echo {{values.firstparam}} is bigger than 2"');
    }
}
More information about each KOSI Plugin and their use can be found here Plugins.

Metadata

There are a few metadata and they are mandatory.

Parameter Description
languageversion KOSI language version specification.
apiversion KOSI package version sepcification.
name Set the name of the package, which will displayed on the hub.
description Set the description of the package, which will displayed on the hub.
version Set the description of the package, which will displayed on the hub.
docs A Tgz with the documentation of the package, which contains Markdown files.
logo A PNG for a logo of the package.
files = 
{
  input="template.yaml";
}

The includes.files element describes the files which are inluded in the KOSI package.

containers = 
{
    example=["docker.io", "nginx", "latest"];
}

The includes.containers element is used for docker images. The methods which are used in the package.

file =
{
  install 
{
    cmd(command='"echo using if plugin"');
    if(condition='"{{values.firstparam}}<2"')
    then
    {
        cmd(command='"echo using templated values."')
        cmd(command='"echo {{values.firstparam}} is smaller than 2"');
    }
    else
    {
        cmd(command='"echo {{values.firstparam}} is bigger than 2"');
    }
}
}

In this section the logic of the used Pulgins is described.

The cmd Plugin is for executing commands in the commandline and the if Plugin is for creating conditions, under which other plugins are executed.

The main used Trees are Install for installing a new package, Update for updating Packages and Uninstall for uninstalling packages.