Pgsql HA on kubernetes

Hi,
I am deploying awx project on the k8s platform with pgsql master and slave. I am facing issues on HA part, When i stopped the Master pgsql pod, the awx stopped working.

Here is my pgsql value file

postgresqlUsername: {{ pg_username }}
postgresqlPassword: {{ pg_password }}
postgresqlDatabase: {{ pg_database }}
persistence:
size: {{ pg_volume_capacity|default(‘5’) }}Gi
{% if pg_persistence_storageClass is defined %}
storageClass: {{ pg_persistence_storageClass }}
{% endif %}
{% if pg_cpu_limit is defined or pg_mem_limit is defined %}
resources:
limits:
{% if pg_cpu_limit is defined %}
cpu: {{ pg_cpu_limit | string }}m
{% endif %}
{% if pg_mem_limit is defined %}
memory: {{ pg_mem_limit | string }}Gi
{% endif %}
{% endif %}
{% if tolerations is defined or node_selector is defined or affinity is defined %}
master:
{% if tolerations is defined %}
tolerations:
{{ tolerations | to_nice_yaml(indent=2) | indent(width=4, indentfirst=True) }}
{% endif %}
{% if node_selector is defined %}
nodeSelector:
{{ node_selector | to_nice_yaml(indent=2) | indent(width=4, indentfirst=True) }}
{% endif %}
{% if affinity is defined %}
affinity:
{{ affinity | to_nice_yaml(indent=2) | indent(width=4, indentfirst=True) }}
{% endif %}
{% endif %}
{% if pg_image_registry is defined %}
image:
registry: {{ pg_image_registry }}
volumePermissions:
image:
registry: {{ pg_image_registry }}
metrics:
image:
registry: {{ pg_image_registry }}
{% endif %}
{% if pg_serviceaccount is defined %}
serviceAccount:
enabled: true
name: {{ pg_serviceaccount }}
{% endif %}
replication:
enabled: true
user: repluser
password: replpassword
slaveReplicas: 2

Set synchronous commit mode: on, off, remote_apply, remote_write and local

ref: https://www.postgresql.org/docs/9.6/runtime-config-wal.html#GUC-WAL-LEVEL

synchronousCommit: “on”

>From the number of slaveReplicas defined above, set the number of those that will have synchronous replication

NOTE: It cannot be > slaveReplicas

numSynchronousReplicas: 1

Replication Cluster application name. Useful for defining multiple replication policies

applicationName: awx

Here is my inventory file

[root@host installer]# grep -v “^#” inventory
localhost ansible_connection=local ansible_python_interpreter=“/usr/bin/env python3”
[all:vars]
dockerhub_base=ansible
kubernetes_context=kubeawx
kubernetes_namespace=prodawx
pg_volume_capacity=20
pg_persistence_storageClass=storagepool
kubernetes_ingress_hostname=prodawx.mydomain.com
kubernetes_ingress_annotations={‘kubernetes.io/ingress.class’: ‘nginx’}
kubernetes_ingress_tls_secret=awx-tls
awx_task_hostname=awx
awx_web_hostname=awxweb
postgres_data_dir=“~/.awx/pgdocker”
host_port=80
host_port_ssl=443
docker_compose_dir=“~/.awx/awxcompose”
pg_username=awx
pg_password=******
pg_database=awx
pg_port=5432
admin_user=admin
admin_password=******
create_preload_data=True
secret_key=******

Could you someone help me what would be cause of this issue.

Thanks,
Sajin.