Autopilot action approvals using kubectl in Rancher
Overview
The general workflow of using an AutopilotRule with approvals enabled consists of the following:
- Create AutopilotRule with approvals enabled
- Approve or Decline the action by using the ActionApproval CRD
The general workflow expands to the following steps. The Example section later will cover a detailed working example.
- Create an AutopilotRule with
enforcement: approvalRequiredin the spec - Wait until the objects meet the conditions specified in the rule. For example, if the rule is to expand a volume when its usage is greater than 50%, wait for this condition.
- Once the conditions are met, list of the action approvals in the namespace. Identity the item in the list for the concerned object.
- Update the
approvalStatefield in the ActionApproval object spec toapprovedordeclined. - Based on whether you approved or declined in the previous step, the action will either proceed or get declined respectively.