kosi-0.4.3

KOSI Plugin kosi Version 0.4.3

Changelog KOSI Plugin 0.4.3

New

  • Added pull command to plugin

Update

  • Update dependencies from kosi

Changelog KOSI Plugin 0.2.6

Update

  • Update dependencies from kosi

Summary

The kosi plugin provides a means to use features of kosi within a kosi plugin.
With the kosi plugin you can automatically log in to your hub, pull packages and install them. The kosi plugin currently supports these kosi features:

  • login
  • install
  • delete
  • update
  • pull

Keys

Depending on which operating mode you use, you have to set one of the following keys.

Key Default value Description
command Mandatory - Set this key to the KOSI command you want to execute.
userVar Mandatory - Set this key to your user name.
passwordVar Mandatory - Set this key to your password in plain text.
sourcePath Mandatory - Set this key to the name of the package you want to install.
sourceRegistry Mandatory - Set this key to the registry you want to download the images of the package from.
deploymentName Optional Name of the package Set this key to the name that the installed package has in the cluster. A deploymentName will be set automatically if you don’ t set it in the package.yaml. The deploymentName is important for upadating a package.
nameSpace Optional “default” Set this key to the name of the namespace you want to deploy the package into.
userHub Mandatory - Set this key to the user-hub you want to access.
packageName Mandatory - Set this key to the name of the package you want to install.
packageDestinationPath Mandatory save location Set this key to set your save location of your package
destinationRegistry Optional - Set this key to set the destination registry for your pulled image in your package, if retag is set true
targetRegistry Optional - Set this key to set the target registry for your pulled image in your deployment inside the package, if retag is set true
retag Optional “true”/“false” Set this key to set retag flag for your pull process
values Optional, list - This list is equivalent to the -f option of the KOSI CLI.

Features

Login

Login enables you to log in to your KubeOps user account. This is required to upload packages to a hub and to download packages from a private hub.
Both the username and password must be entered in plain text in package.yaml.

Install

The install command can be used to download and install packages from any registry. If this is a public package you have to set your userHub to “public”. Otherwise you have to set the userHub, where the package is located. In addition, the namespace in which the package is to be installed can be specified and the name of the deployed package in the cluster can be changed.

Update

The update command updates an already installed KOSI package. For update, the installation and the update package have to be the same name. Update will be defined in the package.yaml (example 3 - Update). If this is a public package you have to set your userHub to “public”. Otherwise you have to set the userHub, where the package is located

Delete

The delete command can be used to delete packages from any registry. The command delete expected parameters like sourcePath, sourceRegistry and deploymentName, which are also marked as required. If this is a public package you have to set your userHub to “public”. Otherwise you have to set the userHub, where the package is located

The namespace parameter can be used to specify the name of the package to be deleted.

Pull

The pull command can be used to pull packages from any registry. The command pull expected parameters like packageName, packageDestinationPath and userHub, which are also marked as mandatory. If you want to pull your images in your own registry you can use the destinationRegistry parameter. If you want to pull your images in your own registry and change your deployment automatically you can use destinationRegistry and targetRegistry. In both scenarios you have to use the retag parameter.

Examples

Example 1 - Login

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/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
{
    kosi(command='"login"'; userVar='"exampleUser"';passwordVar='"examplePW"';hub='"http://hub.kubernative.net/dispatcher/ ");
}

Example 2 - Install

tasks: 
  - kosi:
      command: "install"
      sourcePath: "kosi/kubeops-kubernetes-plugins:0.0.1"  #mandatory
      sourceRegistry: "registry1.kubernative.net"          #mandatory
      deploymentName: "kubernetes-plugins"                 #optional
      hub: http://hub.kubernative.net/dispatcher/          #mandatory
      nameSpace: "kosi"                                    #optional
      values:                                              #optional
        - "values.yaml"
      userHub: "public"                                    #mandatory
      local: false                                         #flag for local or remote package

Example 3 - Install local package

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/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
{
    kosi(command='"install"'; sourcePath='"/root/kosi-test/package.kosi"';sourceRegistry='"registry1.kubernative.net"';deploymentName='"kubernetes-plugins"';hub='"http://hub.kubernative.net/dispatcher/"';namespace='"kosi"';values='"["values.yaml"]"';userHub='"public"';local='"true"';);
}

Example 4 - Update

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/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
{
    kosi(command='"update"'; sourcePath='"/root/kosi-test/package.kosi"';sourceRegistry='"registry1.kubernative.net"';deploymentName='"kubernetes-plugins"';hub='"http://hub.kubernative.net/dispatcher/"';namespace='"kosi"';values='"["values.yaml"]"';userHub='"public"';local='"true"';);
}

Example 5 - Delete

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/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
{
    kosi(command='"delete"'; sourcePath='"/root/kosi-test/package.kosi"';sourceRegistry='"registry1.kubernative.net"';deploymentName='"kubernetes-plugins"';hub='"http://hub.kubernative.net/dispatcher/"';namespace='"kosi"';values='"["values.yaml"]"';userHub='"public"';local='"true"';);
}

Example 6 - Pull with retag

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/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
{
    kosi(command='"pull"';hub='"http://hub.kubernative.net/dispatcher/"';packageName='"lima/kubernetes:1.24.7"';packageDestinationPath='"/root/kubernetes-1.24.7/package.kosi" ';destinationRegistry='localhost:5000/myimages"';targetRegistry='"myregistry.net/myimages"';retag='"true"');
}