Overview:


Add-On Mart Tool is a CLI based application that serves to facilitate new application deployment.
It can be used for the following purposes:

  • Uploading module schema 
  • Uploading Helm charts
  • Uploading docker images
  • Uploading Auto-deployer templates
  • Creating instances
  • Deploying applications
  • Stopping applications
  • Removing applications and instances

Application:

Download latest version of the addon-mart tools for your OS : https://gitlab.portaone.com:8949/read-only/microservices-tools-addonmart/-/releases

Requirements:

1) Attributes for deployment shall be prepared in advance:

2) In the deployment template of application's helm chart add new label with name "vendor_id" and value set to the login which you've chosen during registration in TEAM (New vendor registration in TEAM)

3) To proceed with TEAM, Add-On Mart shall be configured in the scope of the "staging" context (Context (environment) selection)

4) The Add-On Mart tool shall be preconfigured with the required parameters (server URL, registry data, vendor credentials, etc.) (Configure application)

Application Configuration:

To start using the Add-On Mart tool it is required to preliminary configure the application.

1) Context (environment) shall be selected

2) Application configuration file should be filled.

Context and parameters in the configuration file can be changed during the application usage.

Context (environment) selection

There is three possible contexts (environments) in which the application can proceed:

  • local
  • staging
  • production

To proceed in the TEAM environment, "staging" context shall be set.

Each context stores configuration file data (URLs, registry name, etc.) that corresponds to the specific environment.

Each environment has a unique list of allowed commands.

Command to set/change context:

To switch  between contexts, execute the command addon-mart set-context <context>.

Example
> addon-mart set-context staging

INFO: Set context to "staging"
SUCCESS: Configuration file was updated

After proceeding with the command stated above, the context in the application configuration file shall be changed.

After changing the context, the user can see the "help" output for a list of commands that are assigned to a selected environment.
Use "addon-mart -h" to see all possible commands

> addon-mart -h
NAME:
   addon-mart - A CLI program to manage Add-on Mart modules

USAGE:
   addon-mart [global options] command [command options] 

VERSION:
   latest

DESCRIPTION:
   Current context: staging (environment)

COMMANDS:
   get-app-settings              Displays the "addon-mart" application configuration settings
   set-app-settings              Allows to update settings in "addon-mart" application configuration file
   set-context                   Set the context (environment)
   upload-configuration-schema   Allows to upload configuration-schema in JSON format to the Configuration Backend
   sync                          Synchronizes all changes made locally with remote backends
   create                        Creates a new service instance
   deploy                        Starts deployment of the selected instance to the Kubernetes test cluster and displays deployment results
   download-templated-resources  Downloads deployment templated resources and save as a tar.gz file
   stop                          Stops all running containers related to the service instance in the test environment Kubernetes cluster
   remove                        Disables/Removes instance from the Configuration Backend DB
   help, h                       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

COPYRIGHT:
   © 2001 - 2025 PortaOne Inc

Configuring the application:

The Add-On Mart tool creates an internal configuration file during its first execution.

If a configuration file already exists, its values are read during subsequent uses of the application.

Configuration files are stored in the following directories, depending on the operating system:

On Unix systems:

  • $XDG_CONFIG_HOME/AddonMartTool/config.json
  • $HOME/.config/AddonMartTool/config.json

On Darwin:

  • $HOME/Library/Application Support/AddonMartTool/config.json.

On Windows:

  • %AppData%\AddonMartTool\config.json


Configuration file example:

