Skip to content

Commit 352a8f0

Browse files
committed
Merge 2.4 into 2.5
2 parents becf4ff + da718fc commit 352a8f0

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

deployment/kubernetes.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package manager) chart to deploy in a wink on any of these platforms.
1818

1919
1. Build the PHP and NGINX Docker images:
2020

21-
```
21+
```console
2222
docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api --target api_platform_php
2323
docker build -t gcr.io/test-api-platform/nginx -t gcr.io/test-api-platform/nginx:latest api --target api_platform_nginx
2424
docker build -t gcr.io/test-api-platform/varnish -t gcr.io/test-api-platform/varnish:latest api --target api_platform_varnish
@@ -28,15 +28,15 @@ docker build -t gcr.io/test-api-platform/varnish -t gcr.io/test-api-platform/var
2828

2929
Docker client versions <= 18.03:
3030

31-
```
31+
```console
3232
gcloud docker -- push gcr.io/test-api-platform/php
3333
gcloud docker -- push gcr.io/test-api-platform/nginx
3434
gcloud docker -- push gcr.io/test-api-platform/varnish
3535
```
3636

3737
Docker client versions > 18.03:
3838

39-
```
39+
```console
4040
gcloud auth configure-docker
4141
docker push gcr.io/test-api-platform/php
4242
docker push gcr.io/test-api-platform/nginx
@@ -47,42 +47,42 @@ docker push gcr.io/test-api-platform/varnish
4747

4848
Firstly you need to update helm dependencies by running:
4949

50-
```
51-
helm dependency update ./api/helm/api
50+
```console
51+
helm dependency update ./api/helm/api
5252
```
5353

5454
You are now ready to deploy the API!
5555

5656
Deploy your API to the container:
5757

58-
```
59-
helm install ./api/helm/api --namespace=baz --name baz \
60-
--set php.repository=gcr.io/test-api-platform/php \
61-
--set nginx.repository=gcr.io/test-api-platform/nginx \
62-
--set secret=MyAppSecretKey \
63-
--set postgresql.postgresPassword=MyPgPassword \
64-
--set postgresql.persistence.enabled=true \
65-
--set corsAllowOrigin='^https?://[a-z\]*\.mywebsite.com$'
58+
```console
59+
helm install ./api/helm/api --namespace=baz --name baz \
60+
--set php.repository=gcr.io/test-api-platform/php \
61+
--set nginx.repository=gcr.io/test-api-platform/nginx \
62+
--set secret=MyAppSecretKey \
63+
--set postgresql.postgresPassword=MyPgPassword \
64+
--set postgresql.persistence.enabled=true \
65+
--set corsAllowOrigin='^https?://[a-z\]*\.mywebsite.com$'
6666
```
6767

6868
If you prefer to use a managed DBMS like [Heroku Postgres](https://www.heroku.com/postgres) or
6969
[Google Cloud SQL](https://cloud.google.com/sql/docs/postgres/) (recommended):
7070

71-
```
72-
helm install --name api ./api/helm/api \
73-
# ...
74-
--set postgresql.enabled=false \
75-
--set postgresql.url=pgsql://username:password@host/database?serverVersion=9.6
71+
```console
72+
helm install --name api ./api/helm/api \
73+
# ...
74+
--set postgresql.enabled=false \
75+
--set postgresql.url=pgsql://username:password@host/database?serverVersion=9.6
7676
```
7777

7878
If you want to use a managed Varnish such as [Fastly](https://www.fastly.com) for the invalidation cache mechanism
7979
provided by API Platform:
8080

81-
```
82-
helm install --name api ./api/helm/api \
83-
# ...
84-
--set varnish.enabled=false \
85-
--set varnish.url=https://myvarnish.com
81+
```console
82+
helm install --name api ./api/helm/api \
83+
# ...
84+
--set varnish.enabled=false \
85+
--set varnish.url=https://myvarnish.com
8686
```
8787

8888
Finally, build the `client` and `admin` JavaScript apps and [deploy them on a static
@@ -92,6 +92,9 @@ website hosting service](https://create-react-app.dev/docs/deployment/).
9292

9393
Before running your application for the first time, be sure to create the database schema:
9494

95+
```console
96+
PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
97+
kubectl --namespace=bar exec -it $PHP_POD -- bin/console doctrine:schema:create
9598
```
9699
PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
97100
kubectl --namespace=bar exec -it $PHP_POD -- bin/console doctrine:schema:create
@@ -101,7 +104,7 @@ Before running your application for the first time, be sure to create the databa
101104
102105
We noticed that some tiller RBAC trouble occurred. You can usually resolve it by running:
103106
104-
```
107+
```console
105108
kubectl create serviceaccount --namespace kube-system tiller
106109
serviceaccount "tiller" created
107110

0 commit comments

Comments
 (0)