containerd-1.4.0

KOSI Plugin containerd Version 1.4.0

Summary

With the containerRunitme Plugin you can manage you containerRuntime. You can use options to ecexute commands with or without flags. Additionally its possible to gather information about the current containerRuntime status. The plugin supports the following usage:

Key Description
command Mandatory Will be the command you want to execute inside the container.
containerName - Will be the Name of the contianer you choose or the Name of the temporarily stored Name of the created cluster.*1
destImage - Will be the new image name for the tages srcImage.
execID - Will be the ID / Name of your execution.*2
flag - The value of the “flag” key stores information on which options you want to enable. You will have to confirm which flag the “option” of your command allows. Examples for ps are “-a or –all” for all or “-n or –last” for last of the list of container, you can append any number of flags, like in example 3.
sudo - Can be true or false. If it is true the Plugin will be executed with sudo privileges.
sudoPassword - If you use, sudoPassword will be mandatory.
srcImage - Will be the Image which you want to pull, push or tag.
option Mandatory Depending on which operation you want to execute select one of these as a variable of the key. Following example 1, if you want to execute a command like run, you take “option” as a key and “run” as a value.

The Values can be followed:

  • ps list all existing container.
  • images lists all existing images.
  • run starts an container.
  • status will be show the state of the containerRuntim like “active”, if the runtime is running.
  • exec will be execute an command within an running Container.
  • tag will be rename the Imagename, for example: docker tag -t Image NewImage
  • pull will be pulling the given Image.
  • push will be pushing the given Image.
  • stop will be stop a given Container.
  • start will be start a given Container.
  • deleteCon will delete a given container.

*1:Note: In the case of containerd, the containers do not have any Name they only have ID’s. The contianerName in this case will be the contianer ID. If startTask, stopTask or deleteTask was selected containerName is treated as name of the task.

*2:Note: Only needed for execution commands with containerd.

Example 1 - containerd ps

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
{
    containerd(option='"ps"'; flag='"--last"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 2 - containerd images

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
{
    containerd(option='"images"'; flag='"--all"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 3 - containerd run

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
{
    containerd(option='"run"'; flag='"-w /path/to/dir/ -i -t"';srcImage='"registry.kubernative.net/lima:v0.8.0"';containerName='"myFirstContainer"';runtime='"status"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 4 - containerd status

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
{
    containerd(option='"status"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 5 - containerd exec

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
{
    containerd(option='"exec"'; execID='"exec1"';containerName='"registry.kubernative.net/lima:v0.8.0"';command='"mkdir /tmp/testdir"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 6 - containerd tag

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
{
    containerd(option='"tag"'; srcImage='"registry.kubernative.net/lima:v0.8.0"';destImage='"yourRegistry/yourName:v0.8.0"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 7 - containerd pull / push

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
{
    containerd(option='"pull/push"'; srcImage='"registry.kubernative.net/lima:v0.8.0"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 8 - containerd deleteCon

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
{
    containerd(option='"deleteCon"'; containerName='"myFirstContainer"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 9 containerd psTask

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
{
    containerd(type='"containerd"'; option='"psTask"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 10 containerd stopTask / startTask / deleteTask

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
{
    containerd(option='"stopTask / startTask / seleteTask"'; containerName='"task1"';sudo='"true"';sudoPassword='"Drowssap"');
}