Skip to content

Commit 50aade5

Browse files
dunglasalanpoulain
andauthored
add a deploy on Minikube entry (#1315)
* add a deploy on Minikube entry * Update deployment/minikube.md Co-authored-by: Alan Poulain <[email protected]> * Update deployment/minikube.md Co-authored-by: Alan Poulain <[email protected]> Co-authored-by: Alan Poulain <[email protected]>
1 parent ad8b2f1 commit 50aade5

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

deployment/minikube.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Deploying to Minikube
2+
3+
## Install Minikube
4+
5+
If you haven't an existing installation of Minikube on your computer, [follow the official tutorial](https://minikube.sigs.k8s.io/docs/start/).
6+
7+
When Minkube is installed, start the cluster:
8+
9+
minikube start --addons registry --addons dashboard
10+
11+
The previous command starts Minikube with a Docker registry (we'll use it in the next step) and with the Kubernetes dashboard.
12+
13+
If you use Mac or Windows, [refer to the documentation](https://minikube.sigs.k8s.io/docs/handbook/registry/#docker-on-macos) to learn how to expose the Docker registry installed as an addon on the port 5000 of the host.
14+
15+
Finally, [install Helm](https://helm.sh/docs/intro/install/). We'll use it to deploy the application in the cluster thanks to the chart provided in the API Platform distribution.
16+
17+
## Building and Pushing Docker Images
18+
19+
First, build the images:
20+
21+
docker build -t localhost:5000/php api --target api_platform_php
22+
docker build -t localhost:5000/caddy caddy --target api_platform_caddy
23+
docker build -t localhost:5000/pwa pwa --target api_platform_pwa_prod
24+
25+
Then push the images in the registry installed in Minikube:
26+
27+
docker push localhost:5000/php
28+
docker push localhost:5000/caddy
29+
docker push localhost:5000/pwa
30+
31+
## Deploying
32+
33+
Finally, deploy the project using the Helm chart:
34+
35+
$ helm install my-project helm/api-platform \
36+
--set php.image.repository=localhost:5000/php \
37+
--set php.image.tag=latest \
38+
--set caddy.image.repository=localhost:5000/caddy \
39+
--set caddy.image.tag=latest \
40+
--set pwa.image.repository=localhost:5000/pwa \
41+
--set pwa.image.tag=latest
42+
43+
Copy and paste the commands displayed in the terminal to enable the port forwarding then go to `http://localhost:8080` to access your application!
44+
45+
Run `minikube dashboard` at any moment to see the state of your deployments.

outline.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ chapters:
8787
path: deployment
8888
items:
8989
- index
90-
- kubernetes
9190
- docker-compose
91+
- kubernetes
92+
- minikube
9293
- heroku
9394
- traefik
9495
- title: General Information

0 commit comments

Comments
 (0)