From 98122208515bcb83b2f4fbe8582fc96d222ddecb Mon Sep 17 00:00:00 2001 From: ilyannn Date: Tue, 9 Jan 2024 22:15:00 +0100 Subject: [PATCH] fix: 0.3.2 version (#9) Fixes: - (docs): better explanation of values - add an `initContainer` (closes #7 ) --- .github/linters/chart-testing.yaml | 2 +- langfuse/Chart.yaml | 2 +- langfuse/templates/deployment.yaml | 34 +++++++++++++++++++++++++++++- langfuse/values.yaml | 29 ++++++++----------------- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/.github/linters/chart-testing.yaml b/.github/linters/chart-testing.yaml index 92476dc..43bb9a2 100644 --- a/.github/linters/chart-testing.yaml +++ b/.github/linters/chart-testing.yaml @@ -4,5 +4,5 @@ chart-dirs: chart-repos: - bitnami=https://charts.bitnami.com/bitnami -# The default branch name will be 'main' soon +# The default branch name will be 'main' soon, but for now we need this. target-branch: main diff --git a/langfuse/Chart.yaml b/langfuse/Chart.yaml index 624938f..7d86fb8 100644 --- a/langfuse/Chart.yaml +++ b/langfuse/Chart.yaml @@ -17,7 +17,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.3.1 +version: 0.3.2 # 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 diff --git a/langfuse/templates/deployment.yaml b/langfuse/templates/deployment.yaml index 7d200aa..f34f85f 100644 --- a/langfuse/templates/deployment.yaml +++ b/langfuse/templates/deployment.yaml @@ -27,6 +27,32 @@ spec: serviceAccountName: {{ include "langfuse.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + - name: check-postgres + image: busybox:latest + env: + {{- if .Values.postgresql.enabled }} + - name: DATABASE_HOST + value: {{ include "langfuse.databaseHost" . | quote }} + - name: DATABASE_PORT + value: "5432" + {{- else }} + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: {{ include "langfuse.connectionSecret" . | quote }} + key: database-url + {{- end }} + command: + - sh + - -c + - > + until nc -z -v -w30 + ${DATABASE_HOST:-$(echo $DATABASE_URL | awk -F[/:] '{print $4}')} + ${DATABASE_PORT:-$(echo $DATABASE_URL | awk -F[/:] '{print $5}'):-"5432"} ; do + echo 'Waiting for Postgres...' ; + sleep 5 ; + done containers: - name: {{ .Chart.Name }} securityContext: @@ -80,10 +106,16 @@ spec: - configMapRef: name: {{ include "langfuse.configMap" . }} {{- include "langfuse.additionalSecrets" . }} - readinessProbe: + startupProbe: + tcpSocket: + port: http + failureThreshold: 30 + periodSeconds: 10 + livenessProbe: httpGet: path: /api/public/health port: http + periodSeconds: 20 resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/langfuse/values.yaml b/langfuse/values.yaml index b437069..0a3249c 100644 --- a/langfuse/values.yaml +++ b/langfuse/values.yaml @@ -10,16 +10,9 @@ databaseURL: "postgresql://postgres:postgres@localhost:5432/postgres" # This URL is used for migrations directURL: "" -# Several toggles for Langfuse functionality -toggles: - disablePublicSignup: false - experimentalFeatures: false - telemetry: true - # Where the non-public Langfuse configuration is stored secrets: - # This group of settings is only relevant if postgresql.enabled is set. - postgresql: + postgresql: # This group of settings is only relevant if postgresql.enabled is set. # If set (default), random values are saved in the postgresql.auth.existingSecret secret # for all the missing keys (existing values for these keys are preserved). # If unset, you are expected to create the secret yourself before installing the chart. @@ -31,6 +24,7 @@ secrets: # but Postgres will continue to use an old password since it's stored on the PVC. keepWhenUninstalled: true internal: + # By default, each installation gets their own internal secret # You can change the name to make several installations share the API keys. name: "{{ .Release.Name }}-internal-secret" # If set (default), random values are saved in the secrets.internal.name secret @@ -46,6 +40,12 @@ secrets: # You will need to manage those manually; they will not be touched by the chart. additional: [] +# Several toggles for Langfuse functionality +toggles: + disablePublicSignup: false + experimentalFeatures: false + telemetry: true + # ------------ Postgres subchart postgresql: @@ -116,18 +116,7 @@ ingress: # hosts: # - chart-example.local -resources: - {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: -# cpu: 100m -# memory: 128Mi +resources: {} autoscaling: enabled: false