I have created postgres with private vnet option. So, no direct access to posgres from internet.
But, I can't access it from "CloudShell" also.
Also, while creating database,when I want to choose existing VNets, aks cluster(VNet) is not showing in the drop down.
How to keep AKS(azure kubernetes service) cluster and postgres flexible server in the same network then?
Even I tried VNet linking for time being, but not working the connectivity there also.
Cloud Shell runs in a Microsoft managed container which is not attached to your vNet, therefore it has no access to any resources that are behind private endpoints. You can run Cloud Shell in a vNet using Azure Relay, details can be found here.
I would suggest creating a separate question for the second part, providing more details on how you are trying to create the database.