You can scale your application horizontally by adding more pods to your deployment. The simplest way is to specify the number of replicas in your deployment manifest. This example will run three pods for a deployment, balancing requests between them:
Code Block | ||
---|---|---|
| ||
apiVersion: apps/v1
kind: Deployment
metadata:
name: example
spec:
replicas: 3 |
Autoscaling
Most applications experience fluctuations in traffic both seasonally and throughout the day. You can use the horizontal pod autoscaler to automatically add and remove replicas based on metrics observed in your cluster. Here as an example which automatically scales deployment based on the number of incoming requests per second:
Code Block | ||
---|---|---|
| ||
Info | ||
The AWS Platform Guide now lives at thoughtbot.com Visit Horizontal Scaling to access this page's content |