☑️ Ensure Deployment has more than one replica configured
When you run two or more replicas per service, you are increasing the availability of the containerized service because you are not relying on a single pod to do all of the work. Furthermore, scaling horizontally by adding pods allows your service to scale and handle larger loads.
Targeted objects by this rule (types of kind
): Deployment
Complexity: medium (What does this mean?)
Policy as code identifier: DEPLOYMENT_INCORRECT_REPLICAS_VALUE
This rule will fail
If the number of replicas
is set to 1
kind: Deployment
spec:
replicas: 1
Rule output in the CLI
$ datree test *.yaml
>> File: failExample.yaml
❌ Ensure Deployment has more than one replica configured [1 occurrence]
💡 Incorrect value for key `replicas` - running 2 or more replicas will increase the availability of the service
How to fix this failure
Set numbers of replicas
to be greater than 1
kind: Deployment
spec:
replicas: 2