Skip to content

Commit dd33139

Browse files
authored
fix(kubernetes): missing code blocks (#1812)
1 parent 16a9159 commit dd33139

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

deployment/kubernetes.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,49 +18,61 @@ 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+
```
2122
docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api
2223
docker build -t gcr.io/test-api-platform/nginx -t gcr.io/test-api-platform/nginx:latest -f api/Dockerfile.nginx api
2324
docker build -t gcr.io/test-api-platform/varnish -t gcr.io/test-api-platform/varnish:latest -f api/Dockerfile.varnish api
25+
```
2426

2527
2. Push your images to your Docker registry, example with [Google Container Registry](https://cloud.google.com/container-registry/):
2628

29+
```
2730
gcloud docker -- push gcr.io/test-api-platform/php
2831
gcloud docker -- push gcr.io/test-api-platform/nginx
2932
gcloud docker -- push gcr.io/test-api-platform/varnish
33+
```
3034

3135
## Deploying
3236

3337
Firstly you need to update helm dependencies by running:
3438

39+
```
3540
helm dependency update ./api/helm/api
41+
```
3642

3743
You are now ready to deploy the API!
3844

3945
Deploy your API to the container:
4046

47+
```
4148
helm install ./api/helm/api --namespace=baz --name baz \
4249
--set php.repository=gcr.io/test-api-platform/php \
4350
--set nginx.repository=gcr.io/test-api-platform/nginx \
4451
--set secret=MyAppSecretKey \
4552
--set postgresql.postgresPassword=MyPgPassword \
4653
--set postgresql.persistence.enabled=true \
4754
--set corsAllowOrigin='^https?://[a-z\]*\.mywebsite.com$'
55+
```
4856

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

60+
```
5261
helm install --name api ./api/helm/api \
5362
# ...
5463
--set postgresql.enabled=false \
5564
--set postgresql.url=pgsql://username:password@host/database?serverVersion=9.6
65+
```
5666

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

70+
```
6071
helm install --name api ./api/helm/api \
6172
# ...
6273
--set varnish.enabled=false \
6374
--set varnish.url=https://myvarnish.com
75+
```
6476

6577
Finally, build the `client` and `admin` JavaScript apps and [deploy them on a static
6678
website hosting service](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment).
@@ -69,5 +81,7 @@ website hosting service](https://github.com/facebookincubator/create-react-app/b
6981

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

84+
```
7285
PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
7386
kubectl --namespace=bar exec -it $PHP_POD -- bin/console doctrine:schema:create
87+
```

0 commit comments

Comments
 (0)