|
135 | 135 |
|
136 | 136 | ## Customize EnvoyProxy Deployment Env
|
137 | 137 |
|
138 |
| -You can customize the EnvoyProxy Deployment Env via EnvoyProxy Config like: |
| 138 | +You can customize the EnvoyProxy Deployment Env via EnvoyProxy Config like: |
139 | 139 |
|
140 | 140 | ```shell
|
141 | 141 | cat <<EOF | kubectl apply -f -
|
@@ -187,7 +187,7 @@ spec:
|
187 | 187 | volumes:
|
188 | 188 | - name: certs
|
189 | 189 | secret:
|
190 |
| - secretName: envoy-cert |
| 190 | + secretName: envoy-cert |
191 | 191 | EOF
|
192 | 192 | ```
|
193 | 193 |
|
@@ -220,7 +220,7 @@ After applying the config, you can get the envoyproxy service, and see annotatio
|
220 | 220 |
|
221 | 221 | ## Customize EnvoyProxy Bootstrap Config
|
222 | 222 |
|
223 |
| -You can customize the EnvoyProxy bootstrap config via EnvoyProxy Config. |
| 223 | +You can customize the EnvoyProxy bootstrap config via EnvoyProxy Config. |
224 | 224 | There are two ways to customize it:
|
225 | 225 |
|
226 | 226 | * Replace: the whole bootstrap config will be replaced by the config you provided.
|
@@ -317,6 +317,38 @@ After applying the config, the bootstrap config will be overridden by the new co
|
317 | 317 | Any errors in the configuration will be surfaced as status within the `GatewayClass` resource.
|
318 | 318 | You can also validate this configuration using [egctl translate][].
|
319 | 319 |
|
| 320 | +## Customize EnvoyProxy Horizontal Pod Autoscaler |
| 321 | + |
| 322 | +You can enable [Horizontal Pod Autoscaler](https://github.com/envoyproxy/gateway/issues/703) for EnvoyProxy Deployment. However, before enabling the HPA for EnvoyProxy, please ensure that the [metrics-server](https://github.com/kubernetes-sigs/metrics-server) component is installed in the cluster. |
| 323 | + |
| 324 | +Once confirmed, you can apply it via EnvoyProxy Config as shown below: |
| 325 | + |
| 326 | +```shell |
| 327 | +cat <<EOF | kubectl apply -f - |
| 328 | +apiVersion: gateway.envoyproxy.io/v1alpha1 |
| 329 | +kind: EnvoyProxy |
| 330 | +metadata: |
| 331 | + name: custom-proxy-config |
| 332 | + namespace: envoy-gateway-system |
| 333 | +spec: |
| 334 | + provider: |
| 335 | + type: Kubernetes |
| 336 | + kubernetes: |
| 337 | + envoyHpa: |
| 338 | + minReplicas: 2 |
| 339 | + maxReplicas: 10 |
| 340 | + metrics: |
| 341 | + - resource: |
| 342 | + name: cpu |
| 343 | + target: |
| 344 | + averageUtilization: 60 |
| 345 | + type: Utilization |
| 346 | + type: Resource |
| 347 | +EOF |
| 348 | +``` |
| 349 | + |
| 350 | +After applying the config, the EnvoyProxy HPA (Horizontal Pod Autoscaler) is generated. However, upon activating the EnvoyProxy's HPA, the Envoy Gateway will no longer reference the `replicas` field specified in the `envoyDeployment`, as outlined [here](#customize-envoyproxy-deployment-replicas). |
| 351 | + |
320 | 352 | [Gateway API documentation]: https://gateway-api.sigs.k8s.io/
|
321 |
| -[EnvoyProxy]: ../../api/extension_types#envoyproxy |
| 353 | +[EnvoyProxy]: ../../api/extension_types#envoyproxy |
322 | 354 | [egctl translate]: ../egctl/#validating-gateway-api-configuration
|
0 commit comments