Skip to content

Commit db95aa6

Browse files
authored
Add replica count on pwa (#424)
1 parent 1097764 commit db95aa6

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
echo "URL=api-platform.com" >> "$GITHUB_ENV"
8282
echo 'CORS=["https://api-platform.com", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
8383
echo "NAMESPACE=prod-website" >> "$GITHUB_ENV"
84+
echo "REPLICA=3" >> "$GITHUB_ENV"
8485
else
8586
CONTEXT=nonprod
8687
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
@@ -91,6 +92,7 @@ jobs:
9192
export RELEASE_NAME=${{ github.ref_name }}
9293
fi
9394
echo "URL=$RELEASE_NAME.apip.preprod-tilleuls.ovh" >> "$GITHUB_ENV"
95+
echo "REPLICA=1" >> "$GITHUB_ENV"
9496
echo "NAMESPACE=nonprod-website" >> "$GITHUB_ENV"
9597
echo 'CORS=["https://${{ env.RELEASE_NAME}}.apip.preprod-tilleuls.ovh", "http://localhost", "https://localhost", "http://localhost:3000"]' >> "$GITHUB_ENV"
9698
fi
@@ -126,6 +128,7 @@ jobs:
126128
--set=pwa.resources.requests.cpu=500m \
127129
--set=pwa.resources.requests.memory=1400Mi \
128130
--set=pwa.resources.limits.memory=1400Mi \
131+
--set=pwa.replicaCount=${{ env.REPLICA }} \
129132
--set=bucket.s3Upstream=storage.googleapis.com \
130133
--set=bucket.s3Name=api-platform-website-v3 \
131134
--set=service.type=NodePort \
@@ -171,6 +174,7 @@ jobs:
171174
--set=pwa.resources.requests.cpu=500m \
172175
--set=pwa.resources.requests.memory=1400Mi \
173176
--set=pwa.resources.limits.memory=1400Mi \
177+
--set=pwa.replicaCount=${{ env.REPLICA }} \
174178
--set=php.corsAllowOrigin="^$(echo "${{ join(fromJSON(env.CORS), '|') }}" | sed 's/\./\\./g')$" \
175179
--set=github.key=${{ secrets.gh-key }} \
176180
--set=next.rootUrl=${{ env.URL }} \

helm/api-platform/templates/pwa-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
{{- include "api-platform.labelsPWA" . | nindent 4 }}
77
spec:
88
{{- if not .Values.autoscaling.enabled }}
9-
replicas: {{ .Values.replicaCount }}
9+
replicas: {{ .Values.pwa.replicaCount }}
1010
{{- end }}
1111
selector:
1212
matchLabels:

helm/api-platform/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ php:
2020
- "192.168.0.0/16"
2121

2222
pwa:
23+
replicaCount: 1
2324
image:
2425
repository: "chart-example.local/api-platform/pwa"
2526
pullPolicy: IfNotPresent

0 commit comments

Comments
 (0)