Skip to content

misc: Shifted the dbConfigs under global #6621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release-bot
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions charts/devtron/devtron-bom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ global:
runAsUser: 1000
runAsNonRoot: true
containerRegistry: "quay.io/devtron"
dbConfig:
PG_ADDR: postgresql-postgresql.devtroncd
PG_PORT: "5432"
PG_USER: postgres
PG_DATABASE: orchestrator
extraManifests: []
installer:
release: "v1.6.0"
Expand Down Expand Up @@ -72,11 +77,7 @@ components:
MANIFEST_FETCH_BATCH_SIZE: "2"
NATS_MSG_PROCESSING_BATCH_SIZE: "1"
NATS_SERVER_HOST: nats://devtron-nats.devtroncd:4222
PG_ADDR: postgresql-postgresql.devtroncd
PG_DATABASE: orchestrator
PG_LOG_QUERY: "true"
PG_PORT: "5432"
PG_USER: postgres
dbconfig:
secretName: postgresql-postgresql
keyName: postgresql-password
Expand All @@ -101,11 +102,7 @@ components:
ACD_NAMESPACE: "devtroncd"
ACD_INFORMER: "true"
NATS_STREAM_MAX_AGE: "10800"
PG_ADDR: postgresql-postgresql.devtroncd
PG_DATABASE: orchestrator
PG_LOG_QUERY: "true"
PG_PORT: "5432"
PG_USER: postgres
CLUSTER_ARGO_CD_TYPE: "ALL_CLUSTER"
dbconfig:
secretName: postgresql-postgresql
Expand All @@ -126,8 +123,7 @@ components:
persistence:
volumeSize: 2Gi
configs:
PG_ADDR: postgresql-postgresql.devtroncd
PG_USER: postgres
PG_DATABASE: git_sensor
COMMIT_STATS_TIMEOUT_IN_SEC: "2"
ENABLE_FILE_STATS: "true"
USE_GIT_CLI: "true"
Expand All @@ -144,9 +140,6 @@ components:
GIT_SENSOR_PROTOCOL: GRPC
GIT_SENSOR_URL: git-sensor-service.devtroncd:90
NATS_SERVER_HOST: nats://devtron-nats.devtroncd:4222
PG_ADDR: postgresql-postgresql.devtroncd
PG_PORT: "5432"
PG_USER: postgres
PG_DATABASE: lens
dbconfig:
secretName: postgresql-postgresql
Expand Down Expand Up @@ -189,8 +182,6 @@ components:
registry: ""
image: chart-sync:da156379-836-32914
schedule: "0 19 * * *"
extraConfigs:
PG_ADDR: postgresql-postgresql.devtroncd
podSecurityContext:
fsGroup: 1001
runAsGroup: 1001
Expand Down Expand Up @@ -256,10 +247,7 @@ devtronEnterprise:
image: "casbin:f6ff5f74-064b67e5-462-30822"
imagePullPolicy: IfNotPresent
configs:
PG_ADDR: postgresql-postgresql.devtroncd
PG_DATABASE: casbin
PG_PORT: "5432"
PG_USER: postgres
dbconfig:
secretName: postgresql-postgresql
keyName: postgresql-password
Expand Down
12 changes: 11 additions & 1 deletion charts/devtron/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,14 @@ securityContext:
securityContext:
{{ toYaml .global.containerSecurityContext | indent 2 }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Extract database configuration from global values
Usage: {{ include "devtron.dbConfig" $ }}
*/}}
{{- define "devtron.dbConfig" -}}
{{- range $key, $value := $.Values.global.dbConfig }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end -}}
11 changes: 1 addition & 10 deletions charts/devtron/templates/app-sync-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ spec:
- name: chart-sync
image: {{ include "common.image" (dict "component" $.Values.components.chartSync "global" $.Values.global ) }}
{{- include "common.containerSecurityContext" (dict "containerSecurityContext" $.Values.components.chartSync.containerSecurityContext "global" $.Values.global) | indent 8 }}
env:
- name: PG_DATABASE
value: orchestrator
- name: PG_USER
value: postgres
envFrom:
- configMapRef:
name: app-sync-cm
Expand Down Expand Up @@ -79,11 +74,6 @@ spec:
- name: chart-sync
image: {{ include "common.image" (dict "component" $.Values.components.chartSync "global" $.Values.global ) }}
{{- include "common.containerSecurityContext" (dict "containerSecurityContext" $.Values.components.chartSync.containerSecurityContext "global" $.Values.global) | indent 12 }}
env:
- name: PG_DATABASE
value: orchestrator
- name: PG_USER
value: postgres
envFrom:
- secretRef:
name: devtron-secret
Expand All @@ -110,6 +100,7 @@ metadata:
app: app-sync-cronjob
release: devtron
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{- if $.Values.components.chartSync.extraConfigs }}
{{ toYaml $.Values.components.chartSync.extraConfigs | indent 2 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/devtron/templates/casbin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ metadata:
release: casbin
{{- if .configs }}
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{ toYaml .configs | indent 2 }}
{{- end }}
---
Expand Down
8 changes: 4 additions & 4 deletions charts/devtron/templates/devtron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ data:
DEVTRON_HELM_RELEASE_NAME: {{ $.Release.Name }}
DEVTRON_HELM_RELEASE_NAMESPACE: {{ $.Release.Namespace }}
FEATURE_MIGRATE_ARGOCD_APPLICATION_ENABLE: "true"
PG_USER: postgres
PG_USER: {{ $.Values.global.dbConfig.PG_USER }}
{{- if not $.Values.devtronEnterprise.enabled }}
PG_ADDR: postgresql-postgresql.devtroncd
PG_ADDR: {{ $.Values.global.dbConfig.PG_ADDR }}
{{- end }}
PG_PORT: "5432"
PG_PORT: {{ $.Values.global.dbConfig.PG_PORT }}
HELM_CLIENT_URL: kubelink-service-headless:50051
DASHBOARD_PORT: "80"
DASHBOARD_HOST: dashboard-service.devtroncd
PG_DATABASE: orchestrator
PG_DATABASE: orchestrator
DEX_HOST: http://argocd-dex-server.devtroncd
DEX_PORT: "5556"
APP_SYNC_IMAGE: {{ include "common.image" (dict "component" $.Values.components.chartSync "global" $.Values.global ) }}
Expand Down
1 change: 1 addition & 0 deletions charts/devtron/templates/gitsensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ metadata:
release: devtron
{{- if .configs }}
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{ toYaml .configs | indent 2 }}
{{- end }}

