Unable to connect to Postgres StatefulSet in kubernetes cluster from go web server
I have a web server in Golang that connects to Postgres as a StatefulSet. However, I am getting an error with the connection where there is no such host found. The web server was created using ClusterIP as a service for networking and Deployment for creating the pods. Postgres was created using a Headless Service and StatefulSet. The following are my k8s configuration files and also the error message:
Unable to connect to Postgres StatefulSet in kubernetes cluster from go web server
I have a web server in Golang that connects to Postgres as a StatefulSet. However, I am getting an error with the connection where there is no such host found. The web server was created using ClusterIP as a service for networking and Deployment for creating the pods. Postgres was created using a Headless Service and StatefulSet. The following are my k8s configuration files and also the error message: