Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Improving installation via Helm #247

Merged
merged 7 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
tags: true
- name: "Build & Deploy Helm"
script:
- docker run -v $TRAVIS_BUILD_DIR/deployment/helm/:/helm -w /helm --entrypoint /helm/build.sh alpine/helm:3.0.0-beta.5 $TRAVIS_TAG
- docker run -v $TRAVIS_BUILD_DIR/deployment/helm/:/helm -w /helm --entrypoint /helm/build.sh alpine/helm:3.2.1 $TRAVIS_TAG
deploy:
- provider: releases
draft: true
Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies:
- name: redis
repository: https://kubernetes-charts.storage.googleapis.com
version: 9.4.3
digest: sha256:63b5c2d6fa6dbceb477ec60d94c9d4f3f14e0ee85738b32880213282ab9a7f0e
generated: "2019-10-26T07:44:45.177984+01:00"
digest: sha256:18dea218d4c6460be6a3b7b203d6668650e1a9dfe42a4859ccdd7f5ebc6b9038
generated: "2020-05-12T14:21:00.129069+01:00"
10 changes: 9 additions & 1 deletion deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.2.0-beta
version: 0.4.0-beta

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: latest

dependencies:
- name: postgresql
version: 6.5.0
repository: "@stable"
- name: redis
version: 9.4.3
repository: "@stable"
34 changes: 31 additions & 3 deletions deployment/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ option for postgres you would add the following to the install/upgrade command
```


# Building the chart
# Local development

## Building the chart

To build and run the chart locally, follow the following steps

Expand All @@ -100,5 +102,31 @@ To build and run the chart locally, follow the following steps
```
1. Build the chart:
```shell script
helm package
```
helm package .
```

## Installing the chart

Installing the chart locally with the following command:

```shell script
helm install postfacto <local-chart.tgz>
```

Will automatically install `postgresql` with persistence enabled, which means the configuration and data
survive `helm uninstall`.

So the next time `postfacto` gets installed, `postgresql` will attempt to generate a new password and fail to authenticate.

As of now there are two solutions to this problem:

1. Disable persistence altogether:
```shell script
helm install postfacto <local-chart.tgz> \
--set postgresql.persistence.enabled=false
```
1. Set `postgresql` password explicitly:
```shell script
helm install postfacto <local-chart.tgz> \
--set postgresql.postgresqlPassword=<postgresql-password>
```
1 change: 0 additions & 1 deletion deployment/helm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ sed -i.bak s/appVersion:.*/appVersion:\ $APP_VERSION/ Chart.yaml

helm repo add stable https://kubernetes-charts.storage.googleapis.com

rm -f Chart.lock # workaround for: https://github.com/helm/helm/issues/6416
helm dependency build

helm package .
37 changes: 0 additions & 37 deletions deployment/helm/requirements.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions deployment/helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "postfacto.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "postfacto.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export SERVICE_NAME=$(kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "postfacto.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
kubectl port-forward service/$SERVICE_NAME 8080:80
{{- end }}