> [!CAUTION]
> You are currently viewing version 1.4 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.4 (unsupported)</button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/scale-and-autoscale.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/scale-and-autoscale.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/scale-and-autoscale.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/scale-and-autoscale.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/scale-and-autoscale.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/scale-and-autoscale.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/scale-and-autoscale.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/scale-and-autoscale.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/scale-and-autoscale.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/scale-and-autoscale.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/scale-and-autoscale.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/scale-and-autoscale.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/scale-and-autoscale.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/scale-and-autoscale.md.txt)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/scale-and-autoscale.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/scale-and-autoscale.md.txt)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/scale-and-autoscale.md.txt)

You can scale most services running in Kubernetes from the
command line or in a configuration override. You can set scaling
parameters for Apigee hybrid runtime services in the
[`overrides.yaml` file](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/customize-services.md.txt).

| Service | Implemented As | Scaling |
|---|---|---|
| **Cassandra** | ApigeeDatastore (CRD) | See [Scaling Cassandra](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/cassandra-scaling.md.txt#scaling-cassandra). |
| **Ingress/LoadBalancer** | [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) | Anthos Service Mesh uses [Horizontal Pod Autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) (HPAs). |
| **Logger** | [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) | DaemonSets manage replicas of a pod on all nodes, so they scale when you scale the pods themselves. |
| **MART Apigee Connect Watcher** | ApigeeOrganization (CRD) | To scale via configuration, increase the value of the Deployment's `replicaCountMin` configuration property for the `mart`, `watcher`, and/or `connectAgent` stanzas. For example: ``` mart: replicaCountMin: 2 replicaCountMax: 1 watcher: replicaCountMin: 2 replicaCountMax: 1 connectAgent: replicaCountMin: 2 replicaCountMax: 1 ``` These Deployments use a Horizontal Pod Autoscaler for autoscaling. Set the Deployment object's `targetCPUUtilizationPercentage` property to the threshold for scaling up; when this value is exceeded, Kubernetes adds pods up to the value of `replicaCountMax`. For more information on setting configuration properties, see [Manage runtime plane components](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/customize-services.md.txt). |
| **Runtime Synchronizer UDCA** | ApigeeEnvironment (CRD) | To scale via configuration, increase the value of the `replicaCountMin` property for the `udca`, `synchronizer`, and/or `runtime` stanzas in the overrides file. For example: ``` synchronizer: replicaCountMin: 10 replicaCountMax: 1 runtime: replicaCountMin: 10 replicaCountMax: 1 udca: replicaCountMin: 10 replicaCountMax: 1 ``` **Note:** These changes apply to ALL environments in the overrides file. If you wish to customize scaling for each environment see [Advanced configurations](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/scale-and-autoscale.md.txt#advancedconfigs) below. These deployments use a Horizontal Pod Autoscaler for autoscaling. Set the Deployment object's `targetCPUUtilizationPercentage` property to the threshold for scaling up; when this value is exceeded, Kubernetes adds pods up to the value of `replicaCountMax`. For more information on setting configuration properties, see [Manage runtime plane components](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/customize-services.md.txt). |

## Advanced configurations


In some scenarios, you may need to use advanced scaling options. Example scenarios include:

- Setting different scaling options for each environment. For example, where env1 has a `minReplica` of 5 and env2 has a `minReplica` of 2.
- Setting different scaling options for each component within an environment. For example, where the `udca` component has a `maxReplica` of 5 and the `synchronizer` component has a `maxReplica` of 2.


The following example shows how to use the `kubernetes patch` command to change
the `maxReplicas` property for the `runtime` component:


1. Create environment variables to use with the command:

   ```
   export ENV=my-environment-name
   export NAMESPACE=apigee  #the namespace where apigee is deployed
   export COMPONENT=runtime #can be udca or synchronizer
   export MAX_REPLICAS=2
   export MIN_REPLICAS=1
   ```
2. Apply the patch. Note that this example assumes that `kubectl` is in your `PATH`:

   ```
   kubectl patch apigeeenvironment -n $NAMESPACE \
     $(kubectl get apigeeenvironments -n $NAMESPACE -o jsonpath='{.items[?(@.spec.name == "'$ENV'" )]..metadata.name}') \
     --patch "$(echo -e "spec:\n  components:\n    $COMPONENT:\n      autoScaler:\n        maxReplicas: $MAX_REPLICAS\n        minReplicas: $MIN_REPLICAS")" \
     --type merge
   ```
3. Verify the change:

   ```
   kubectl get hpa -n $NAMESPACE
   ```