Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
EamonKeane committed Mar 29, 2018
1 parent 7c55d44 commit 7bd2820
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MY_URL=laravel2.squareroute.io # change this to your domain
* Install nginx-ingress with the settings to create RBAC and externalTrafficPolicy to preserve source IPs in the logs. Nginx-ingress is also chosen because it allows for 'sticky sessions', something not yet possible with most other Load Balancers to my knowledge <https://blog.shanelee.name/2017/10/16/kubernetes-ingress-and-sticky-sessions/>.

```bash
helm install stable/nginx-ingress --name nginx-ingress --namespace laravel5 --set rbac.create=true,controller.service.externalTrafficPolicy=Local
helm install stable/nginx-ingress --wait --name nginx-ingress --namespace laravel5 --set rbac.create=true,controller.service.externalTrafficPolicy=Local
```

* Add your nginx-ingress IP address (this takes circa 2 minutes to populate `watch kubectl get svc --namespace laravel5`) as a DNS A record pointing to your laravel URL:
Expand Down Expand Up @@ -122,13 +122,19 @@ docker build . -t ${MY_NGINX_REPO}:latest -f docker/nginx/Dockerfile; docker pus
* Replace the URL in the .env with your url. Note the .env is kept in the helm folder for convenience to make the secret as part of this tutorial. If using this for production, make the secrets separately using `kubectl create secret generic ${SECRET_NAME} --from-file=${SECRET_FILE}` or use a tool to encrypt the secrets such as helm secrets: <https://github.com/futuresimple/helm-secrets>.

```bash
sed -i '' -e "s#https://laravel2.squareroute.io#https://${MY_URL}#g" kubernetes/helm/laravel5/laravel5-env.env
sed -i '' -e "s#laravel2.squareroute.io#${MY_URL}#g" kubernetes/helm/laravel5/laravel5-env.env
```

* Replace the ingress host with your url:

```bash
sed -i '' -e "s#laravel2.squareroute.io#${MY_URL}#g" kubernetes/helm/laravel5/values.yaml
```

* Install laravel5. This will seed the mysql database before creating the php containers using a pre-install job.

```bash
helm upgrade --install --wait --timeout 400 --set ingress.hosts[0]=${MY_URL},ingress.tls[0].hosts[0]=${MY_URL} --namespace laravel5 laravel5 kubernetes/helm/laravel5 --debug --dry-run
helm upgrade --install --wait --timeout 400 --set phpfpmImage.repository=${MY_PHP_REPO},nginxImage.repository=${MY_NGINX_REPO} --namespace laravel5 laravel5 kubernetes/helm/laravel5
```

* After approximately 2 minutes the website will be visible at `https://${MY_URL}`
Expand All @@ -138,7 +144,7 @@ helm upgrade --install --wait --timeout 400 --set ingress.hosts[0]=${MY_URL},ing
For changes to the repository, the same command can be run again. This time it will not perform a database seed, but will only perform the migrations before installing the new pods.

```bash
helm upgrade --install --wait --timeout 400 --set ingress.hosts[0]=${MY_URL},ingress.tls[0].hosts[0]=${MY_URL} --namespace laravel5 laravel5 kubernetes/helm/laravel5 --debug --dry-run
helm upgrade --install --wait --timeout 400 --set phpfpmImage.repository=${MY_PHP_REPO},nginxImage.repository=${MY_NGINX_REPO} --namespace laravel5 laravel5 kubernetes/helm/laravel5
```

## Cleaning Up ##
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/helm/laravel5/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ingress:
# https://laracasts.com/discuss/channels/laravel/mixed-content-issue-content-must-be-served-as-https?page=2
# If you are looking to use SSL for other environments (such as staging) please modify api.php and web.php to forceScheme for those environments
tls:
- secretName: laravel5-demo
- secretName: laravel2.squareroute.io
hosts:
- laravel2.squareroute.io

Expand Down

0 comments on commit 7bd2820

Please sign in to comment.