Skip to content

Commit

Permalink
Merge branch 'main' into feat/auto-secret-key
Browse files Browse the repository at this point in the history
  • Loading branch information
rolodato committed Jan 20, 2025
2 parents 00e0d95 + 4112ef3 commit 21cdc74
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 19 deletions.
2 changes: 1 addition & 1 deletion charts/flagsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: flagsmith
description: Flagsmith
type: application
version: 0.66.0
version: 0.68.0
appVersion: 2.159.0
dependencies:
- name: postgresql
Expand Down
8 changes: 3 additions & 5 deletions charts/flagsmith/ci/e2e-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ frontend:
SLACK_TOKEN: "${SLACK_TOKEN}"

api:
analytics:
enabled: true
extraEnv:
EMAIL_BACKEND: 'django.core.mail.backends.console.EmailBackend'
EMAIL_BACKEND: "django.core.mail.backends.console.EmailBackend"
FE_E2E_TEST_USER_EMAIL: [email protected]
influxdb2:
# Needed to set this for the tests to not fail. Possibly related to
# https://github.com/Flagsmith/flagsmith/issues/340
enabled: false
11 changes: 0 additions & 11 deletions charts/flagsmith/ci/influxdb-test-values.yaml

This file was deleted.

17 changes: 15 additions & 2 deletions charts/flagsmith/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flagsmith pods are now starting in the cluster #

See documentation at https://artifacthub.io/packages/helm/flagsmith/flagsmith/{{ .Chart.Version }}
See documentation at https://docs.flagsmith.com/deployment/hosting/kubernetes
for more configuration options.

To access Flagsmith using port-forwarding, run:
Expand All @@ -25,7 +25,20 @@ kubectl -n {{ .Release.Namespace }} logs pods/{{ include "flagsmith.fullname" .
{{- $stringParts := (compact (list (join ", " $commaParts) $andPart)) -}}
## Ingress not enabled for {{ join " and " $stringParts }} ##

See documentation at https://artifacthub.io/packages/helm/flagsmith/flagsmith/{{ .Chart.Version }}#ingress-configuration
See documentation at https://docs.flagsmith.com/deployment/hosting/kubernetes#ingress-configuration
for information about how to gain web access to the application.

{{- end }}

{{- if .Values.influxdb2.enabled }}

######################################
##### Warning: influxdb2 #####
######################################

InfluxDB2 is deprecated and will be removed in the next major version.
Please set values under the `influxdbExternal` key
or migrate your analytics data to PostgreSQL by enabling `jobs.migrateAnalytics`.
{{- end }}

--------------------------------------
9 changes: 9 additions & 0 deletions charts/flagsmith/templates/_api_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
name: {{ template "flagsmith.influxdb.fullname" . }}-external-auth
key: admin-token
{{- end }}
{{- else if .Values.UsePostgresForAnalytics.enabled }}
{{- if not .Values.taskProcessor.enabled }}
{{ fail "To use PostgreSQL for analytics, `taskProcessor.enabled` should be set to `true`" }}
{{- end}}
- name: USE_POSTGRES_FOR_ANALYTICS
value: 'true'
{{- else }}
- name: DISABLE_ANALYTICS_FEATURES
value: 'true'
{{- end }}
- name: DJANGO_ALLOWED_HOSTS
value: '*'
Expand Down
39 changes: 39 additions & 0 deletions charts/flagsmith/templates/jobs-migrate-analytics-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- if .Values.jobs.migrateAnalyticsData.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "flagsmith.fullname" . }}-migrate-analytics-data-{{ .Release.Revision }}-{{ randAlphaNum 5 | lower }}
{{- $annotations := include "flagsmith.annotations" .Values.common }}
{{- with $annotations }}
annotations:
{{- . | nindent 4 }}
{{- end }}
labels:
{{- include "flagsmith.labels" . | nindent 4 }}
app.kubernetes.io/component: job-migrate-analytics-data
spec:
template:
spec:
restartPolicy: Never
{{- if .Values.jobs.migrateDb.serviceAccountName }}
serviceAccountName: {{ .Values.jobs.migrateDb.serviceAccountName }}
{{- end }}
{{- if .Values.jobs.migrateDb.shareProcessNamespace }}
{{- end }}
shareProcessNamespace: true
containers:
- name: migrate-analytics-data
image: {{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default (printf "%s" .Chart.AppVersion) }}
command: ["python","manage.py", "migrate_analytics"]
{{- if .Values.jobs.migrateAnalyticsData.args }}
args: {{ toYaml .Values.jobs.migrateAnalyticsData.args | nindent 8 }}
{{- end }}
env: {{ include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }}
{{- with .Values.jobs.migrateDb.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
volumes:
{{- with .Values.jobs.migrateDb.extraVolumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end -}}
8 changes: 8 additions & 0 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ influxdbExternal:
name: null
key: null

UsePostgresForAnalytics:
enabled: false

# This is included primarily for easy testing of statsd integration from the application.
graphite:
enabled: false
Expand Down Expand Up @@ -420,6 +423,11 @@ jobs:
extraVolumes: []
command: []
args: []
migrateAnalyticsData:
enabled: false
args: []
extraContainers: []
extraVolumes: []

# These tests just make non-destructive requests to the services in
# the cluster. Enabling this and running helm test is safe.
Expand Down

0 comments on commit 21cdc74

Please sign in to comment.