{
    "configuration": {
        "context": "staging" 										## Currently selected context
    },
    "local": { 														## local context configuration
        "server_config": { 											## Configuration of Configuration Backend Server
            "server_url": "https://ipaas-testenv.portaone.com",			## Configuration Backend server URL 
            "instance_tag": "demo" 									## Deployment tag (Default during first application initialization - demo)
        },
        "registry_config": { 										## Configuration of image/charts registry 
            "registry_hostname": "registry.portaone.com", 			## Hostname of the remote registry 
            "docker_repository_name": "vendor_name", 				## Name of the remote image registry
            "charts_repository_name": "vendor_name" 				## Name of the remote chart repository
        }
    },
    "staging": { 													## staging context configuration
        "credentials": { 
            "login": "vendor_name", 								## Vendor login to access Configuration Backend service and image/charts registry
            "password": "vendor_password" 							## Vendor password to access Configuration Backend service and image/charts registry 
        },
        "server_config": { 											## Configuration of Configuration Backend Server
            "server_url": "https://ipaas-testenv.portaone.com", ## Configuration Backend server URL
            "instance_tag": "demo" 									## Deployment tag (Default during first application initialization - demo)
        },
        "registry_config": { 										## Configuration of image/charts registry
            "registry_hostname": "registry.portaone.com", 			## Hostname of the remote registry  
            "docker_repository_name": "vendor_name", 				## Name of the remote image registry
            "charts_repository_name": "vendor_name" 				## Name of the remote chart repository

        }
    },
    "production": { 												## production context configuration
       "credentials": { 
            "login": "vendor_name", 								## Vendor login to access Configuration Backend service and image/charts registry
            "password": "vendor_password" 							## Vendor password to access Configuration Backend service and image/charts registry 
        }, 
       "server_config": { 											## Configuration of Configuration Backend Server
            "server_url": "https://ipaas.portaone.com", 			## Configuration Backend server URL
            "instance_tag": "demo" 									## Deployment tag (Default during first application initialization - demo)
        },
        "registry_config": { 										## Configuration of image/charts registry
            "registry_hostname": "registry.portaone.com", 			## Hostname of the remote registry  
            "docker_repository_name": "vendor_name", 				## Name of the remote image registry
            "charts_repository_name": "vendor_name" 				## Name of the remote chart repository

        }
    }
}


Command to set/change configuration parameters:

The addon-mart set-app-settings command allows updating data in the application configuration file.

This command is essential for ensuring that the configuration settings are accurate and up to date for the specified context (environment).

To update the configuration file, use the command addon-mart set-app-settings [command options] [argument]

Use --help to see more details related to the command.

> addon-mart set-app-settings -h
NAME:
   addon-mart set-app-settings - Allows to update settings in "addon-mart" application configuration file
 
USAGE:
   addon-mart set-app-settings [command options] [arguments...]
 
OPTIONS:
   --context value           Context in which data should be set/updated (required)
   --login value             Login for authentication in the server and registry ("staging" context only)
   --password value          Password for authentication in the server and registry ("staging" context only)
   --server-url value        URL of the configuration backend server
   --instance-tag value      Deployment tag (Default: demo)
   --registry-addr value     Hostname of the remote registry
   --docker-repo-name value  Name of the remote docker repository or image registry
   --charts-repo-name value  Name of the remote chart repository
   --help, -h                show help

Command example:

Example
> addon-mart set-app-settings --context staging \
--login p1_sagitario \
--password <vendor_password> \
--server-url https://ipaas-testenv.portaone.com \
--instance-tag demo \
--registry-addr registry.portaone.com \
--docker-repo-name p1_sagitario \
--charts-repo-name p1_sagitario

In TEAM (staging context), the same credentials are used for access to the Configuration Backend server and charts/image registry.

`docker-repo-name` and `charts-repo-name` shall be created by PortaOne administrator using the same name as "vendor_login"

For details related to the vendor configuration, please refer  => https://wiki.portaone.com/x/QdW2Dg


Command to check configuration parameters:

The addon-mart get-app-settings command allows to display an internal application configuration data to the cli output.

This command allows displaying either the complete application configuration or the configuration specific to the currently set context.

It also provides an option to display the configuration data in JSON format.
Use --help to see more details related to the command.

> addon-mart get-app-settings -h
NAME:
   addon-mart get-app-settings - Displays the "addon-mart" application configuration settings
 
USAGE:
   addon-mart get-app-settings [command options] [arguments...]
 
OPTIONS:
   --current   Displays current application configuration (default: false)
   --raw       Display the raw JSON configuration (default: false)
   --help, -h  show help

Command example:

Example
> addon-mart get-app-settings
#OR
> addon-mart get-app-settings --current
#OR
> addon-mart get-app-settings --raw

Application deployment and service stopping in test environment(TEAM):

Schema uploading: 

Command addon-mart upload-configuration-schema  shall be used In order to upload (provision) JSON schema from the local file to the Configuration Backend and to validate data.

Use --help to see more details related to the command.

> addon-mart upload-configuration-schema -h
NAME:
   addon-mart upload-configuration-schema - Allows to upload configuration-schema in JSON format to the Configuration Backend

USAGE:
   addon-mart upload-configuration-schema [command options] [arguments...]

OPTIONS:
   --module_name value           Name of the module (required)
   --version value               Version of the application (required)
   --configuration-schema value  Path to a file with application configuration-schema. Note: this file should be in JSON (.json) format (required)
   --help, -h                    show help

Command example:

Example
> addon-mart upload-configuration-schema path/to/config_schema.json

Command validates provided data. If any  validation inconsistency error was identified in the provided datatype or mandatory attribute was not provided, the application shall return validation error details

Example
> addon-mart upload-configuration-schema \
  --module_name <name_of_the_module> \
  --version <application version> \
  --configuration-schema <path/to/config_schema.json>

INFO: reading ./examples/config_files/config_schema.json file...
2024/07/29 17:42:29 ERROR: failed to send schema to backend
422 Unprocessable Entity 
Details: Validation Errors (2):
Error 1:
  Location: body, name
  Message: none is not an allowed value
  Type: type_error.none.not_allowed
Error 2:
  Location: body, version
  Message: none is not an allowed value
  Type: type_error.none.not_allowed
exit status 1

Example
> addon-mart upload-configuration-schema \
  --module_name <name_of_the_module> \
  --version <application version> \
  --configuration-schema <path/to/config_schema.json>

INFO: reading ./examples/config_files/config_schema.json file...
2024/07/29 17:44:58 ERROR: json: cannot unmarshal number into Go struct field Group.groups.name of type string.
exit status 1

Synchronizing Local State with Server/Registry:

Command addon-mart sync  executes a full batch of actions needed to synchronize all changes that the vendor may have made on the computer locally with all remote backends in one step.
This includes (re-)upload of JSON schema and updated auto-deployer templates to the Configuration Backend, pushing updated Docker images and Helm charts to the PortaOne registry.

Use --help  to see more details related to the command.

> addon-mart sync -h
NAME:
   addon-mart sync - Synchronizes all changes made locally with remote backends

USAGE:
   addon-mart sync [command options] [arguments...]

OPTIONS:
   --module_name value              Name of the module (required)
   --configuration-schema value                   Path to a file with module's schema. Note: this file should be in JSON (.json) format (required)
   --image value [ --image value ]  Name of the Docker image with tag. This flag can be specified multiple times.
                                    Format options:
                                      - <image name>:<local tag> (local tag and remote tag are equal)
                                      - <image name>:<local tag>:<remote tag>
   --chart-dir value                Path to the directory with valid Chart.yaml (required)
   --version value                  Version of the application (required)
   --templates value                Path to a directory with templates (required)
   --help, -h                       show help

Command example:

Example
> addon-mart sync \
--module_name <name_of_the_module> \
--configuration-schema <path/to/config_schema.json>\
--image <image_name>:<local_tag> \
--chart-dir <path/to/the/directory/with/charts> \
--version <application version> \
--templates <path/to/the/templates/directory>

After executing this command, schema and auto-deployer templates were uploaded to Configuration Backend server. Helm Charts and docker image were uploaded to the PortaOne registry. 

Creating an Instance:

Command addon-mart create serves to create new service instances.

After creating a new service instance, the Add-On mart tool returns the following data

  • Instance Id - required for application manipulation (deploy, stop, and remove)
  • config UI URL - URL of the Config UI where the application can be configured in line with the provided module schema requirements. 

Use --help  to see more details related to the command.

> addon-mart create -h
NAME:
   addon-mart create - Creates a new service instance

USAGE:
   addon-mart create [command options] [arguments...]

OPTIONS:
   --module_name value    Name of the module (required)
   --instance_name value  Name of the instance
   --help, -h             show help

 Command example:

Example
> addon-mart create --module_name <module_name> --instance_name <instance_name(optional)> 

Deploying an Application:

Command addon-mart deploy  serves to start deployment of the selected instance to the Kubernetes test cluster.

Deployment of the instance using the Add-On Mart tool can proceed only after saving the configuration on Config UI.

To start the deployment process, it is required to follow the provided link by the command addon-mart create, configure the instance, and save this configuration.

The command returns errors in case a validation error occurs before deployment starts or any connection or authorization errors occur.
If the deployment is initiated, the command returns the status "started".

For the final deployment result and error details that occurred during the deployment process, please refer to Config UI.

Use --help  to see more details related to the command.

> addon-mart deploy -h
NAME:
   addon-mart deploy - Starts deployment of the selected instance to the Kubernetes test cluster and displays deployment results

USAGE:
   addon-mart deploy [command options] [instance_id]

DESCRIPTION:
   instance_id - A unique identifier for the instance

OPTIONS:
   --help, -h  show help

Command example:

Example
> addon-mart deploy <instance_id>

As it was previously mentioned, the application should be preconfigured in the Config UI before deployment starts.
If the application was not previously configured, the Add-On mart tool returns a validation error with an indication of mandatory parameters in the module schema that must be filled.

Command example:

Example
> addon-mart deploy 91-91

2024/07/29 22:31:28 ERROR: failed to deploy instance
400 Bad Request 
Details: Validation Errors (8):
Error 1:
  Location: nas_ip
  Message: none is not an allowed value
  Type: type_error.none.not_allowed
Error 2:
  Location: radius_host
  Message: none is not an allowed value
  Type: type_error.none.not_allowed
Error 3:
  Location: radius_secret
  Message: none is not an allowed value
  Type: type_error.none.not_allowed
Error 4:
  Location: portal_cert
  Message: MANDATORY validation failed
  Type: value_error
Error 5:
  Location: portal_private_rsa_key
  Message: MANDATORY validation failed
  Type: value_error
Error 6:
  Location: portal_domain
  Message: none is not an allowed value
  Type: type_error.none.not_allowed
Error 7:
  Location: user_login
  Message: MANDATORY validation failed
  Type: value_error
Error 8:
  Location: user_password
  Message: MANDATORY validation failed
  Type: value_error

Downloading deployment templated resources

Command addon-mart download-templated-resources serves to  download templated resources, such as values file and manifests used for the deployment of a specific instance.

Command downloads templated resources in archive (.tar.gz) to the directory stated using flag --path  or to the currant directory.

Use --help  to see more details related to the command.

> addon-mart download-templated-resources -h
NAME:
   addon-mart download-templated-resources - Downloads deployment templated resources and save as a tar.gz file

USAGE:
   addon-mart download-templated-resources [command options] [arguments...]

OPTIONS:
   --instance-id value  A unique identifier for the instance
   --path value         Directory path specifying where the content will be saved
   --help, -h           show help

Command example:

Example
>  addon-mart download-templated-resources \
  --instance_name <instance name> \
  --path <path/to/the/directory>
 

Stopping an Instance:

Command addon-mart stop serves to stop all running containers related to the service instance in the test environment Kubernetes cluster.

After stopping containers, an instance can be re-deployed again if needed.

Use --help  to see more details related to the command.

> addon-mart stop -h
NAME:
   addon-mart stop - Stops all running containers related to the service instance in the test environment Kubernetes cluster

USAGE:
   addon-mart stop [command options] [instance_id]

DESCRIPTION:
   instance_id - A unique identifier for the instance

OPTIONS:
   --help, -h  show help

Command example:

Example
>  addon-mart stop <instance_id>

Removing an Instance:

Command addon-mart remove  serves to disable/remove instances from the Configuration Backend DB.  

Removing an application instance frees up resources and maintains the environment by ensuring that all related components and allocations are properly shut down and cleared.

The command removes the instance permanently so there is no possibility to re-deploy it.

Use --help  to see more details related to the command.

> addon-mart remove -h
NAME:
   addon-mart remove - Disables/Removes instance from the Configuration Backend DB

