Managing service resources
Working with defaults and overrides for resources
Last updated
Was this helpful?
Working with defaults and overrides for resources
Last updated
Was this helpful?
Both the default configuration and the environment-specific configuration include a resources
section, which contains resource defaults for:
CPU limits and requests (required)
Memory limits and requests (required)
Replicas (required)
Storage type and size
These resources are based on Kubernetes definitions of resources. You can read more about resources .
Here is an example default resources stanza:
Let's take a look at how to make the following changes to the defaults:
Add extra memory for a frontend
service in all environments.
Deploy two backend
replicas in all environments.
Specify five backend
replicas and ten frontend
replicas in our production environment.
For the examples that follow, the resources defaults look like this:
frontend
service in all environmentsIn the following snippet, we set memory limits
to 4Gi and requests
to 500Mi:
Now every environment will have a 4Gi memory limit and a 500Mi request value for each frontend
instance. Every other service instance will have a 2Gi memory limit and 100Mi request value.
backend
replicas in all environmentsIn the default environment configuration, override the default value for replicas
in the services
section for backend
:
Now every environment we deploy based on our default environment configuration will deploy two instances of the backend
service and one instance of each other service.
backend
replicas and ten frontend
replicas in our production environmentHere's how we would set the number of replicas for frontend
and backend
:
By overriding the defaults for replicas in the environment-specific configuration, your production environment will deploy with ten frontend
and five backend
instances running in the cluster. These changes are specific to your production environment, so other environments will not be affected.
You can override the resource defaults in the , either in the services
section or in the template for a particular environment.
In order to override resource defaults for our production environment, we need to create a production space and modify the .