Skip to content

Cloudify-PS/exl_poc

Repository files navigation

exl_poc - SPIRE Manager

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.

1. Installation Cloudify Spire Manager

To install the MAIN Manager (Spire), please refer to the Cloudify official documentation.

2. Installation submanagers

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).

3. Exposing submanagers in Spire Manager

All actions in this chapter are performed on Spire

Install

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

Installation via User Interface

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 This is an image 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.

Installation with API Call

To use Cloudify API, you can refer to official API documentation.

Uploading example
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"
Create deployment example
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"
Install example
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:

Verification 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. This is an image2 Deployment Info tab contains DEPLOYMENT OUTPUTS/CAPABILITIES part with information about the submanager. Check if all informations are correct. This is an image3

Required secrets

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. This is an image4

Name of secrets must be compatible with secrets as inputs used in “Deploy on” mechanism.

4. “Deploy on” mechanism.

Depending on connection type you can deploy the proper blueprint:

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.

This is an image5

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

5. Verification “Deploy on” mechanism

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 This is an image7 Verify if install completed tile is visible in Execution Task Graph. This is an image8 You can also go to the local manager and check if deployment is installed in Services tab. This is an image9 Optional [Only when inputs are exposed in Capabilities] !!! In case of this blueprint, inputs are exposed. You can check the value of capabilities This is an image10

6. Filter in Environment Tab

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 This is an image6 Fill it and click Apply

7. Resource Config

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages