Overview:
In this step, we'll prepare the module schema required for deploying an application on the Add-On Mart infrastructure.
This schema defines the configuration settings available in the Config UI for each application instance.
The schema can contain all configuration details required by the application. These may include values that need to be set in the application's config file, environment variables, and secrets.
The values specified in the configuration will be linked to the helmfile using the "id" of the attribute from the settings list and subsequently provisioned to the Helm Charts.
It is essential to ensure the schema parameters are correctly defined to match the Helmfile templates, deployment and application requirements.
Tool for schema generation:
To simplify the schema preparation process, a schema generator tool can be used -> https://ipaas-dev.portaone.com/tools/schema-generator-ui/
Schema Preparation: Key requirements and further guidance:
For detailed information regarding the schema structure, requirements for schema preparation, and possible configurations, please refer to the link → Configuring your containerized application to be launched in Add-On Mart
Artifacts:
For the purpose of this tutorial we will be using this artifacts repository: https://gitlab.portaone.com:8949/read-only/tutorial-for-simple-application
Key Components
1. Schema Parameters:
- groups: A list of settings groups that will be displayed in the Config UI, for instance configuration.
2. Groups Configuration:
- Groups contain settings related to the application configuration.
- For details on possible group configurations, refer to the link -> Configuring your containerized application to be launched in Add-On Mart
3. Custom Configuration Settings:
- Settings specific to the application can be configured.
- Ensure that the ID in the schema is consistent with the corresponding ID that will be used in the Helmfile templates. This alignment is crucial for the proper functioning of the deployment.
In the scope of this instruction, it was decided to give the possibility to configure via Add-On Mart Config UI the following parameters:
CUSTOM_CONFIG_VALUE
- custom value that should be written to the application configSERVER_URL
- server url value that should be written to application configCUSTOM_ENV_VARIABLE
- custom environment variable that should be set in the container
Example of group configuration with custom parameters
:
{ "groups": [ { "name": "Owner Data", "provider": "APP_OWNER", "settings": [ { "id": "server_url", "label": "SERVER_URL", "type": "text", "mandatory": true, "default": "https://jsonplaceholder.typicode.com/users", "info": "Server URL in configuration file" }, { "id": "config_option", "label": "CUSTOM_CONFIG_VALUE", "type": "text", "mandatory": true, "info": "Custom option in configuration file" }, { "id": "custom_env_variable", "label": "CUSTOM_ENV_VARIABLE", "type": "text", "mandatory": true, "info": "Custom environment variable to set" } ] } ] }
4. Domain and Certificate Configuration:
- Communication with the application will be managed via IngressController. By adding this part we will allow future domain and certificate configuration of application via Config UI
- Without a proper domain name and certificate application will not function correctly.
- This part of the schema must remain unchanged to ensure proper domain and certificate setup:
{ "name": "Choose domain configuration", "provider": "APP_OWNER", "settings": [ { "id": "portal_domain", "type": "hostname", "mandatory": true, "label": "Portal domain", "validator": [ { "name": "DNS_RESOLVE" }, { "name": "CERTIFICATE", "relates": { "is_disabled": "ssl_cert_auto", "cert": "portal_cert", "key": "portal_private_rsa_key" } } ] }, { "id": "ssl_cert_auto", "type": "boolean", "mandatory": true, "label": "Generate certificates", "default": false }, { "id": "portal_cert", "type": "file", "mandatory": false, "label": "Portal SSL certificate", "info": "binary", "validator": [ { "name": "MANDATORY", "relates": { "is_disabled": { "ssl_cert_auto": true } } } ] }, { "id": "portal_private_rsa_key", "type": "file", "mandatory": false, "label": "Portal private RSA key (Apache compatible)", "info": "binary", "validator": [ { "name": "MANDATORY", "relates": { "is_disabled": { "ssl_cert_auto": true } } } ] } ] }
Complete Example Schema
{ "groups": [ { "name": "Choose domain configuration", "provider": "APP_OWNER", "settings": [ { "id": "portal_domain", "type": "hostname", "mandatory": true, "label": "Portal domain", "validator": [ { "name": "DNS_RESOLVE" }, { "name": "CERTIFICATE", "relates": { "is_disabled": "ssl_cert_auto", "cert": "portal_cert", "key": "portal_private_rsa_key" } } ] }, { "id": "ssl_cert_auto", "type": "boolean", "mandatory": true, "label": "Generate certificates", "default": false }, { "id": "portal_cert", "type": "file", "mandatory": false, "label": "Portal SSL certificate", "info": "binary", "validator": [ { "name": "MANDATORY", "relates": { "is_disabled": { "ssl_cert_auto": true } } } ] }, { "id": "portal_private_rsa_key", "type": "file", "mandatory": false, "label": "Portal private RSA key (Apache compatible)", "info": "binary", "validator": [ { "name": "MANDATORY", "relates": { "is_disabled": { "ssl_cert_auto": true } } } ] } ] }, { "name": "Owner Data", "provider": "APP_OWNER", "settings": [ { "id": "server_url", "label": "SERVER_URL", "type": "text", "mandatory": true, "default": "https://jsonplaceholder.typicode.com/users", "info": "Server URL in configuration file" }, { "id": "config_option", "label": "CUSTOM_CONFIG_VALUE", "type": "text", "mandatory": true, "info": "Custom option in configuration file" }, { "id": "custom_env_variable", "label": "CUSTOM_ENV_VARIABLE", "type": "text", "mandatory": true, "info": "Custom environment variable to set" } ] } ] }
Summary
This step involved preparing the module schema, which defines the configuration settings for an application on Add-On Mart. The schema allows parameters to be set and requested through the Config UI, providing the necessary input that can later be mapped to the Helmfile templates. This process supports the deployment and configuration of the application.