diff --git a/controllers/spec/template/yaml/BaseConfigMapTemplate.yaml b/controllers/spec/template/yaml/BaseConfigMapTemplate.yaml index 3e57b06..b2eaf2f 100644 --- a/controllers/spec/template/yaml/BaseConfigMapTemplate.yaml +++ b/controllers/spec/template/yaml/BaseConfigMapTemplate.yaml @@ -120,9 +120,9 @@ data: backUpFilePath="$BACKUP_DESTINATION_FOLDER/$backUpFileName" echo "$dt - Starting DB backup of Kubegres resource $KUBEGRES_RESOURCE_NAME into file: $backUpFilePath"; - echo "$dt - Running: pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U postgres -c | gzip > $backUpFilePath" + echo "$dt - Running: pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U $POSTGRES_USER -c | gzip > $backUpFilePath" - pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U postgres -c | gzip > $backUpFilePath + pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U $POSTGRES_USER -c | gzip > $backUpFilePath if [ $? -ne 0 ]; then rm $backUpFilePath diff --git a/controllers/spec/template/yaml/PrimaryStatefulSetTemplate.yaml b/controllers/spec/template/yaml/PrimaryStatefulSetTemplate.yaml index 8e52ffb..eef6432 100644 --- a/controllers/spec/template/yaml/PrimaryStatefulSetTemplate.yaml +++ b/controllers/spec/template/yaml/PrimaryStatefulSetTemplate.yaml @@ -68,7 +68,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 10 initialDelaySeconds: 60 periodSeconds: 20 @@ -80,7 +80,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 10 diff --git a/controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml b/controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml index cb4bbe9..4aa2ade 100644 --- a/controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml +++ b/controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml @@ -90,7 +90,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 10 initialDelaySeconds: 60 periodSeconds: 20 @@ -102,7 +102,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 10 diff --git a/controllers/spec/template/yaml/Templates.go b/controllers/spec/template/yaml/Templates.go index 537a9f2..d3565f4 100644 --- a/controllers/spec/template/yaml/Templates.go +++ b/controllers/spec/template/yaml/Templates.go @@ -189,7 +189,7 @@ data: echo "$dt - Starting DB backup of Kubegres resource $KUBEGRES_RESOURCE_NAME into file: $backUpFilePath"; echo "$dt - Running: pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U postgres -c | gzip > $backUpFilePath" - pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U postgres -c | gzip > $backUpFilePath + pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U $POSTGRES_USER -c | gzip > $backUpFilePath if [ $? -ne 0 ]; then rm $backUpFilePath @@ -405,7 +405,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 10 initialDelaySeconds: 60 periodSeconds: 20 @@ -417,7 +417,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 10 @@ -553,7 +553,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 10 initialDelaySeconds: 60 periodSeconds: 20 @@ -565,7 +565,7 @@ spec: command: - sh - -c - - exec pg_isready -U postgres -h $POD_IP + - exec pg_isready -U $POSTGRES_USER -h $POD_IP failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 10