USAGE:
   addon-mart remove [command options] [instance_id]

DESCRIPTION:
   instance_id - A unique identifier for the instance

OPTIONS:
   --help, -h  show help

Command example:

Example
>  addon-mart remove <instance_id>


Application deployment in TEAM walkthrough:

Preconditions:

Vendor login:  p1_sagitario

In TEAM vendor login is used for

  •  authentication/authorization purposes on the Configuration Backend server and PortaOne registry.
  • registry naming

For more details, please refer => https://wiki.portaone.com/x/QdW2Dg

As it was previously stated, it is required to prepare a list of attributes before application deployment:
For more details, please refer to Requirements
Just for testing/demonstration purposes, preconfigured data can be used.

This section serves only for demonstration purposes.
All attributes like application, charts, auto-deployer templates, and modules schema serve only as examples for demonstration purposes.

App_Example.tar.gz

Unpack the data provided above. It should contain the following data:

  • /app - application source code with Dockerfile
  • /charts - directory with prepared Helm Charts
  • /module_schema - directory with prepared module schema
  • /templates - templates required for auto-deployer

Change "vendor_id" label to the appropriate one in the following files:

  • "./App_Example/chart/templates/deployment.yaml"
  • "./App_Example/chart/values.yaml"
  • "./App_Example/templates/helmfile.yaml"


Step 1: Docker image preparation

Build a docker image with the assigned tag

> sudo docker build -t notes-app:0.1.0 ./app/
[+] Building 0.8s (10/10) FINISHED                                                                                                                                                                                           docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 434B                                                                                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/python:3.9-slim                                                                                                                                                                     0.8s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                                                        0.0s
 => [1/4] FROM docker.io/library/python:3.9-slim@sha256:27211e8bbfd2c91ac9adbde0565b9ac18234bfcde8ef0e6a3404fd404f26ea13                                                                                                               0.0s
 => [internal] load build context                                                                                                                                                                                                      0.0s
 => => transferring context: 59B                                                                                                                                                                                                       0.0s
 => CACHED [2/4] WORKDIR /app                                                                                                                                                                                                          0.0s
 => CACHED [3/4] RUN pip install --no-cache-dir fastapi uvicorn pyyaml                                                                                                                                                                 0.0s
 => CACHED [4/4] COPY . .                                                                                                                                                                                                              0.0s
 => exporting to image                                                                                                                                                                                                                 0.0s
 => => exporting layers                                                                                                                                                                                                                0.0s
 => => writing image sha256:acb1de8ec16e5b8b28da6e174816669ec07957be817fe352d98e14b2e07ae2e4                                                                                                                                           0.0s
 => => naming to docker.io/library/notes-app:0.1.0                                                                                                                                                                                     0.0s

What's Next?
  View a summary of image vulnerabilities and recommendations → docker scout quickview

Step 2: Set context in the Add-On Mart tool

"staging" context shall be set to proceed with TEAM

> addon-mart set-context staging

INFO: Set context to "staging"
SUCCESS: Configuration file was updated

Step 3: Configure Add-On Mart tool application

To set application configuration, execute the command stated below

> addon-mart set-app-settings \
--context staging \
--login p1_sagitario \
--password <vendor_password> \
--server-url https://ipaas-testenv.portaone.com \
--instance-tag demo \
--registry-addr registry.portaone.com \
--docker-repo-name p1_sagitario \
--charts-repo-name p1_sagitario

INFO: Set "login"="p1_sagitario" for context "staging"
INFO: Set "password"="<vendor_password>" for context "staging"
INFO: Set "server_url"="https://ipaas-testenv.portaone.com" for context "staging"
INFO: Set "instance_tag"="demo" for context "staging"
INFO: Set "registry_hostname"="registry.portaone.com" for context "staging"
INFO: Set "docker_repository_name"="p1_sagitario" for context "staging"
INFO: Set "charts_repository_name"="p1_sagitario" for context "staging"
SUCCESS: Configuration file was updated

Step 4: Upload schema (Optional) 

To upload module schema, execute the command stated below

