Skip to content

Commit

Permalink
etrip chart 0.6.0
Browse files Browse the repository at this point in the history
- remove db provider separation, transition code
- update cnpg db image to 16.1-cron
- make s3 serverName default to -db-pg16 suffix
  • Loading branch information
georgebarbarosie committed Jun 16, 2024
2 parents 97e964f + 29c77de commit ac7cd08
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 422 deletions.
2 changes: 1 addition & 1 deletion charts/etrip/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v1
name: etrip
description: eTrip PHP Helm chart
type: application
version: 0.5.6
version: 0.6.0
appVersion: 6.0.86
36 changes: 0 additions & 36 deletions charts/etrip/templates/cron.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
{{- define "etripCronjob" }}
{{- $db := mergeOverwrite .global.Values.db ( .global.Values.db.operator_install | default dict ) -}}
{{- $clusterName := include "clusterName" .global -}}
{{- $createSecretsVolume := false }}
{{- $createSecretsVolume = or $createSecretsVolume (eq $db.provider "cnpg") }}
{{- $createSecretsVolume = or $createSecretsVolume (
and .global.Values.etrip.searchlogs.enabled
.global.Values.etrip.searchlogs.certificate ) }}
{{- $createSecretsVolumeMount := $createSecretsVolume }}
{{- $createSecretsVolume = or $createSecretsVolume (
and .global.Values.elogger.enabled
.global.Values.elogger.db.certificate ) }}
kind: CronJob
apiVersion: batch/v1
metadata:
Expand Down Expand Up @@ -46,34 +37,12 @@ spec:
subPath: etrip
- mountPath: /tmp/elogger
name: elogger
{{- if $createSecretsVolumeMount }}
- mountPath: /secrets
name: secrets
readOnly: true
{{- end }}
env:
- name: ETRIP_CONFIG
value: /config
{{- if eq $db.provider "zalando" }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: etrip. {{- $clusterName -}} .credentials
key: password
- name: ETRIP_DSN
value: >-
user=etrip
password=$(DB_PASSWORD)
host={{ $clusterName }}
{{- if gt (int .global.Values.replicas.db) 1 }}
- name: ETRIP_DSN_RO
value: >-
user=etrip
password=$(DB_PASSWORD)
host={{ $clusterName }}-repl
connect_timeout=1
{{- end }}
{{- else if eq $db.provider "cnpg" }}
- name: ETRIP_DSN
value: >-
user=etrip
Expand All @@ -88,7 +57,6 @@ spec:
sslcert=/secrets/app-tls/postgresql.crt
sslkey=/secrets/app-tls/postgresql.key
sslrootcert=/secrets/app-tls/root.crt
{{- end }}
{{- with .global.Values.etrip.searchlogs -}}{{- if .enabled }}
{{- if not .certificate }}
- name: SEARCHLOGS_DBPASSWORD
Expand Down Expand Up @@ -191,11 +159,9 @@ spec:
{{- end }}
- name: elogger
emptyDir: {}
{{- if $createSecretsVolume }}
- name: secrets
projected:
sources:
{{- if eq $db.provider "cnpg" }}
- secret:
name: {{ .global.Release.Name }}-db-app-tls
items:
Expand All @@ -206,7 +172,6 @@ spec:
mode: 416
- key: ca.crt
path: app-tls/root.crt
{{- end }}
{{- with .global.Values.etrip.searchlogs }}
{{- if and .enabled .certificate }}
- secret:
Expand All @@ -233,7 +198,6 @@ spec:
- key: ca.crt
path: elogger-tls/root.crt
{{- end }}{{ end }}
{{- end }}
{{- end }}
{{- range .Values.cron -}}
{{- include "etripCronjob" (dict "cron" . "global" $ ) }}
Expand Down
231 changes: 0 additions & 231 deletions charts/etrip/templates/database-zalando.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- $db := mergeOverwrite .Values.db ( .Values.db.operator_install | default dict ) -}}
{{- if or (eq $db.provider "cnpg") (eq $db.bootstrap.mode "transition") -}}
{{- if $db.generateIssuer }}
apiVersion: cert-manager.io/v1
kind: Certificate
Expand Down Expand Up @@ -144,27 +143,10 @@ kind: Cluster
metadata:
name: {{ .Release.Name }}-db
namespace: {{ .Release.Namespace }}
{{- /* Fencing mode */}}
{{- if and (eq $db.bootstrap.mode "transition") (eq $db.bootstrap.transitionPhase "standby_fence") }}
annotations:
cnpg.io/fencedInstances: '["*"]'
{{- end }}
labels:
{{- include "labels" $ | nindent 4 }}
spec:
{{- /*
CNPG bug: while transitioning, the multitude of reconciliation errors caused
by zalando incompatibilities before cleanup scripts get applied confuse the
CNPG operator and cause the cluster to get stuck in an unrecoverable state
as far as the operator can see. This is recoverable only if no other
instances are spawned while the first one gets cleaned up. After transition
phase is complete (transitionPhase set to full or mode switched away from
"transition") we can allow more than one instance to be spawned. */}}
{{- if and (eq $db.bootstrap.mode "transition") $db.bootstrap.transitionPhase }}
instances: 1
{{- else }}
instances: {{ .Values.replicas.db }}
{{- end }}
imageName: {{ $db.image.registry -}}
/ {{- $db.image.name -}}
: {{- $db.image.tag }}
Expand Down Expand Up @@ -223,4 +205,3 @@ spec:
schedule: {{ .schedule | quote }}
backupOwnerReference: self
{{- end }}{{ end }}{{/* s3 enabled, schedule, backup */}}
{{- end }}
Loading

0 comments on commit ac7cd08

Please sign in to comment.