The spire feature allows to control several managers (local managers) from one manager (Spire) via deploy-on feature. The deploy-on feature allows users to deploy services on the discovered environments. The deploy-on feature also provides a means to deploy the same service on multiple environments using a single command. Users can group the environments based on location, tagging and filters.
To install the MAIN Manager (Spire), please refer to the Cloudify official documentation.
You can install a sub-manager in the same way as the main manager (Spire). The most important thing is to make sure that your network is set up correctly (all local managers must be available for Spire Manager).
All actions in this chapter are performed on Spire
In the next step, deploy manager_exposer.yaml with proper inputs:
- cloudify_username - name of submanager user
- endpoint - ip of submanager
- tenant - name of submanagar tenant
- protocol - protocol used by submanager
- port - number of port which submanager is exposed
Upload manager_exposer.yaml to Spire Manager.
Next, click Deploy under the blueprint tile. Instead of this, you can also click on blueprint name and next Create deployment
After that, the following window will appear Fill all neccessary information and click Install button at the bottom of dialog. To make sure if Environment is installed successfully, check Verification of Installation chapter in the following part.
To use Cloudify API, you can refer to official API documentation.
curl -X PUT \
--header "Tenant: default_tenant" \
--header "Content-Type: application/json" \
-u admin:adminpw \
"http://localhost/api/v3.1/blueprints/submanager_blueprint?application_file_name=blueprint.yaml&visibility=tenant&blueprint_archive_url=https://url/to/archive/master.zip&labels=customer=EXL"
curl -X PUT \
--header "Tenant: default_tenant" \
--header "Content-Type: application/json" \
-u admin:adminpw \
-d '{"blueprint_id": "submanager_blueprint", "inputs": {"cloudify_username": "admin", "cloudify_manager_ip": "10.0.10.10", "cloudify_port": "80", "cloudify_protocol": "http", "cloudify_tenant": "default_tenant"}, "visibility": "tenant", "site_name": "LONDON", "labels": [{"customer": "EXL"}]}' \
"http://localhost/api/v3.1/deployments/submanager1?_include=id"
curl -X POST \
--header "Tenant: default_tenant" \
--header "Content-Type: application/json" \
-u admin:admin \
-d '{"deployment_id":"submanager1", "workflow_id":"install"}' \
"http://localhost/api/v3.1/deployments/submanager1?_include=id"
Another option to install manager_exposer.yaml: cloudify CLI.
To proceed with CLI installtion, refere to official documentation.
Upload blueprint and then install it. There is two ways of installation:
Go to Environments tab and Click on created submanager. Execution Task Graph must contain Install completed tile. You can also check if all task finish with success in Deployment Events/Logs. Deployment Info tab contains DEPLOYMENT OUTPUTS/CAPABILITIES part with information about the submanager. Check if all informations are correct.
To perform correct management, you need to create also proper secret about your all submanagers in Spire. There are two ways to connect Spire with submanagers:
- token - contains proper value of cloudify token. Token can be created with command cfy token create
- user password - contains value of password.
Name of secrets must be compatible with secrets as inputs used in “Deploy on” mechanism.
Depending on connection type you can deploy the proper blueprint:
- authentication with token -> deploy_on_token.yaml
- authentication with password -> deploy_on_user_password.yaml
The current version of deploy_on_token.yaml/deploy_on_user_password.yaml supporting public repo, to use private repo or local blueprint check chapter 6. Resource Config.
Upload the blueprint to SPIRE MANAGER. Click the action “Deploy on” from Bulk action on the submanager ENVIRIONMENT. The dialog appears but the inputs are visible when the blueprint is selected.
Inputs description:
- Required:
- blueprint_archive - url to zip which contains all necessary files, the source must be available from submanager. You can find examples here
- blueprint_id - name of blueprint with which the file is to be uploaded
- main_file_name - name of blueprint file in zip package
- trust_all - is value of CLOUDIFY_SSL_TRUST_ALL (true if certificate is not valid or for testing purpose)
- optional (depends on authentication type):
- cloudify_secret_token - name of secret which contains token value
- cloudify_password_secret_name - name of secret which contains password value
In the below examples use uploaded blueprint with id blueprint_on_submanager. The used inputs to "Deploy on" mechanism:
- blueprint_id=blueprint_on_submanager Must be uploaded to local!!!
- cloudify_password_secret_name=admin_password
- main_file_name=blueprint.yaml
- name_of_deployment=local_deployment1
- trust_all=true
- value_of_hello=MyWorld
Go to the Services by clicking on button Verify if install completed tile is visible in Execution Task Graph. You can also go to the local manager and check if deployment is installed in Services tab. Optional [Only when inputs are exposed in Capabilities] !!! In case of this blueprint, inputs are exposed. You can check the value of capabilities
Bulk action "Deploy on" perform actions on all accesible Environments. If you would like to select only specific submanager, you can use Filters. You can click Filter button (next to Bulk actions), after that the dialog appears Fill it and click Apply
Node cloudify.nodes.Component allow to create deployment based on blueprint which can be uploaded to target manager (submanager) from 3 types of resources:
- public repo - no additional step - example here
- private repo - create two secret: github_user and github_token - example here
- local blueprint - upload blueprint (from examples) to target submanager and proceed with Deploy on on main manager - example here
You can also specify inputs of deployments (example here) :
deployment:
inputs:
input0: test
input1: {get_input: value1}
input2: {get_secret: sec1}
If you use get_secret: secret1, you have to check if secret1 is created.