Expand Down
1 change: 1 addition & 0 deletions charts/devtron/templates/kubelink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ metadata:
"helm.sh/resource-policy": keep
{{- if .configs }}
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{ toYaml .configs | indent 2 }}
{{- if $.Values.installer.modules }}
{{- if has "cicd" $.Values.installer.modules }}
Expand Down
1 change: 1 addition & 0 deletions charts/devtron/templates/kubewatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ metadata:
release: devtron
app: kubewatch
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{- if .configs}}
{{ toYaml .configs | indent 2 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/devtron/templates/lens.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ metadata:
release: devtron
{{- if .configs }}
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{ toYaml .configs | indent 2 }}
{{- end }}
---
Expand Down
94 changes: 74 additions & 20 deletions charts/devtron/templates/migrator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ spec:
- name: DB_TYPE
value: postgres
- name: PG_USER
value: postgres
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_USER
- name: PG_ADDR
value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }}
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_ADDR
- name: DB_PORT
value: "5432"
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_PORT
- name: PG_DATABASE
value: orchestrator
value: {{ .envVars.devtron.DB_NAME }}
envFrom:
- secretRef:
name: devtron-secret
Expand Down Expand Up @@ -78,11 +87,20 @@ spec:
- name: DB_TYPE
value: postgres
- name: DB_USER_NAME
value: postgres
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_USER
- name: DB_HOST
value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }}
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_ADDR
- name: DB_PORT
value: "5432"
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_PORT
- name: DB_NAME
value: {{ .envVars.devtron.DB_NAME }}
- name: MIGRATE_TO_VERSION
Expand Down Expand Up @@ -184,11 +202,20 @@ spec:
- name: DB_TYPE
value: postgres
- name: DB_USER_NAME
value: postgres
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_USER
- name: DB_HOST
value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }}
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_ADDR
- name: DB_PORT
value: "5432"
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_PORT
- name: DB_NAME
value: {{ .envVars.casbin.DB_NAME }}
- name: MIGRATE_TO_VERSION
Expand Down Expand Up @@ -271,11 +298,20 @@ spec:
- name: DB_TYPE
value: postgres
- name: DB_USER_NAME
value: postgres
valueFrom:
configMapKeyRef:
name: git-sensor-cm
key: PG_USER
- name: DB_HOST
value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }}
valueFrom:
configMapKeyRef:
name: git-sensor-cm
key: PG_ADDR
- name: DB_PORT
value: "5432"
valueFrom:
configMapKeyRef:
name: git-sensor-cm
key: PG_PORT
- name: DB_NAME
value: {{ .envVars.gitsensor.DB_NAME }}
- name: MIGRATE_TO_VERSION
Expand Down Expand Up @@ -353,13 +389,22 @@ spec:
- name: DATABASE_MIGRATIONS_FOLDER
value: /shared/sql-ent/
- name: DB_USER_NAME
value: postgres
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_USER
- name: DB_HOST
value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }}
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_ADDR
- name: DB_PORT
value: "5432"
valueFrom:
configMapKeyRef:
name: devtron-cm
key: PG_PORT
- name: DB_NAME
value: orchestrator
value: {{ .envVars.devtron.DB_NAME }}
- name: MIGRATE_TO_VERSION
value: "0"
- name: DATABASE_MIGRATIONS_TABLE
Expand Down Expand Up @@ -428,11 +473,20 @@ spec:
- name: DB_TYPE
value: postgres
- name: DB_USER_NAME
value: postgres
valueFrom:
configMapKeyRef:
name: lens-cm
key: PG_USER
- name: DB_HOST
value: {{ .configs.PG_ADDR | default "postgresql-postgresql.devtroncd" }}
valueFrom:
configMapKeyRef:
name: lens-cm
key: PG_ADDR
- name: DB_PORT
value: "5432"
valueFrom:
configMapKeyRef:
name: lens-cm
key: PG_PORT
- name: DB_NAME
value: {{ .envVars.lens.DB_NAME }}
- name: MIGRATE_TO_VERSION
Expand Down
21 changes: 21 additions & 0 deletions charts/devtron/templates/notifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ metadata:
release: devtron
app: notifier
data:
{{- include "devtron.dbConfig" $ | indent 2 }}
{{- if .configs}}
{{ toYaml .configs | indent 2 }}
{{- end }}
Expand Down Expand Up @@ -124,6 +125,26 @@ spec:
name: {{ .dbconfig.secretName }}
key: {{ .dbconfig.keyName }}
{{- end }}
- name: DB_HOST
valueFrom:
configMapKeyRef:
name: notifier-cm
key: PG_ADDR
- name: DB_PORT
valueFrom:
configMapKeyRef:
name: notifier-cm
key: PG_PORT
- name: DB_USER
valueFrom:
configMapKeyRef:
name: notifier-cm
key: PG_USER
- name: DB
valueFrom:
configMapKeyRef:
name: notifier-cm
key: PG_DATABASE
envFrom:
- configMapRef:
name: notifier-cm
Expand Down
Loading
Loading