Actions is currently in beta. Please read the documentation carefully.
Actions is only available with a Kubecost Enterprise plan.
The Actions page is where you can create scheduled savings actions that Kubecost will execute for you. The Actions page supports creating actions for multiple turndown and right-sizing features.
Actions are only able to be applied to your primary cluster. To use Actions on a secondary cluster, you must manually switch to that cluster via front end.
The Actions page will exist inside the Savings folder in the left navigation, but must first be enabled before it appears. The two steps below which enable Kubecost Actions do not need to be performed sequentially as written.
Because the Actions page is currently a beta feature, it does not appear as part of Kubecost's base functionality. To enable alpha features, select Settings from the left navigation. Then toggle on the Enable experimental features switch. Select Save at the bottom of the Settings page to confirm your changes. The Actions page will now appear in your left navigation, but you will not be able to perform any actions until you've enabled the Cluster Controller (see below).
Write access to your cluster is also required to access Kubecost Actions. To enable the Cluster Controller, see our Cluster Controller doc for full instructions. Once you have completed this, you should have full accessibility.
Some features included in Kubecost Actions are only available in GKE/EKS environments. See the Cluster Controller doc for more clarity on which features you will have access to after enabling the Cluster Controller.
On the Actions page, select Create Action in the top right. The Create New Action window opens.
You will have the option to perform one of several available Actions:
- Cluster Turndown: Schedule clusters to spin down when unused and back up when needed
- Request Sizing: Ensure your containers aren't over-provisioned
- Cluster Sizing: Configure your cluster in the most cost-effective way
- Namespace Turndown: Schedule unused workloads to spin down
- Guided Sizing: Continuous container and node right-sizing
Selecting one of these Actions will take you off the Actions page to a Action-specific page which will allow to perform the action in moments.
If the Cluster Controller was not properly enabled, the Create New Action window will inform you and limit functionality until the Cluster Controller has been successfully enabled.
Cluster Turndown is a scheduling feature that allows you to reduce costs for clusters when they are not actively being used, without spinning them down completely. This is done by temporarily removing all existing nodes except for master nodes. The Cluster Turndown page allows you to create a schedule for when to turn your cluster down and up again.
Selecting Cluster Turndown from the Create new action window will take you to the Cluster Turndown page. The page should display available clusters for turndown. Begin by selecting Create Schedule next to the cluster you wish to turn down. Select what date and time you wish to turn down the cluster, and what date and time you wish to turn it back up. Select Apply to finalize.
You can delete an existing turndown schedule by selecting the trash can icon.
See the existing documentation on Automatic Request Right-Sizing to learn more about this feature. If you have successfully enabled the Cluster Controller, you can skip the Setup section of that article.
Cluster Sizing will provide right-sizing recommendations for your cluster by determining the cluster's needs based on the type of work running, and the resource requirements. You will receive a simple (uses one node type) and a complex (uses two or more node types) recommendation.
Kubecost may hide the complex recommendation when it is more expensive than the simple recommendation, and present a single recommendation instead.
Visiting the Cluster Sizing Recommendations page from the Create New Action window will immediately prompt you with a suggested recommendation that will replace your current node pools with the displayed node pools. You can select Adopt to immediately resize, or select Cancel if you want to continue exploring.
Namespace turndown allows you to take action to delete your abandoned workloads. Instead of requiring the user to manually size down or delete their unused workloads, Kubecost can delete namespaces full of idle pods in one moment or on a continual basis. This can be helpful for routine cleanup of neglected resources. Namespace turndown is supported on all cluster types.
Selecting Namespace Turndown from the Create new action window will open the Namespace Turndown page.
Begin by providing a name for your Action in the Job Name field. For the schedule, provide a cron string that determines when the turndown occurs (leave this field as
0 0 * * *by default to perform turndown every night at midnight).
For schedule type, select Scheduled or Smart from the dropdown.
- Scheduled turndown will delete all non-ignored namespaces.
- Smart turndown will confirm that all workloads in the namespace are idle before deleting.
Then you can provide optional values for the following fields:
- Ignore Targets: Filter out namespaces you don't want turned down. Supports "wildcard" filtering: by ending your filter with
*, you can filter for multiple namespaces which include that filter. For example, entering
kube*will prevent any namespace featuring
kubefrom being turned down. Namespace turndown will ignore namespaces named
defaultnamespace, and the namespace the Cluster Controller is enabled on.
- Ignore labels: Filter out key-alue labels that you don't want turned down.
Select Create Schedule to finalize.
In the first collapsible tab, you can configure your container request sizing.
- The Auto resizing toggle switch will determine whether you want to perform a one-time resize, or a continuous auto-resize. Default is one-time (off).
- Frequency: Only available when Auto resizing is toggled on. Determines how frequently right-sizing will occur. Options are Day, Week, Monthly, or Quarterly.
- Start Time: Only available when Auto resizing is toggled on. Determines the day, and time of day, that auto-resizing will begin occurring. Will default to the current date and time if left blank.
Select Start One-Time Resize/Start Auto-Resizing Now to finalize.
In the second collapsible tab, you can configure continuous cluster sizing.
- Architecture: Supports x86 or ARM.
- Target Utilization: How much excess resource nodes should be configured with to account for variable or increasing resource consumption. Default is 0.8.
- Frequency: Determines how frequently right-sizing will occur. Options are Day, Week, Monthly, or Quarterly.
- Start Time: Determines the day, and time of day, that auto-resizing will begin occurring. Will default to the current date and time if left blank.
Select Enable Auto-Resizing Now to finalize.
Once you have successfully created an Action, you will see it on the Actions page under Scheduled Actions. Here you will be able to view a Schedule, the Next Run, Affected Workloads, and the Status. You can select Details to view more information about a specific Action, or delete the scheduled Action by selecting the trash can icon.