Palette supports placeholder variables as Macros in our cluster profile layers. These macros make regression and update of variables, across multiple-running clusters, easier. We encourage creating these macros and using them within any of our cluster profile layers. Hence, changes to the existing Macros get updated to the corresponding cluster profile and the clusters with these profiles attached.
Palette users can declare the Macros under three different scopes:
- Project Scope: Create
Macros
from the project dashboard with project privileges.
- Tenant Admin Scope: Create macros from the
Tenant Admin Dashboard
with administrative privileges.
- System Scope: Includes the default system macros and user-created system macros.
The Macros must have unique names within a given application, but Macros with a different Scope can have a unique name. In such cases, the precedence followed is in decreasing order (the highest precedence being Project Scope).
Project Scope > Tenant Scope > System Scope
Palette users can use Macros in three different Scopes. Following the user preferences and privileges, log in as a Tenant Admin or Project Admin, to create macros under Tenant Admin scope and Project Scope, respectively. System Scope Macros can be created via API's. The steps to create a macro are as below:
- Log in to the Palette Management Console as a Tenant Admin.
- From the menu on the left-hand side, click on Tenant Settings and select the Macros tab.
- Click on +Add Macro.
- Complete the following details for the same:
- Name: A custom name for the Macro.
- Value: The value to be assigned to the placeholder variable.
- Click the Save changes button to complete the wizard.
manifests:aws_ebs:#Storage type should be one of io1, gp2, sc1, st1 types #Checkhttps://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html for more detailsstorageType: "gp2"#Allowed reclaim policies are Delete, RetainreclaimPolicy: "Delete"#Toggle for Volume expansionallowVolumeExpansion: "true"#Toggle for Default classisDefaultClass: "true"#Supported binding modes are Immediate, WaitForFirstConsumer#Setting this to WaitForFirstConsumer for AWS, so that the volumes gets created in the same AZ as that of the podsvolumeBindingMode: "{{.spectro.macro.volumeBindingMode}}"
The Macros are overridden into the Cluster Profile layers:
- During a Cluster Profile creation.
- For a Cluster Profile used by a running cluster or during cluster provisioning.
- Log in to the Palette console and navigate to Profiles.
From the Cluster Profiles tab, select the Cluster Profile to which the Macro is to be added.
Note: A macro can be attached to any Infrastructure or Add-on layers of a Profile.
Add the macro name to the desired layer of the profile in the format:
{{.spectro.macro.macro-name}}
, where the macro-name is the Custom name, created by the user.
- Save the changes to the Cluster Profile. This Macro can be replaced or edited later.
- Log in to Palette Management Console as Tenant Admin.
- From the menu on the left-hand side, go to Tenant Settings and select the Macros tab.
- Click the Delete button to remove the macro.
- Click the Save changes button to complete the wizard.