Resizing a deployment
To add the Resize Deployment action to a policy
- In the BMC Helix Intelligent Automation console, click Policies and the click Create Automation Policy.
- In the Policy Information section, enter a unique name and an optional description for the policy.
- Select Manual or Automatic depending upon whether you want to execute the policy manually or automatically based on the incoming events.
- In the Trigger section, click Browse and perform one of the following steps to select an event:
- From the Select Event Type tab, select an existing event type, and click Done.
On the Paste Event JSON tab, enter event in the JSON format, and click Done.
{
"tags": {
"event_type": "OVERALLOCATED_CONTAINER_RECOMMENDATION",
"platform": "kubernetes"
},
"payload": {
"generated_by": {
"product": "AIOps",
"version": "21.05.00"
},
"resources": [
{
"resource_id": "?",
"resource_name": "automation",
"account_id": "?",
"account_name": "?",
"cluster": "rem-qa",
"namespace": "ryan",
"deployment": "schedulerplugin",
"current_cpu_request": 500,
"current_cpu_limit": 1000,
"current_memory_request": 2560,
"current_memory_limit": 2560,
"cpu_demand": 25,
"cpu_demand_peak": 350,
"memory_demand": 2227,
"memory_demand_peak": 2227,
"tags": {
"Environment": [
"Trial"
],
"Department": [
"Sales"
]
},
"container_cpu_recommendation": {
"action": "reduce_cpu_allocation",
"recommended_cpu_request": "200m",
"reclaimable_cpu": 450,
"recommended_cpu_limit": "500m"
}
}
]
}
}
In the Trigger Condition text box, use the expression builder to build the following conditional expression to match the trigger condition to the event:
( tags.event_type == OVERALLOCATED_CONTAINER_RECOMMENDATION ) && ( tags.platform == kubernetes ) && (tags.event.payload.resources[0].container_cpu_recommendation.action == reduce_cpu_allocation)- To add system or custom tags to the policy, perform the following steps:
- System tags: Select one or more tags from the list of available system tags.
Based on the event, some system tags are displayed. - Custom tags: In the Tags (Optional) section, enter a key-value pair.
Tag key should start with an alphabet and end with an alphanumeric character. Key supports alphanumeric characters and periods, dashes, and underscores.
- System tags: Select one or more tags from the list of available system tags.
- To add action to the policy, click Add Action and perform the following steps by using the action wizard:
- From the Pick an automation tool section, click the connector name.
Only configured connectors are displayed here. The wizard takes you to the next step to select an action. - Click Select against the Resize Deployment action.
The wizard takes you to the next step to configure an action. - Provide the following information:
- Enter the name of the Kubernetes deployment that you want to update.
- Enter the name of the Kubernetes namespace in which the deployment is available.
In Request Body > Spec > Template > Spec > Containers > Item 1, either enter the values, or use the event parameters from the right pane to populate these values:
Field
Description
Name
Name of the container for which you want to allocate the CPU resources
Resources > Limits > Cpu
Recommended CPU limit
Requests > Cpu
Recommended CPU request
- Click Done.
The added action appears in the Action Configuration section on the Create Automation Policies page.
- From the Pick an automation tool section, click the connector name.
- In the Estimated Savings section, enter an approximate time (in minutes) and money (in USD) that you may save by automating this action.
- Select Publish Policy and click Save to publish the policy.