Skip to content

Commit 9f17494

Browse files
committed
Update Kubernetes deployment guide and fix CI linting issues
- Update Helm chart values to match current bitnami postgresql auth structure - Fix corsAllowOrigin prefix (php.corsAllowOrigin) - Update demo workflow link to current branch (4.3) - Clarify FrankenPHP/Caddy architecture in Messenger section - Fix Prettier/markdownlint conflict by disabling MD030 rule - Reformat laravel/index.md with prettier 3.8.1 Fixes #1450
1 parent 806e55c commit 9f17494

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ MD004:
1111
style: dash
1212
MD007:
1313
indent: 4
14+
MD030: false

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 all
209+
unused ENV variables.
208210

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

laravel/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Let's discover how to use API Platform with Laravel!
4444
API Platform can be installed easily on new and existing Laravel projects. If you already have an
4545
existing project, skip directly to the next section.
4646

47-
API Platform 4.2 supports **Laravel 11 and Laravel 12** (`laravel/framework ^11.0 || ^12.0`).
48-
For Laravel 13 support, use API Platform 4.3.
47+
API Platform 4.2 supports **Laravel 11 and Laravel 12** (`laravel/framework ^11.0 || ^12.0`). For
48+
Laravel 13 support, use API Platform 4.3.
4949

5050
If you don't have an existing Laravel project, [create one](https://laravel.com/docs/installation).
5151
All Laravel installation methods are supported. For instance, you can use Composer:

0 commit comments

Comments
 (0)