Skip to content

Commit f6a67db

Browse files
committed
Merge 2.7 into 3.0
2 parents bd8daf6 + 55f8969 commit f6a67db

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

deployment/kubernetes.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Change the name "test-api-platform" to your Google project ID (not the project n
2929
[Quickstart Google Cloud](https://cloud.google.com/sdk/docs/quickstart?hl=de)
3030
If you do not have gcloud yet, install it with these command.
3131

32-
```
32+
```console
3333
curl https://sdk.cloud.google.com | bash
3434
```
3535

@@ -38,15 +38,15 @@ curl https://sdk.cloud.google.com | bash
3838
Versioning: The 0.1.0 is the version. This value should be the same as the attribute `appVersion` in `Chart.yaml`.
3939
Infos for [Google Container pulling and pushing](https://cloud.google.com/container-registry/docs/pushing-and-pulling)
4040

41-
```
41+
```console
4242
docker build -t gcr.io/test-api-platform/php:0.1.0 -t gcr.io/test-api-platform/php:latest api --target api_platform_php
4343
docker build -t gcr.io/test-api-platform/caddy:0.1.0 -t gcr.io/test-api-platform/caddy:latest api --target api_platform_caddy
4444
docker build -t gcr.io/test-api-platform/pwa:0.1.0 -t gcr.io/test-api-platform/pwa:latest pwa --target api_platform_pwa_prod
4545
```
4646

4747
#### 2. Push your images to your Docker registry
4848

49-
```
49+
```console
5050
gcloud auth configure-docker
5151
docker push gcr.io/test-api-platform/php
5252
docker push gcr.io/test-api-platform/caddy
@@ -55,7 +55,7 @@ docker push gcr.io/test-api-platform/pwa
5555

5656
Optional push the version images:
5757

58-
```
58+
```console
5959
docker push gcr.io/test-api-platform/php:0.1.0
6060
docker push gcr.io/test-api-platform/caddy:0.1.0
6161
docker push gcr.io/test-api-platform/pwa:0.1.0
@@ -70,15 +70,15 @@ The result should look similar to these images.
7070

7171
### 1. Check the Helm version
7272

73-
```
73+
```console
7474
helm version
7575
```
7676

7777
If you are using version 2.x follow this [guide to migrate Helm to v3](https://helm.sh/docs/topics/v2_v3_migration/#helm)
7878

7979
### 2. Firstly you need to update helm dependencies by running
8080

81-
```
81+
```console
8282
helm dependency update ./helm/api-platform
8383
```
8484

@@ -87,13 +87,13 @@ Actual this is [bitnami/postgresql](https://bitnami.com/stack/postgresql/helm),
8787

8888
### 3. Optional: If you made changes to the Helm chart, check if its format is correct
8989

90-
```
90+
```console
9191
helm lint ./helm/api-platform
9292
```
9393

9494
### 4. Deploy your API to the container
9595

96-
```
96+
```console
9797
helm upgrade main ./helm/api-platform --namespace=default --create-namespace --wait \
9898
--install \
9999
--set "php.image.repository=gcr.io/test-api-platform/php" \
@@ -125,7 +125,7 @@ get access on your local machine to the deploy. See image below.
125125
If you prefer to use a managed DBMS like [Heroku Postgres](https://www.heroku.com/postgres) or
126126
[Google Cloud SQL](https://cloud.google.com/sql/docs/postgres/) (recommended):
127127

128-
```
128+
```console
129129
helm upgrade api-platform ./helm/api-platform \
130130
# ...
131131
--set postgresql.enabled=false \
@@ -140,7 +140,7 @@ site hosting service](https://create-react-app.dev/docs/deployment/).
140140
You can access the php container of the pod with the following command.
141141
In this example the symfony console is called.
142142

143-
```
143+
```console
144144
CADDY_PHP_POD=$(kubectl --namespace=default get pods -l app.kubernetes.io/name=api-platform -o jsonpath="{.items[0].metadata.name}")
145145
kubectl --namespace=default exec -it $CADDY_PHP_POD -c api-platform-php -- bin/console
146146
```
@@ -168,7 +168,9 @@ You can upgrade with the same command from the installation and pass all paramet
168168
Infos about [best practices for tagging images for kubernetes](https://kubernetes.io/docs/concepts/containers/images/)
169169
You have to use the *.image.pullPolicy=Always see the last 3 parameters.
170170

171-
```
171+
```console
172+
PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
173+
kubectl --namespace=bar exec -it $PHP_POD -- bin/console doctrine:schema:create
172174
helm upgrade api-platform ./helm/api-platform --namespace=default \
173175
--set "php.image.repository=gcr.io/test-api-platform/php" \
174176
--set php.image.tag=latest \
@@ -197,7 +199,7 @@ Start by creating a new template for the queue-worker-deployment. The `deploymen
197199

198200
Add the following lines under `containers` to overwrite the command.
199201

200-
```
202+
```yaml
201203
command:
202204
{{ range .Values.queue_worker.command }}
203205
- {{ . | quote }}
@@ -210,14 +212,14 @@ args:
210212

211213
Here is an example on how to use it from your `values.yaml`:
212214

213-
```
215+
```yaml
214216
command: ['bin/console']
215217
commandArgs: ['messenger:consume', 'async', '--memory-limit=100M']
216218
```
217219
218220
The `readinessProbe` and the `livenessProble` can not use the default `docker-healthcheck` but should test if the command is running.
219221

220-
```
222+
```yaml
221223
readinessProbe:
222224
exec:
223225
command: ["/bin/sh", "-c", "/bin/ps -ef | grep messenger:consume | grep -v grep"]

0 commit comments

Comments
 (0)