Integration Server 11.1 | Microservices Runtime Guide | Using Configuration Variables Templates with Microservices Runtime | Editing a Configuration Variables Template
 
Editing a Configuration Variables Template
 
Encrypting Values for the Variables Template
Using a Kubernetes Secret with a Configuration Variables Template
Creating New Assets with the Configurations Variable Template
After you generate a configuration variables template from a Microservices Runtime, you modify the configuration variables template to contain the property values that you want applied to a Microservices Runtime at start up. You can hard code values or specify an environment variable as the value. You can also encrypt values or use a Kubernetes Secret to protect sensitive data. In addition, you can also add assets to the template.
Keep the following information in mind when you edit a configuration variables template.
*Any value that you specify must meet the requirements for the associated property. For example, global variable values cannot exceed 255 characters. If the value is not valid, failures will occur at runtime, either during server initialization or when clients start sending in requests.
*A configuration variables template can be used to change the configuration information for assets that already exist on the Microservices Runtime.
*You can add assets for some asset types to a Microservices Runtime by adding key-value pairs to a template. Any asset that you create must meet the naming requirements for the asset. If it does not, the improperly configured asset might result in Microservices Runtime failure at startup or during operations. For a list of assets that you can add, Creating New Assets with the Configurations Variable Template.
*A configuration variables template generated from Microservices Runtime lists only assets that existed on the Microservices Runtime from which you generated the template. You can add an asset for an asset type for which asset creation is allowed via a configuration variables template. If asset creation is not allowed for that type but you know the asset will exist on the Microservices Runtime that will use the template, you can add the asset and the necessary key-value pairs to the template. At start up, if the template specifies a value for a non-existent asset, the Microservices Runtime logs a message to the configuration variables log.
For more information about assets and properties and the corresponding key name, see Configuration Variables Template Assets.
*When Microservices Runtime generates an application.properties template, any properties that contain an alias name with a period (.) include another period as an escape character. For example, for a JMS connection alias named my.JMS.alias, the template property corresponding to the Client ID in the alias the name: jms.my..JMS..Alias.clientID=value
Do not remove the period (.) acting as the escape character.
If you edit the template by adding a key-value pair for an asset property and the asset property includes an alias name with a period (.), make sure to add another period to serve as the escape character.
*If you use an environment variable or the key of a Kubernetes Secret as the property value, you can set a default value to use for the property if the environment variable or key does not have an assigned value or Microservices Runtime cannot find an environment variable or Kubernetes Secret key with the provided name.
*To supply a value in the configuration variables template
1. Open the template in a text editor.
2. For each key for which you want to supply a value, do one of the following:
To
Enter this for the property value
Hard code a value
The value you want to use.
Use an environment value as the value
The name of the environment variable in the format: $env{environmentVariableName}
Where environmentVariableName is the name of the environment variable. For example: $env{JDBC_URL}
To set a default value that will be used if Microservices Runtime cannot resolve the environment variable, use the format: $env{environmentVariableName:defaultValue}
Use a Kubernetes Secret as the value
The key for the Kubernetes Secret in the format: $secret{secretName}
Where secretName is the key for the secret whose value you want to use. For example: $secret{mySecretPassword}
To set a default value that will be used if Microservices Runtime cannot resolve the Kubernetes Secret, use the format: $secret{secretName:defaultValue}
For more information about using a Kubernetes Secret with a configuration variables template, see Using a Kubernetes Secret with a Configuration Variables Template.
Encrypt a value
Use Microservices Runtime Administrator to generate an encrypted value and then copy that value into the template. For more information see, Encrypting Values for the Variables Template.
While Microservices Runtime accepts clear text passwords as well as encrypted ones, IBM recommends that you encrypt all passwords and other sensitive data in your configuration variables templates.
3. Repeat the above step for each key that you want to set.
4. To add an asset, add the key-value pair for each property of the asset that you want to set.
For example, to add a global variable, insert the following into the template:
globalvariable.globalVariableName.value=globalVariableValue
Where globalVariableName is the name of the global variable that you want to create.
5. Repeat step 4 for every asset that you want to create.
6. Save the template.