Skip to main content
Version: V6.2

Environment Configuration Management

warning

Operations on the above environment variables will take effect after updating/restarting the component.

Environment variables

Rainbond provides component environment variable management functionality, allowing users to add, delete, modify environment variables, and transfer environment variables to dependent environment variables.

  • Transferring environment variables to dependent environment variables will inject these environment variables into components that depend on this component when it is depended upon.

    After transfer, the environment variables will still take effect in the current component.

Configuration file management

Rainbond provides component configuration file management functionality, allowing users to add, delete, modify configuration files, and share configuration files from other components.

Enter the component's environment configuration page, click to add a configuration file, the content is as follows:

  • Configuration name:custom
  • Configuration file mount path: Must be an absolute path including the file name, for example: /data/test.conf
  • Permissions: File permissions, such as: 777
  • Configuration file content: Custom

Also supports dynamic rendering of environment variables.For example, Ningx configuration files do not support environment variable rendering by default, but Rainbond's configuration file mounting can achieve dynamic rendering of environment variables, as follows:

server {
listen ${PORT:80};
...
location /api {
proxy_pass http://${API_HOST}:${API_PORT};
}
}

Share configuration files

Sharing configuration files involves mounting another component's configuration files to the current component, suitable for scenarios where multiple components share the same configuration files.

Mount shared configuration files

Enter the component's environment configuration page, click to mount shared configuration files, the content is as follows:

  • Fill in the local mount configuration file path, for example: /data/test.conf

Configuration groups

Configuration groups are a set of environment variables that can take effect simultaneously across multiple components within the same application, very suitable for configuring unified environment variables for many components.

Enter the application view, click on configuration groups, add a configuration group.The last update component will take effect.

Default environment variables

In addition to the environment variables set by the user, the platform will also inject default environment variables into the component's runtime environment.

Variable nameillustrate
_PORTPort number
_PROTOCOLPort protocol type
_TENANT_IDTenant ID
_SERVICE_IDApplication ID
_SERVICE_NAMEApplication name, composed of the application English name and component English name, formatted as: application English name-component English name
_NAMESPACENamespace
_MEMORY_SIZEmicro、small etc., the corresponding relationship is shown below
_SERVICE_POD_NUMInstance count
_HOST_IPHost machine IP address
_POD_IPRuntime IP address
_POD_NAMEPod name

Correspondence between memory size and MEMORY_SIZE environment variable value

JVM configuration can be dynamically adjusted according to the MEMORY_SIZE variable, such as JAVA_OPTS="-Xms${MEMORY_SIZE}m -Xmx${MEMORY_SIZE}m"

Memory/MbEnvironment variable value
128micro
256small
512medium
1024large
20482xlarge
40964xlarge
81928xlarge
1638416xlarge
3276832xlarge
6553664xlarge