> addon-mart upload-configuration-schema \
  --module_name notes-app \
  --version 0.1.0 \
  --configuration-schema ./module_schema/module_schema.json

INFO: reading ./module_schema/module_schema.json file...

Step 5: Synchronize local project state 

To execute this command, a batch of attributes should be prepared in advance. 
For more details, please refer to Requirements

To upload prepared data, execute the command stated below

> addon-mart sync \
--module_name notes-app \
--configuration-schema ./module_schema/module_schema.json \
--image notes-app:0.1.0 \
--chart-dir ./chart/ \
--version 0.1.0 \
--templates ./templates/

INFO: reading ./module_schema/module_schema.json file...
INFO: pushing registry.portaone.com/p1_sagitario/notes-app:0.1.0 image to the registry...
The push refers to repository [registry.portaone.com/p1_sagitario/notes-app]
4a30914bcdc1: Layer already exists 
8f63c4c19992: Layer already exists 
2c2dbc44ba3b: Layer already exists 
337337a89bc6: Layer already exists 
6e1edc42bbcc: Layer already exists 
da6d0db38dea: Layer already exists 
4e4410552731: Layer already exists 
e0781bc8667f: Layer already exists 
0.1.0: digest: sha256:f52ef8070c0caa5e96f887caacc02141c04247398018a30d1fde4ace9909d56a size: 1996
SUCCESS: registry.portaone.com/p1_sagitario/notes-app:0.1.0 image has been successfully pushed to the registry.
INFO: checking registry.portaone.com repository...
INFO: pushing chart to registry.portaone.com repository...
SUCCESS: the chart has been successfully pushed to the repository.

Step 6: Create an application instance 

To create an instance based on the module schema that was previously uploaded, execute the command stated below

> addon-mart create \
--module_name notes-app \
--instance_name personal_notes

Instance created successfully
Instance ID: 109-109
Config UI URL: https://ipaas-testenv.portaone.com/ipaas-config-ui/?access_token=cDFfc2FnaXRhcmlvX3VzZXJfMTcyMjMzOTE4Mjo1dW15SmxBOU1u&instance_id=109-109

Step 7: Configure application 

Follow the link to Config UI provided after instance creation and set the parameters required by the uploaded module schema

When configuring your domain for TEAM, ensure the domain name has either CNAME or A records.

This is crucial for proper functionality and deployment of applications, especially those relying on automatic TLS certificate generation by Let's Encrypt.
For TEAM domain configuration details, please ask Support or Partner Manager


If several application versions were uploaded (schema, image, charts, auto-deployer templates), Config UI provides a possibility to choose required one.


Press "Save for later" if you plan to deploy an application using Add-On Mart tool.

Or Press "Save & deploy" if you want to start deployment immediately.

Step 8: Deploy the application 

To deploy an application using Add-On Mart tool, execute the command stated below

> addon-mart deploy 109-109

Deployment results: {"status":"started"}

Step 9: Check the deployment status and errors if any

Follow Config UI to check if the application was successfully deployed.

In case any error occurs, you can refer to details to investigate logs of the issue.

To better understand the errors, you need to open the details window and view the error. If this is an error that occurred at stage TEAMValidationHelper or HelmfileAdapter, you can download the "templated resources" that contain the files specified in the error.

You can download them even if there are no errors, in order to see if everything is correctly inserted into your templates and what the generated Kubernetes manifests will look like

The downloaded archive needs to be unpacked. 

~/examples$ tar -xvzf 218-5776_templated_resources.tar.gz 
218-5776/
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-566d6bdd67
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-5946b66fb7
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-59d87d7875
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-5b57bccd5d
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-656f748c54
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-6df8db87c8
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-764c6d5475
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-77656866c4
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-7b59476c89
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-7cbc89ff76
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-84d9645684
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-8576f94697
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-cc5568f4f
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-ccb5dbcb9
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-d75964d9b
218-5776/dev-ipaas-mobile-acc-218-5776-sc-portal-values-d88bbc648
218-5776/manifests/
218-5776/manifests/mobile-acc-218-5776-sc-portal/
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/templates/
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/templates/alert-rules.yaml
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/templates/configmap-env.yaml
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/templates/deployment.yaml
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/templates/ingressroute.yaml
218-5776/manifests/mobile-acc-218-5776-sc-portal/ipsd-3804/templates/service.yaml

