Skip to content

Commit

Permalink
Issue 121: update Postgres chart and identify as "dev"
Browse files Browse the repository at this point in the history
  • Loading branch information
plumdog committed Aug 2, 2023
1 parent 1dad947 commit 3733c7e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
8 changes: 4 additions & 4 deletions charts/flagsmith/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: postgresql
repository: https://charts.helm.sh/stable
version: 8.6.4
repository: https://charts.bitnami.com/bitnami
version: 12.5.8
- name: influxdb2
repository: https://helm.influxdata.com/
version: 2.1.1
- name: graphite
repository: https://kiwigrid.github.io
version: 0.7.3
digest: sha256:1da2ab7c98cb0226469fd785d5d98431148486c6cecde9e419c73c2c0dc325b8
generated: "2023-04-18T16:20:35.478691+01:00"
digest: sha256:6ed1b4fab608bb1039a42040c445cfdf6a74a32ac80d4b1137f420e86f08e481
generated: "2023-06-20T13:58:28.286957382+01:00"
11 changes: 7 additions & 4 deletions charts/flagsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ apiVersion: v2
name: flagsmith
description: Flagsmith
type: application
version: 0.22.0
version: 0.23.0
appVersion: 2.57.0
dependencies:
- name: postgresql
repository: https://charts.helm.sh/stable
version: 8.6.4
condition: postgresql.enabled
repository: https://charts.bitnami.com/bitnami
version: 12.5.8
# Handle the previous flag too, see
# https://v2.helm.sh/docs/developing_charts/#tags-and-condition-fields-in-requirements-yaml
condition: postgresql.enabled,devPostgresql.enabled
alias: devPostgresql
- name: influxdb2
repository: https://helm.influxdata.com/
version: 2.1.1
Expand Down
4 changes: 4 additions & 0 deletions charts/flagsmith/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

For documentation on this Helm chart, please refer to the
[Flagsmith Docs](https://docs.flagsmith.com/deployment/kubernetes).

In particular, [key upgrade
notes](https://docs.flagsmith.com/deployment/hosting/kubernetes#key-upgrade-notes)
for information on upgrading chart versions.
26 changes: 13 additions & 13 deletions charts/flagsmith/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "flagsmith.postgresql.fullname" -}}
{{- if .Values.postgresql.fullnameOverride -}}
{{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- if .Values.devPostgresql.fullnameOverride -}}
{{- .Values.devPostgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.postgresql.nameOverride -}}
{{- $name := default .Chart.Name .Values.devPostgresql.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand All @@ -72,18 +72,18 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
Set postgres host
*/}}
{{- define "flagsmith.postgresql.host" -}}
{{- if .Values.postgresql.enabled -}}
{{- if .Values.devPostgresql.enabled -}}
{{- template "flagsmith.postgresql.fullname" . -}}
{{- else -}}
{{- .Values.postgresql.postgresqlHost | quote -}}
{{- .Values.devPostgresql.postgresqlHost | quote -}}
{{- end -}}
{{- end -}}

{{/*
Set postgres secret
*/}}
{{- define "flagsmith.postgresql.secret" -}}
{{- if .Values.postgresql.enabled -}}
{{- if .Values.devPostgresql.enabled -}}
{{- template "flagsmith.postgresql.fullname" . -}}
{{- else -}}
{{- template "flagsmith.fullname" . -}}
Expand All @@ -94,21 +94,21 @@ Set postgres secret
Set postgres secretKey
*/}}
{{- define "flagsmith.postgresql.secretKey" -}}
{{- if .Values.postgresql.enabled -}}
{{- if .Values.devPostgresql.enabled -}}
"postgresql-password"
{{- else -}}
{{- default "postgresql-password" .Values.postgresql.existingSecretKey | quote -}}
{{- default "postgresql-password" .Values.devPostgresql.existingSecretKey | quote -}}
{{- end -}}
{{- end -}}

{{/*
Set postgres port
*/}}
{{- define "flagsmith.postgresql.port" -}}
{{- if .Values.postgresql.enabled -}}
{{- if .Values.devPostgresql.enabled -}}
"5432"
{{- else -}}
{{- default "5432" .Values.postgresql.postgresqlPort | quote -}}
{{- default "5432" .Values.devPostgresql.postgresqlPort | quote -}}
{{- end -}}
{{- end -}}

Expand Down Expand Up @@ -160,7 +160,7 @@ Set redis port
Postgres hostname
*/}}
{{- define "flagsmith.postgres.hostname" -}}
{{- printf "%s-%s" .Release.Name .Values.postgresql.nameOverride -}}.{{ .Release.Namespace }}.svc.cluster.local
{{- printf "%s-%s" .Release.Name .Values.devPostgresql.nameOverride -}}.{{ .Release.Namespace }}.svc.cluster.local
{{- end -}}

{{/*
Expand Down Expand Up @@ -268,8 +268,8 @@ Database URL
{{- end -}}
{{- end -}}
{{- end -}}
{{- else if .Values.postgresql.enabled -}}
{{- printf "%s://%s:%s@%s:%s/%s" "postgres" (required "Must specify a postgres username" .Values.postgresql.postgresqlUsername) (required "Must specify a postgres password" .Values.postgresql.postgresqlPassword) (include "flagsmith.postgres.hostname" . ) "5432" (required "Must specify a postgres database name" .Values.postgresql.postgresqlDatabase) -}}
{{- else if .Values.devPostgresql.enabled -}}
{{- printf "%s://%s:%s@%s:%s/%s" "postgres" (.Values.devPostgresql.auth.username | default "postgres") (.Values.devPostgresql.auth.password | default .Values.devPostgresql.auth.postgresPassword | required "Must specify a postgres password") (include "flagsmith.postgres.hostname" . ) "5432" (required "Must specify a postgres database name" .Values.devPostgresql.auth.database) -}}
{{- end -}}
{{- end -}}

Expand Down
12 changes: 6 additions & 6 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ taskProcessor:
# runAsUser: 1000
# runAsGroup: 1000

postgresql:
devPostgresql:
enabled: true
serviceAccount:
enabled: true
nameOverride: flagsmith-postgresql
postgresqlDatabase: flagsmith
postgresqlUsername: postgres
postgresqlPassword: flagsmith
create: true
nameOverride: dev-postgresql
auth:
postgresPassword: flagsmith
database: flagsmith

databaseExternal:
enabled: false
Expand Down
1 change: 1 addition & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# See https://github.com/Flagsmith/flagsmith-charts/issues/105
chart-repos:
- stable=https://charts.helm.sh/stable
- bitnami=https://charts.bitnami.com/bitnami
- influxdata=https://helm.influxdata.com/
- kiwigrid=https://kiwigrid.github.io
target-branch: main
Expand Down

0 comments on commit 3733c7e

Please sign in to comment.