Skip to content

Commit 09cd496

Browse files
committed
Update Kubernetes deployment guide to match current Helm chart
Fixes #1450
1 parent 806e55c commit 09cd496

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

deployment/kubernetes.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ helm upgrade main ./helm/api-platform --namespace=default --create-namespace --w
113113
--set "pwa.image.repository=gcr.io/test-api-platform/pwa" \
114114
--set pwa.image.tag=latest \
115115
--set php.appSecret='!ChangeMe!' \
116-
--set postgresql.postgresqlPassword='!ChangeMe!' \
117-
--set postgresql.persistence.enabled=true \
118-
--set "corsAllowOrigin=^https?:\/\/[a-z]*\.mywebsite.com$"
116+
--set postgresql.global.postgresql.auth.password='!ChangeMe!' \
117+
--set postgresql.primary.persistence.enabled=true \
118+
--set "php.corsAllowOrigin=^https?:\/\/[a-z]*\.mywebsite.com$"
119119
```
120120

121121
The `"` are necessary for Windows. Use ^ on Windows instead of \ to split commands into multiple
122122
lines. You can add the parameter `--dry-run` to check upfront if anything is correct. Replace the
123123
values with the image parameters from the stage above. The parameter `php.appSecret` is the
124124
`AppSecret` from ./.env Fill the rest of the values with the correct settings. For available options
125-
see /helm/api-platform/values.yaml. If you want a test deploy you can set corsAllowOrigin='\*'
125+
see /helm/api-platform/values.yaml. If you want a test deploy you can set php.corsAllowOrigin='\*'
126126

127127
After a successful installation, there is a message at the end. You can copy these commands and
128128
execute them to set a port-forwarding and get access on your local machine to the deploy. See image
@@ -140,8 +140,8 @@ helm upgrade api-platform ./helm/api-platform \
140140
--set postgresql.url=pgsql://username:password@host/database?serverVersion=13
141141
```
142142

143-
Finally, build the `pwa` (client and admin) JavaScript apps and
144-
[deploy them on a static site hosting service](https://create-react-app.dev/docs/deployment/).
143+
The PWA (Next.js) is deployed alongside the PHP container through the Helm chart. FrankenPHP
144+
automatically proxies requests to the PWA service.
145145

146146
## Access the container
147147

@@ -186,25 +186,27 @@ helm upgrade api-platform ./helm/api-platform --namespace=default \
186186
--set "pwa.image.repository=gcr.io/test-api-platform/pwa" \
187187
--set pwa.image.tag=latest \
188188
--set php.appSecret='!ChangeMe!' \
189-
--set postgresql.postgresqlPassword='!ChangeMe!' \
190-
--set postgresql.persistence.enabled=true \
191-
--set "corsAllowOrigin=^https?://[a-z\]*\.mywebsite.com$" \
189+
--set postgresql.global.postgresql.auth.password='!ChangeMe!' \
190+
--set postgresql.primary.persistence.enabled=true \
191+
--set "php.corsAllowOrigin=^https?://[a-z\]*\.mywebsite.com$" \
192192
--set php.image.pullPolicy=Always \
193193
--set pwa.image.pullPolicy=Always
194194
```
195195

196196
## GitHub Actions Example for deployment
197197

198198
You can find a
199-
[complete deploy command for GKE](https://github.com/api-platform/demo/blob/4.1/.github/workflows/cd.yml)
199+
[complete deploy command for GKE](https://github.com/api-platform/demo/blob/4.3/.github/workflows/cd.yml)
200200
on the [demo project](https://github.com/api-platform/demo/):
201201

202202
## Symfony Messenger
203203

204204
Running Pods with the Messenger Component to consume queues requires additions to the Helm chart.
205205

206206
Start by creating a new template for the queue-worker-deployment. The `deployment.yaml` can be used
207-
as template, the caddy container and all unused ENV variables should be removed.
207+
as template. Since the PHP image uses FrankenPHP (which embeds Caddy as web server), you should
208+
replace the default command to run the Messenger consumer instead of the web server, and remove
209+
all unused ENV variables.
208210

209211
Add the following lines under `containers` to overwrite the command.
210212

0 commit comments

Comments
 (0)