containerRuntime-1.6.0
6 minute read
KOSI Plugin containerRuntime Version 1.6.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:
Plugin requirements
If you want to use the Plugin containerd you need the following Plugins:
- docker
- crio
- contianerd
Keys
Key | Description | |
---|---|---|
command | Mandatory | Will be the command you want to execute inside the container. |
containerConfig | - | Will be the configuration JSON or YAML for your container creation. For Example: containerConfiguatrion.json or containerConfiguatrion.yaml |
containerName | - | Will be the Container in which your command will be executed. |
destImage | - | Will be the new image name for the tages srcImage. |
execID | - | Will be the ID / Name of your execution.*1 |
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.*2 |
runtime | - | In the value of the key “containerRuntime” in this case “status” the runtime will be stored temporarily.*3 |
srcImage | - | Will be the Image which you want to pull, push or tag. |
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. |
type | - | You can either specify the containerRuntime type via the key “type” or if no type specified the plugin will detect automatically the running containerRuntime.*4 |
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.
Only for containerd
- psTask list all existing task for containerd.
- startTask starts a task from a given container.
- stopTask will be stop a given Task.
- deleteTask will delete a given Task.
podConfig
containerConfig
Will be the configuration JSON or YAML for your pod creation. For Example: podConfiguatrion.json or podConfiguatrion.yaml
*1:Note: Only needed for execution commands with containerd. *2:optional key! For all other keys. *3:Note: optional key! You can store your runtime temporarily. *4:If docker and crio and containerd, or 2 of the specific containerRuntime, are running, docker will be choosen, for containerd and crio it will be containerd.
Example 1 - docker / crio / containerd ps
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio / containerd"; option="ps";flag="--last";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 2 - docker / crio / containerd images
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio / containerd"; option="images";flag="--all";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 3 - docker / containerd run
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio / 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 - crio run
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="crio"; option="run";containerConfig="/root/podConfig.json / .yaml";podConfig="/root/podConfig.json / .yaml";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 5 - docker / crio / containerd status
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio / contianerd"; option="status";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 6 - containerd exec
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="contianerd"; option="exec";execID="exec1";containerName="registry.kubernative.net/lima:v0.8.0";command="mkdir /tmp/testdir";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 7 - docker / crio exec
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio"; option="exec";containerName="registry.kubernative.net/lima:v0.8.0";command="mkdir /tmp/testdir";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 8 - docker / containerd tag
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / containerd"; option="tag";srcImage="registry.kubernative.net/lima:v0.8.0"; destImage="yourRegistry/yourName:v0.8.0";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 9 docker / crio / containerd deleteCon / start / stop
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio / containerd"; option="deleteCon / start / stop";containerName="myFirstContainer";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 10 - docker / crio / containerd pull / push
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="docker / crio / containerd"; option="pull / push";srcImage="registry.kubernative.net/lima:v0.8.0";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Note: Crio does not have the “option” push and tag!
The following Examples are only for containerd runtime!
Example 11 containerd psTask
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="containerd"; option="psTask";flag="--all";runtime="status";sudo="true";sudoPassword="Drowssap");
}
Example 12 containerd startTask / stopTask / deleteTask
languageversion = "1.0.0";
apiversion = "kubernative/kubeops/kosi/user/v4";
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
{
containerRuntime(type="containerd"; option="startTask /stopTask / deleteTask";flag="--null-io";containerName="myFirstTask";runtime="status";sudo="true";sudoPassword="Drowssap");
}