From 07f1e601abcb9d212d15dbdd5f36e077d647867f Mon Sep 17 00:00:00 2001 From: Ffaen Date: Mon, 17 May 2021 02:41:20 +0100 Subject: [PATCH] Update README to add information on env variables (#351) * Update README to add information on env variables References #349 * Set APP_URL to https if TLS enabled --- charts/invoiceninja/Chart.yaml | 2 +- charts/invoiceninja/README.md | 39 ++++++++++++++++++++ charts/invoiceninja/templates/configmap.yaml | 4 ++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/charts/invoiceninja/Chart.yaml b/charts/invoiceninja/Chart.yaml index ad5e6f9..71c2b59 100644 --- a/charts/invoiceninja/Chart.yaml +++ b/charts/invoiceninja/Chart.yaml @@ -13,7 +13,7 @@ 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. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/charts/invoiceninja/README.md b/charts/invoiceninja/README.md index e3d445f..f55cf70 100644 --- a/charts/invoiceninja/README.md +++ b/charts/invoiceninja/README.md @@ -236,10 +236,49 @@ The above command sets the number of replicas to 3 for a highly available (HA) s Alternatively, a YAML file that specifies the values for the parameters can be provided while [installing](https://helm.sh/docs/helm/helm_install/) the chart. For example, +```yaml +# values.yaml +appKey: changeit +replicaCount: 3 +nginx: + replicaCount: 3 +redis: + cluster: + slaveCount: 3 + password: changeit +mariadb: + auth: + rootPassword: changeit + password: changeit +``` + ```bash helm install invoiceninja -f values.yaml invoiceninja/invoiceninja ``` +## Setting Environment Variables + +Should you need to inject any environment variables into the `invoiceninja` container, you can use the `extraEnvVars` option: + +```yaml +# ... values.yaml file +# In this example, we are forcing REQUIRE_HTTPS to be false +extraEnvVars: + - name: REQUIRE_HTTPS + value: 'false' # all values must be strings, so other types must be surrounded in quotes +``` + +Alternatively you can provide the name of an existing `configmap` or `secret` object: + +```bash +kubectl create configmap examplemap --from-literal=REQUIRE_HTTPS='false' +``` + +```yaml +# ... values.yaml file +extraEnvVarsCM: examplemap +``` + ## Upgrading Nothing yet. diff --git a/charts/invoiceninja/templates/configmap.yaml b/charts/invoiceninja/templates/configmap.yaml index 0aa1c57..bdbc7a2 100644 --- a/charts/invoiceninja/templates/configmap.yaml +++ b/charts/invoiceninja/templates/configmap.yaml @@ -13,7 +13,11 @@ metadata: {{- end }} data: {{- if .Values.nginx.ingress.enabled }} + {{- if .Values.nginx.ingress.tls }} + APP_URL: "https://{{ .Values.nginx.ingress.hostname }}" + {{- else }} APP_URL: "http://{{ .Values.nginx.ingress.hostname }}" + {{- end }} {{- else }} APP_URL: "http://{{ include "common.names.fullname" . }}" {{- end }}