Skip to content

Commit

Permalink
Merge branch 'master' into helmrepo
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioalmendrosdiaz committed Aug 2, 2023
2 parents 49aac56 + 76fbb3e commit 27e731a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion helm/thingsboard/templates/initializedb-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- name: check-postgres-db-ready
image: postgres:{{ index .Values "postgresql-ha" "postgresqlImage" "tag" }}
command: ['sh', '-c',
'until pg_isready -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPort" }} -t {{ .Values.postgresInitDB.job.check.timeout }};
'until pg_isready -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPorts" "postgresql" }} -t {{ .Values.postgresInitDB.job.check.timeout }};
do echo waiting for database; sleep 2; done;']
{{- end }}
containers:
Expand Down
2 changes: 1 addition & 1 deletion helm/thingsboard/templates/js-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- name: check-db-ready
image: postgres:{{ index .Values "postgresql-ha" "postgresqlImage" "tag" }}
command: ['sh', '-c',
'until pg_isready -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPort" }} -t {{ .Values.postgresInitDB.job.check.timeout }};
'until pg_isready -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPorts" "postgresql" }} -t {{ .Values.postgresInitDB.job.check.timeout }};
do echo waiting for database; sleep 2; done;']
{{- end }}
containers:
Expand Down
2 changes: 1 addition & 1 deletion helm/thingsboard/templates/node-db-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data:
SPRING_JPA_DATABASE_PLATFORM: org.hibernate.dialect.PostgreSQLDialect
SPRING_DRIVER_CLASS_NAME: org.postgresql.Driver
{{ if index .Values "postgresql-ha" "enabled" }}
SPRING_DATASOURCE_URL: jdbc:postgresql://{{ include "thingsboard.pgpoolservicename" . }}:{{ index .Values "postgresql-ha" "pgpool" "containerPort" }}/{{ index .Values "postgresql-ha" "postgresql" "database" }}
SPRING_DATASOURCE_URL: jdbc:postgresql://{{ include "thingsboard.pgpoolservicename" . }}:{{ index .Values "postgresql-ha" "pgpool" "containerPorts" "postgresql" }}/{{ index .Values "postgresql-ha" "postgresql" "database" }}
SPRING_DATASOURCE_USERNAME: {{ index .Values "postgresql-ha" "postgresql" "username" }}
SPRING_DATASOURCE_PASSWORD: {{ index .Values "postgresql-ha" "postgresql" "password" }}
{{ else }}
Expand Down
4 changes: 2 additions & 2 deletions helm/thingsboard/templates/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ spec:
- name: check-db-ready
image: postgres:{{ index .Values "postgresql-ha" "postgresqlImage" "tag" }}
command: ['sh', '-c',
'until pg_isready -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPort" }} -t {{ .Values.postgresInitDB.job.check.timeout }};
'until pg_isready -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPorts" "postgresql" }} -t {{ .Values.postgresInitDB.job.check.timeout }};
do echo waiting for database; sleep 2; done;']
- name: check-db-queue-ready
image: postgres:{{ index .Values "postgresql-ha" "postgresqlImage" "tag" }}
command: ['sh', '-c',
'export PGPASSWORD=''{{ index .Values "postgresql-ha" "postgresql" "password" }}'' && export row_count=0 && until [ $row_count -ge 3 ]; do sleep 1; row_count=$(psql -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPort" }} -U {{ index .Values "postgresql-ha" "postgresql" "username" }} -d {{ index .Values "postgresql-ha" "postgresql" "database" }} --set=on_error_stop=1 -t -c "SELECT count(*) FROM queue;"); done;']
'export PGPASSWORD=''{{ index .Values "postgresql-ha" "postgresql" "password" }}'' && export row_count=0 && until [ $row_count -ge 3 ]; do sleep 1; row_count=$(psql -h {{ include "thingsboard.pgpoolservicename" . }} -p {{ index .Values "postgresql-ha" "pgpool" "containerPorts" "postgresql" }} -U {{ index .Values "postgresql-ha" "postgresql" "username" }} -d {{ index .Values "postgresql-ha" "postgresql" "database" }} --set=on_error_stop=1 -t -c "SELECT count(*) FROM queue;"); done;']
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
4 changes: 1 addition & 3 deletions helm/thingsboard/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,11 @@ postgresql-ha:
password: setplease
repmgrPassword: setplease
postgresqlImage:
tag: 12
tag: 15.3
pgpool:
adminPassword: setplease
replicaCount: 1
useLoadBalancing: false
pgpoolImage:
tag: 4.3.3

redis:
# Set architecture to either standalone or replication
Expand Down

0 comments on commit 27e731a

Please sign in to comment.