Commit f4a57256c143d45c70c3dd276536b27d6fcc1019

Authored by Volodymyr Babak
1 parent 95954a30

Fixes for kubernetes cluster

@@ -32,6 +32,8 @@ spec: @@ -32,6 +32,8 @@ spec:
32 value: "9042" 32 value: "9042"
33 - name : DATABASE_TYPE 33 - name : DATABASE_TYPE
34 value: "cassandra" 34 value: "cassandra"
  35 + - name : CASSANDRA_URL
  36 + value: "cassandra-headless:9042"
35 command: 37 command:
36 - sh 38 - sh
37 - -c 39 - -c
@@ -16,6 +16,8 @@ CASSANDRA_HOST=cassandra @@ -16,6 +16,8 @@ CASSANDRA_HOST=cassandra
16 CASSANDRA_PORT=9042 16 CASSANDRA_PORT=9042
17 17
18 # postgres db config 18 # postgres db config
  19 +POSTGRES_HOST=cassandra
  20 +POSTGRES_PORT=9042
19 # SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.PostgreSQLDialect 21 # SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.PostgreSQLDialect
20 # SPRING_DRIVER_CLASS_NAME=org.postgresql.Driver 22 # SPRING_DRIVER_CLASS_NAME=org.postgresql.Driver
21 # SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/thingsboard 23 # SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/thingsboard
@@ -28,7 +28,7 @@ fi @@ -28,7 +28,7 @@ fi
28 28
29 if [ "$DATABASE_TYPE" == "sql" ]; then 29 if [ "$DATABASE_TYPE" == "sql" ]; then
30 if [ "$SPRING_DRIVER_CLASS_NAME" == "org.postgresql.Driver" ]; then 30 if [ "$SPRING_DRIVER_CLASS_NAME" == "org.postgresql.Driver" ]; then
31 - until nmap postgres -p 5432 | grep "5432/tcp open" 31 + until nmap $POSTGRES_HOST -p $POSTGRES_PORT | grep "$POSTGRES_PORT/tcp open"
32 do 32 do
33 echo "Waiting for postgres db to start..." 33 echo "Waiting for postgres db to start..."
34 sleep 10 34 sleep 10