while accessing azure postgress server from my aks cluster i am getting error
error fetching from postgres, err: pq: no pg_hba.conf entry for host \"4.224.139.13\"
this postgress servre is public , while seraching i got a document
Check your SSL settings on the client. Azure database for PostgreSQL Flexible Server has SSL enabled by default. Ensure you enabled the SSL mode from the client , you can refer to our
this is the way i am connecting to postgress server
```
fmt.Sprintf("host=%s port=%s user=%s "+
"password=%s dbname=%s fmt.Sprintf("host=%s port=%s user=%s "+
"password=%s dbname=%s sslmode=disable TimeZone=Asia/Kolkata",
serverIp, port, user,
password, db) TimeZone=Asia/Kolkata",
serverIp, port, user,
password, db)
```
}
var err error
// Create connection pool
pgObj.conn, err = sql.Open("postgres", dbinfo+" connect_timeout=1")
if err != nil {
// utils.PrintlnLog(constants.ERROR, "Error creating pg connection pool :"+err.Error())
logrus.Error("Error creating pg connection pool :" + err.Error())
return
}
here if i am sslmode=require then which ssl certificate i will provide , can you please help me with this , beacause one certificate i got form azure that i used still getting same issue, please explain me properly.
and also i tried to disable it using this (require _secure_transport" to OFF)
`az resource list -g MC_Pace-NP_Pace-NP_centralindia --resource-type Microsoft.DBforPostgreSQL/flexibleServers
[
{
"changedTime": "2024-07-03T07:26:38.704717+00:00",
"createdTime": "2024-07-03T07:10:30.204319+00:00",
"extendedLocation": null,
"id": "/subscriptions/c79b2c30-a987-4334-b86b-9de5871252a4/resourceGroups/MC_Pace-NP_Pace-NP_centralindia/providers/Microsoft.DBforPostgreSQL/flexibleServers/postgressql-pace",
"identity": null,
"kind": null,
"location": "centralindia",
"managedBy": null,
"name": "postgressql-pace",
"plan": null,
"properties": null,
"provisioningState": "Succeeded",
"resourceGroup": "MC_Pace-NP_Pace-NP_centralindia",
"sku": {
"capacity": null,
"family": null,
"model": null,
"name": "Standard_B1ms",
"size": null,
"tier": "Burstable"
},
"systemData": {
"createdAt": "2024-07-03T07:10:39.2577724Z"
},
"tags": {},
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
},
{
"changedTime": "2024-07-09T10:10:09.760611+00:00",
"createdTime": "2024-07-09T09:53:45.861902+00:00",
"extendedLocation": null,
"id": "/subscriptions/c79b2c30-a987-4334-b86b-9de5871252a4/resourceGroups/MC_Pace-NP_Pace-NP_centralindia/providers/Microsoft.DBforPostgreSQL/flexibleServers/pace-postgress",
"identity": null,
"kind": null,
"location": "centralindia",
"managedBy": null,
"name": "pace-postgress",
"plan": null,
"properties": null,
"provisioningState": "Succeeded",
"resourceGroup": "MC_Pace-NP_Pace-NP_centralindia",
"sku": {
"capacity": null,
"family": null,
"model": null,
"name": "Standard_B1ms",
"size": null,
"tier": "Burstable"
},
"systemData": {
"createdAt": "2024-07-09T09:54:05.5059694Z"
},
"tags": {},
"type": "Microsoft.DBforPostgreSQL/flexibleServers"
}
]
az postgres server show --resource-group MC_Pace-NP_Pace-NP_centralindia --name pace-postgress
(ResourceNotFound) The Resource 'Microsoft.DBforPostgreSQL/servers/pace-postgress' under resource group 'MC_Pace-NP_Pace-NP_centralindia' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.DBforPostgreSQL/servers/pace-postgress' under resource group 'MC_Pace-NP_Pace-NP_centralindia' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
i don't know why this happening , i can list the postgress sever in the resource group and i can't see the server inside the resource.
my aks cluster version --- 1.28.9
postgress version - 16.3