service-1.6.0
2 minute read
KOSI Plugin service Version 1.6.0
Summary
With the service plugin you can start, stop, restart and display the current status of a system service.
It is based on the console command systemctl
.
Keys
Key | Description | |
---|---|---|
name | Mandatory | Set the name of the service |
status | Mandatory | Set the command you want to execute on the service. Supported commands: - start to start the service. stop to stop the service. restart to restart the service. status to show the current status of the service. |
sudo | true/false | If it is set to true, the Plugin will be execute with sudo privileges. |
sudoPassword | - | If you set sudo true, sudoPassword is mandatory. |
Usage
Example 1 - start service
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
{
service(name="httpd"; state="start";sudo="true";sudoPassword="Drowssap");
}
Example 2 - stop service
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
{
service(name="httpd"; state="stop";sudo="true";sudoPassword="Drowssap");
}
Example 3 - restart service
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
{
service(name="httpd"; state="restart";sudo="true";sudoPassword="Drowssap");
}
Example 4 - show status of the service
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
{
service(name="httpd"; state="status";sudo="true";sudoPassword="Drowssap");
}