English / 中文
Salt is a new approach to infrastructure management built on a dynamic communication bus. Salt can be used for data-driven orchestration, remote execution for any infrastructure, configuration management for any app stack, etc.
The SaltStack plugin encapsulates and packages the salt-api according to the specific needs of different scenarios, which reduces the difficulty of using SaltStack. It also provides an API interface that is closer to the business usage scenarios.
As an essential member of the WeCube plugin group, the SaltStack plugin provides WeCube with the ability to manage infrastructure resources. In the meanwhile, the SaltStack plugin can also offer pluggable services for third-party applications.
SaltStack plugin 1.0.0 is now released, its architecture & APIs are as follows:
The SaltStack plugin relies on services such as salt-master
, salt-api
, and httpd
. Based on these services, it encapsulates a layer of APIs for system management and application deployment.
User can perform the following operations through the APIs provided by the plugin:
Please refer to the SaltStack Plugin Development Guide on how to build development environment.
Before executing the following command, please make sure docker command is installed on the CentOS host. Click here to know How to Install Docker.
git clone https://github.com/WeBankPartners/wecube-plugins-saltstack.git
make build
make image
{$HOST_IP}
with your host ip, replace variable {$IMAGE_TAG}
with your image tag, and execute the following command. Port | Comment |
---|---|
9099 | salt-minion install port |
4505 | salt-master pub port |
4506 | salt-master ret port |
4507 | salt plugin instances connect port |
docker run -d --restart=unless-stopped -v /etc/localtime:/etc/localtime -e minion_master_ip={$HOST_IP} -e minion_port=22 -p 9099:80 -p 9090:8080 -p 4505:4505 -p 4506:4506 -p 8082:8082 --privileged=true -v /home/app/data/minions_pki:/etc/salt/pki/master/minions -v /home/app/wecube-plugins-saltstack/logs:/home/app/wecube-plugins-saltstack/logs -v /home/app/data:/home/app/data wecube-plugins-saltstack:{$TAG_NUM}
curl -X POST http://127.0.0.1:8082/v1/deploy/agent/install -H "cache-control: no-cache" -H "content-type: application/json" -d "{\"inputs\":[{\"guid\":\"1234\",\"seed\":\"abc12345\",\"host\":\"127.0.0.1\",\"password\": \"251f54c3f5be75e171ae1eb516dbacd9\"}]}"
salt-minion has been installed on host:127.0.0.1
when you saw the message below:
{
"resultCode": "0",
"resultMessage": "success",
"results": {
"outputs": [
{
"guid": "1234"
}
]
}
}
If you want to build a plugin package to work with Wecube, please execute the following command. You can replace variable {$package_version}
with the version number you want.
make package PLUGIN_VERSION=v{$package_version}
Read more in Build SaltStack Plugin Docker Image Guide.
Please refer to the SaltStack API Guide
SaltStack Plugin is licensed under the Apache License Version 2.0, please refer to the license for details.
For quick response, please open an issue to us, or you can also scan the following QR code to join our community, we will provide feedback as quickly as we can.
Contact us: fintech@webank.com