Skip to content

Commit a8ab8e8

Browse files
feat: Postgres upgrade from 11 to 14 (#6525)
* updated postgresql.yaml * updated the postgres image to postgre:14.9 and removed the postgres-misc migration * updated claim template name to devtron * updated claim template name to devtron * reverted the claim template name to data * changed targetport to actual portnumber instead of name * updated the check for POSTGRES_MIGRATED * POSTGRES_MIGRATED for devtron-custom-cm * POSTGRES_MIGRATED for devtron-custom-cm * synced from charts repo for airgapped argocd changes * moved nodeselectors,tolerations and imagepullsecrets below their description
1 parent 1fba195 commit a8ab8e8

File tree

8 files changed

+133
-455
lines changed

8 files changed

+133
-455
lines changed

charts/devtron/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords:
1111
- argocd
1212
- Hyperion
1313
engine: gotpl
14-
version: 0.22.89
14+
version: 0.22.90
1515
sources:
1616
- https://github.com/devtron-labs/charts
1717
dependencies:

charts/devtron/devtron-bom.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ components:
112112
keyName: postgresql-password
113113
postgres:
114114
registry: ""
115-
image: "postgres:11.9.0-debian-10-r26"
116-
armImage: "postgres:11.9"
115+
image: "postgres:14.9"
117116
initImage: "minideb:latest"
118117
imagePullPolicy: "IfNotPresent"
119118
metrics:
120-
image: postgres_exporter:v0.4.7
121-
armImage: postgres_exporter:v0.10.1
119+
image: postgres_exporter:v0.10.1
122120
gitsensor:
123121
registry: ""
124122
image: "git-sensor:31f7877c-200-31629"

charts/devtron/templates/NOTES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
{{- if .Release.IsUpgrade }}
2+
{{- $liveCm := lookup "v1" "ConfigMap" "devtroncd" "devtron-custom-cm" }}
3+
{{- $currentValue := pluck "POSTGRES_MIGRATED" $liveCm.data | first | default "" }}
4+
{{- if ne $currentValue "14" }}
5+
{{- fail "Upgrade Failed Please ensure that you have completed the pre-requisites mentioned in <filelink>" }}
6+
{{- end }}
7+
{{- end }}
8+
19
Please wait for ~1 minute before running any of the following commands.
210

311
1. Run the following command to get the password for the default admin user:

charts/devtron/templates/argocd-secret.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- $customOverrides := index $.Values.components.devtron.customOverrides }}
12
apiVersion: v1
23
kind: Secret
34
metadata:
@@ -22,6 +23,7 @@ metadata:
2223
data:
2324
timeout.hard.reconciliation: "0"
2425
timeout.reconciliation: 60s
26+
{{- if ne $customOverrides.IS_AIR_GAP_ENVIRONMENT "true" }}
2527
repositories: |-
2628
- name: devtron
2729
type: helm
@@ -56,6 +58,7 @@ data:
5658
- name: kedacore
5759
type: helm
5860
url: https://kedacore.github.io/charts
61+
{{- end }}
5962
resource.customizations: >
6063
kubernetes-client.io/ExternalSecret:
6164
health.lua: |

charts/devtron/templates/devtron.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ data:
207207
{{- $modules = append $modules "argo-cd" }}
208208
{{- end }}
209209
{{- end }}
210+
POSTGRES_MIGRATED: "14"
210211
INSTALLED_MODULES: {{ if $modules }}{{ printf "'%s'" (join "," $modules) }}{{ else }}""{{ end }}
211212
DEFAULT_CI_IMAGE: {{ include "common.image" (dict "component" $.Values.components.ciRunner "global" $.Values.global ) }}
212213
---

charts/devtron/templates/migrator.yaml

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -462,60 +462,6 @@ spec:
462462
name: shared-volume
463463
backoffLimit: 20
464464
activeDeadlineSeconds: 1500
465-
466465
{{- end }}
467-
---
468-
{{- if $.Capabilities.APIVersions.Has "batch/v1/Job" }}
469-
apiVersion: batch/v1
470-
{{- else }}
471-
apiVersion: batch/v1beta1
472-
{{- end }}
473-
#this job is added for creating new database(clairv4).
474-
#This database is needed for clair upgrade (v2 to v4), since old database does not support migration for new clair.
475-
#Without this job, database can be created for new users, but not for existing users.
476-
kind: Job
477-
metadata:
478-
name: postgresql-miscellaneous
479-
spec:
480-
ttlSecondsAfterFinished: 1000
481-
template:
482-
spec:
483-
{{- include "common.schedulerConfig" (dict "nodeSelector" $.Values.components.migrator.nodeSelector "tolerations" $.Values.components.migrator.tolerations "imagePullSecrets" $.Values.components.migrator.imagePullSecrets "global" $.Values.global) | indent 6 }}
484-
securityContext:
485-
fsGroup: 1000
486-
runAsGroup: 1000
487-
runAsUser: 1000
488-
containers:
489-
- name: postgresql-miscellaneous
490-
image: {{ include "common.image" (dict "component" $.Values.components.postgres "global" $.Values.global "extraImage" $.Values.components.postgres.armImage ) }}
491-
securityContext:
492-
allowPrivilegeEscalation: false
493-
runAsUser: 1000
494-
runAsNonRoot: true
495-
env:
496-
- name: PGPASSWORD
497-
valueFrom:
498-
secretKeyRef:
499-
name: postgresql-postgresql
500-
key: postgresql-password
501-
- name: PGHOST
502-
value: postgresql-postgresql
503-
envFrom:
504-
- configMapRef:
505-
name: devtron-common-cm
506-
command:
507-
- /bin/sh
508-
- -c
509-
- psql -Upostgres -f /docker-entrypoint-initdb.d/db_create.sql
510-
volumeMounts:
511-
- name: custom-init-scripts
512-
mountPath: /docker-entrypoint-initdb.d/
513-
volumes:
514-
- name: custom-init-scripts
515-
configMap:
516-
name: postgresql-postgresql-init-scripts
517-
restartPolicy: OnFailure
518-
backoffLimit: 20
519-
activeDeadlineSeconds: 1800
520466
{{- end }}
521467
{{- end }}

0 commit comments

Comments
 (0)