Skip to content
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

Add postgresql database support #200

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
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
Next Next commit
Add postgresql database support,save memory
clcc2019 committed Oct 13, 2023
commit 1bdd4d2e32be09854eb123e80745921a8bca2957
4 changes: 4 additions & 0 deletions charts/dragonfly/Chart.yaml
Original file line number Diff line number Diff line change
@@ -59,3 +59,7 @@ dependencies:
version: 0.66.1
repository: https://jaegertracing.github.io/helm-charts
condition: jaeger.enable
- condition: postgresql.enable
name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 13.1.5
23 changes: 23 additions & 0 deletions charts/dragonfly/templates/manager/manager-configmap.yaml
Original file line number Diff line number Diff line change
@@ -32,6 +32,8 @@ data:
auth:
{{ toYaml .Values.manager.config.auth | indent 6 }}
database:
{{- if and .Values.mysql.enable (empty .Values.externalMysql.host)}}
type: mysql
mysql:
{{- if and .Values.mysql.enable (empty .Values.externalMysql.host)}}
user: {{ .Values.mysql.auth.username }}
@@ -48,6 +50,27 @@ data:
dbname: {{ .Values.externalMysql.database }}
migrate: {{ .Values.externalMysql.migrate }}
{{- end }}
{{- end }}
{{- if and .Values.postgresql.enable (empty .Values.externalPostgresql.host)}}
type: postgres
postgres:
{{- if and .Values.postgresql.enable (empty .Values.externalPostgresql.host)}}
user: {{ .Values.postgresql.auth.username }}
password: {{ .Values.postgresql.auth.password }}
host: {{ .Release.Name }}-{{ default "postgresql" .Values.postgresql.fullname }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
port: 5432
dbname: {{ .Values.postgresql.auth.database }}
migrate: {{ .Values.postgresql.migrate }}
{{- else }}
user: {{ .Values.externalPostgresql.username }}
password: {{ .Values.externalPostgresql.password }}
host: {{ .Values.externalPostgresql.host }}
port: {{ .Values.externalPostgresql.port }}
dbname: {{ .Values.externalPostgresql.database }}
migrate: {{ .Values.externalPostgresql.migrate }}
{{- end }}
timezone: UTC
{{- end }}
redis:
{{- if .Values.redis.enable }}
addrs:
39 changes: 39 additions & 0 deletions charts/dragonfly/values.yaml
Original file line number Diff line number Diff line change
@@ -1488,6 +1488,45 @@ externalMysql:
# -- External mysql port.
port: 3306

postgresql:
# -- Enable postgresql with docker container.
enable: true
# -- Cluster domain.
clusterDomain: "cluster.local"
# -- Running GORM migration.
migrate: true
auth:
enablePostgresUser: true
postgresPassword: "dragonfly"
# -- Create dragonfly user.
username: "dragonfly"
password: "dragonfly"
# -- Create dragonfly manager db.
database: "manager"
primary:
service:
# -- postgresql port.
port: 5432
persistence:
enabled: true
storageClass: ""
# size: 5Gi

externalPostgresql:
# -- Running GORM migration.
migrate: false
# -- External postgresql hostname.
host:
# -- External postgresql username.
username: dragonfly
# -- External postgresql password.
password: dragonfly
# -- External postgresql database name.
database: manager
# -- External postgresql port.
port: 5432


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank lines.

redis:
# -- Enable redis cluster with docker container.
enable: true