Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 72beee4

Browse files
author
Mathieu Benoit
committed
add hpa for ingressgateway + assocaited tips with GitOps
1 parent 7443e91 commit 72beee4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

content/ingress-gateway/deploy-ingress-gateway.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,33 @@ spec:
100100
EOF
101101
```
102102

103+
```Bash
104+
cat <<EOF > ${WORK_DIR}$GKE_CONFIGS_DIR_NAME/$INGRESS_GATEWAY_NAMESPACE/hpa.yaml
105+
apiVersion: autoscaling/v2
106+
kind: HorizontalPodAutoscaler
107+
metadata:
108+
name: ${INGRESS_GATEWAY_NAME}
109+
namespace: ${INGRESS_GATEWAY_NAMESPACE}
110+
spec:
111+
maxReplicas: 5
112+
metrics:
113+
- type: Resource
114+
resource:
115+
name: cpu
116+
target:
117+
type: Utilization
118+
averageUtilization: 80
119+
minReplicas: 3
120+
scaleTargetRef:
121+
apiVersion: apps/v1
122+
kind: Deployment
123+
name: ${INGRESS_GATEWAY_NAME}
124+
EOF
125+
```
126+
{{% notice tip %}}
127+
Note that we are configuring the `replicas` in the `HorizontalPodAutoscaler` and not via the `Deployment` itself, this is a best practice to avoid any conflict with the dynamic value of the `Deployment` `replicas` actually in the Kubernetes cluster managed by the `HorizontalPodAutoscaler` resource.
128+
{{% /notice %}}
129+
103130
```Bash
104131
cat <<EOF > ${WORK_DIR}$GKE_CONFIGS_DIR_NAME/$INGRESS_GATEWAY_NAMESPACE/service-account.yaml
105132
apiVersion: v1

0 commit comments

Comments
 (0)