As a result, you will get a set of temporary files. The main directory will contain the values ​​files (all of which are included at the helm file level) and the /manifests directory. The /manifests directory will have the same file structure as the helm chart, but will contain the manifests after they have been processed by helm - that is, all parameter substitutions will have occurred.

In order to conveniently debug errors, you should view the error itself in "Deployment details" and find the corresponding file in the archive where the error occurred.

You can also download this archive using the addon mart tool.

addon-mart download-templated-resources --instance-id 218-5776 --path ./debug
In --instance-id you must specify the unique instance identifier that you deployed earlier (see Step 6).

Step 10: Check that the application works

Follow the application domain to see API schema - https://<portal domain>/docs

Send several API requests to create notes:

> curl -X 'POST' \
  'https://testenv-domain-01.portaone.com/note' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "FirstNote",
  "text": "It is my first note"
}' | jq.
{
"title": "FirstNote",
"text": "It is my first note",
"id": 0,
"Owner": "John Doe"
}

> curl -X 'POST' \
'https://testenv-domain-01.portaone.com/note' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"title": "SecondNote",
"text": "It is my second note"
}'  | jq .

{
"title": "SecondNote",
"text": "It is my second note",
"id": 1,
"Owner": "John Doe"
}

Test that notes were saved

> curl -X 'GET' \'https://testenv-domain-01.portaone.com/notes' \
-H 'accept: application/json' | jq .

[
  {
    "title": "FirstNote",
    "text": "It is my first note",
    "id": 0,
    "Owner": "John Doe"
  },
  {
    "title": "SecondNote",
    "text": "It is my second note",
    "id": 1,
    "Owner": "John Doe"
  }
]

Step 11: Check application logs

To review logs of the deployed application, follow the Opensearch resource link: → https://ipaas-testenv.portaone.com/logs

OpenSearch discloses logs related to all applications deployed by the authenticated (logged in) vendor

  • Log in to Opensearch using the vendor login and password created earlier.

  • Set filters to monitor the required application or for troubleshooting purposes
    For example, to track a specific container in Kubernetes, use:  kubernetes.container_name: notes-app


Step 12: Stop the application

To stop all containers related to the application, execute the command stated below 

> addon-mart stop 109-109

Deployment results: {"instance_id":"109-109","tag":"demo"}

The application was stopped and it is impossible to send API requests.

To re-deploy application, please return to step Deploy the application

Step 13: Remove the application 

To permanently remove an application, execute the command stated below

> addon-mart remove 109-109

Instance removed: {"instance_id":"109-109","tag":"demo"}

Now application and instance have been removed and there is no possibility of re-deployment.
To deploy an application, a new instance should be created first
If you need to deploy the application one more time, please proceed with Synchronize local project state If you need to update the application source code or schema, or Create an application instance if you plan to deploy an application without any modification

Step 14: Cleanup procedures

Instance Lifetime:
Each instance has a defined maximum lifetime, which determines how long it can remain active. Once this period elapses, the instance will be automatically stopped to free up resources. This ensures that outdated or unused instances do not unnecessarily consume resources.

Maximum Number of Instances:
There is a limit on the number of active instances that can be created per vendor. This limit helps to manage resource allocation effectively and prevents any vendor from consuming excessive resources.

Purpose of Cleanup:
The cleanup procedure is essential for managing resources efficiently and maintaining optimal performance. Vendors are expected to stop instances that are no longer needed or have reached their maximum lifetime to prevent resource congestion. Additionally, to avoid exceeding the maximum number of allowed instances, vendors should use the removal process when necessary.

Commands for Cleanup:

  • Stop Command: This command stops the application but does not remove it. The instance and its preconfigured data remain intact and can be redeployed as needed.
  • Remove Command: This command removes the instance and its preconfigured data entirely. Once removed, the instance cannot be redeployed without creating a new one. Using the remove command ensures that the vendor does not exceed the maximum number of allowed instances.