Manage Resource Quotas with Policy

Use Apcera policy to establish and automate quota limits on individual containers, containers in a namespace, or cluster-wide.

Requirements:

  • Apcera Platform is installed and running (latest version)
  • Log in to the web console for your cluster, for example: https://console..apcera-platform.io. (Run apcera-setup info to get the web console URL for your cluster.)

1: Scale an app

Select Apps in the left navigation.

Select the continuum-guide job in the app list.

Tutorial Image

The continuum-guide app is the documentation that runs in the cluster. Typically you run 2 instances of this app.

Scale the number of instances by editing the text input field beside the Status > Desired Instances label.

Increase the number of instances from 2 to 3.

Tutorial Image

Save your changes by clicking the checkmark button.

Momentarily you should see three instances of the container running.

2: Author quota policy to limit the number of container instances

Select the Policy section in the left navigation.

Click Create to create a new policy.

Name the policy document docs-quota.

In the policy editor, add the following policy that limits the number of instances of the app.

quota::/apcera::continuum-guide {
  { max.instances 3 }
}

Tutorial Image

Click Create Document and verify that the policy is successfully created.

Tutorial Image

NOTE: In this example we are setting the policy on the individual app. You could also apply policy more broadly at the namespace or root resource level.

3: Test quota policy

Return to the App screen for the continuum-guide job.

Scale the continuum-guide app from 3 to 4 instances.

Tutorial Image

Per policy when you attempt to save you are notified that you cannot exceed the quota.

Tutorial Image

This brief tutorial demonstrates how easy it is to set and automate app resource allocation using Apcera policy. For simplicity we have applied quota policy to an individual app. You can also apply policy more broadly, such as on a namespace or resource type. See the Apcera policy documentation for details.

4: Scale the app down

Select the continuum-guide job in the app list.

Scale the number of instances by editing the text input field beside the Status > Desired Instances label.

Decrease the number of instances from 3 to 2.