Skip to content

Commit

Permalink
Merge pull request #69 from hiveco/master
Browse files Browse the repository at this point in the history
Allow disabling Postgres subchart and using external Postgres instance
  • Loading branch information
armandleopold committed Feb 25, 2023
2 parents 5978321 + bdb9187 commit 2f86cbd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion charts/doccano/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: doccano
appVersion: 1.8.0
version: 2.0.6
version: 2.0.7
description: A Helm chart for doccano, Open source text annotation tool for machine learning practitioner.
home: https://doccano.herokuapp.com/
icon: https://raw.githubusercontent.com/doccano/doccano/master/docs/images/logo/doccano.png
Expand All @@ -13,6 +13,7 @@ maintainers:
kubeVersion: ">= 1.14.0-0"
dependencies:
- name: postgresql
condition: postgresql.installAsDependency
repository: https://charts.bitnami.com/bitnami
version: 11.8.1
keywords:
Expand Down
2 changes: 2 additions & 0 deletions charts/doccano/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ The following table lists the configurable parameters of the chart and their def
| `persistence.replicas` | PVC storage class replicas (if possible) | `1` |
| `persistence.volumeName` | Directory name | `data` |
| `persistence.mountPath` | Directory mount path | `/data` |
| `postgresql.installAsDependency` | Install Postgres as a subchart (disable to use an external instance) | `true` |
| `postgresql.host` | Host of the external Postgres instance (if not using internal one) | `nil` |
11 changes: 11 additions & 0 deletions charts/doccano/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Create postgres host.
*/}}
{{- define "doccano.postgres_host" -}}
{{- if .Values.postgresql.installAsDependency -}}
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 -}}
{{- else -}}
{{- .Values.postgresql.host -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/doccano/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
name: doccano-password
optional: false
- name: DATABASE_URL
value: "postgres://{{ .Values.postgresql.global.postgresql.auth.username }}:{{ .Values.postgresql.global.postgresql.auth.password }}@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.global.postgresql.auth.database }}?sslmode=disable"
value: "postgres://{{ .Values.postgresql.global.postgresql.auth.username }}:{{ .Values.postgresql.global.postgresql.auth.password }}@{{ include "doccano.postgres_host" . }}:5432/{{ .Values.postgresql.global.postgresql.auth.database }}?sslmode=disable"
{{- if .Values.extraEnv }}
{{- with .Values.extraEnv }}
{{ toYaml . | indent 8 }}
Expand Down
1 change: 1 addition & 0 deletions charts/doccano/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ persistence:
helm.sh/resource-policy: keep

postgresql:
installAsDependency: true
image:
tag: 11.14.0-debian-10-r28
global:
Expand Down

0 comments on commit 2f86cbd

Please sign in to comment.