diff --git a/charts/donetick/Chart.yaml b/charts/donetick/Chart.yaml index 861c6c4..07fe498 100644 --- a/charts/donetick/Chart.yaml +++ b/charts/donetick/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: donetick description: Donetick helm chart for Kubernetes type: application -version: 1.0.3 +version: 1.0.4 appVersion: "v0.1.60" maintainers: - name: Richard Tomik diff --git a/charts/donetick/templates/configmap.yaml b/charts/donetick/templates/configmap.yaml index ddee798..a640551 100644 --- a/charts/donetick/templates/configmap.yaml +++ b/charts/donetick/templates/configmap.yaml @@ -22,19 +22,18 @@ data: {{- if .Values.config.database.migration_retry }} migration_retry: {{ .Values.config.database.migration_retry }} {{- end }} + migration_timeout: {{ .Values.config.database.migration_timeout | default "300s" | quote }} {{- if eq .Values.config.database.type "postgres" }} - {{- if not .Values.config.database.secrets.existingSecret }} host: {{ .Values.config.database.host | quote }} port: {{ .Values.config.database.port }} + name: {{ .Values.config.database.name | quote }} + {{- if not .Values.config.database.secrets.existingSecret }} user: {{ .Values.config.database.user | quote }} password: {{ .Values.config.database.password | quote }} - name: {{ .Values.config.database.name | quote }} {{- else }} - # Database host, port, and name from values, credentials from Secret - host: {{ .Values.config.database.host | quote }} - port: {{ .Values.config.database.port }} - name: {{ .Values.config.database.name | quote }} - # Username and password will be injected via environment variables from Secret + # Reference environment variables for database credentials + user: "$DT_DATABASE_USER" + password: "$DT_DATABASE_PASSWORD" {{- end }} {{- end }} jwt: diff --git a/charts/donetick/templates/deployment.yaml b/charts/donetick/templates/deployment.yaml index 8268d84..6373638 100644 --- a/charts/donetick/templates/deployment.yaml +++ b/charts/donetick/templates/deployment.yaml @@ -88,15 +88,44 @@ spec: - name: {{ .name }} value: {{ .value | quote }} {{- end }} - {{- if or .Values.config.jwt.existingSecret .Values.config.oauth2.existingSecret .Values.config.database.secrets.existingSecret }} - # Secret-based environment variables + # Database configuration environment variables + {{- if eq .Values.config.database.type "postgres" }} + - name: DT_DATABASE_TYPE + value: "postgres" + - name: DT_DATABASE_HOST + value: {{ .Values.config.database.host | quote }} + - name: DT_DATABASE_PORT + value: {{ .Values.config.database.port | quote }} + - name: DT_DATABASE_NAME + value: {{ .Values.config.database.name | quote }} + {{- if .Values.config.database.secrets.existingSecret }} + - name: DT_DATABASE_USER + valueFrom: + secretKeyRef: + name: {{ .Values.config.database.secrets.existingSecret }} + key: {{ .Values.config.database.secrets.userKey }} + - name: DT_DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.config.database.secrets.existingSecret }} + key: {{ .Values.config.database.secrets.passwordKey }} + {{- end }} + {{- else }} + - name: DT_DATABASE_TYPE + value: {{ .Values.config.database.type | quote }} + {{- end }} + # JWT configuration {{- if .Values.config.jwt.existingSecret }} - name: DT_JWT_SECRET valueFrom: secretKeyRef: name: {{ .Values.config.jwt.existingSecret }} key: {{ .Values.config.jwt.secretKey }} + {{- else }} + - name: DT_JWT_SECRET + value: {{ .Values.config.jwt.secret | quote }} {{- end }} + # OAuth2 configuration {{- if .Values.config.oauth2.existingSecret }} - name: DT_OAUTH2_CLIENT_ID valueFrom: @@ -109,19 +138,6 @@ spec: name: {{ .Values.config.oauth2.existingSecret }} key: {{ .Values.config.oauth2.clientSecretKey }} {{- end }} - {{- if and .Values.config.database.secrets.existingSecret (eq .Values.config.database.type "postgres") }} - - name: DT_DB_USER - valueFrom: - secretKeyRef: - name: {{ .Values.config.database.secrets.existingSecret }} - key: {{ .Values.config.database.secrets.userKey }} - - name: DT_DB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Values.config.database.secrets.existingSecret }} - key: {{ .Values.config.database.secrets.passwordKey }} - {{- end }} - {{- end }} {{- with .Values.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/donetick/values.yaml b/charts/donetick/values.yaml index e0df060..a465a82 100644 --- a/charts/donetick/values.yaml +++ b/charts/donetick/values.yaml @@ -107,10 +107,10 @@ resources: {} probes: startup: enabled: true - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 + initialDelaySeconds: 30 + periodSeconds: 15 + timeoutSeconds: 15 + failureThreshold: 80 successThreshold: 1 path: /health liveness: @@ -157,6 +157,7 @@ config: # Migration options migration_skip: false # Set to true to skip database migrations migration_retry: 3 # Number of retries for failed migrations + migration_timeout: "600s" # Timeout for database migrations (default: 10 minutes) # These are only required for postgres host: ""