Closed martinstraesser closed 3 years ago
Hey, Martin, I don't have an answer for your question, I'm afraid, but I anyway wanted to ask you for the reasons you had to switch from cf-4-k8s to kubecf. I'd be interested to hear that from you. Thanks.
Hello Bernd, I will answer you via mail as your question is not directly related to this issue.
@martinstraesser this is likely to do with App Security Groups. Could you try creating an ASG that allows egress traffic to your database server ip:port?
1) For example -- create a json file postgres_asg.json like so
[ { "protocol": "tcp", "destination": "10.1.3.0/24", "ports": "5432", "log": true, "description": "Allow tcp traffic to postgres" } ]
2) Then create the ASG
cf create-security-group postgres postgres_asg.json
3) Make sure you bind the asg like so ..
cf bind-staging-security-group postgres
cf bind-running-security-group postgres
4) You will need to restart your app for the ASGs to take effect.
@sourirv Thanks very much that solved my problem!
I am using a Spring App to connect to a PostgreSQL database hosted outside of kubecf. The database is hosted at a fixed address like
10.1.3.40:5432
. In myapplication.properties
file I specify:Moreover, I set
username
andpassword
correctly. When I try to start the app in kubecf, I get:The address specified above is reachable from any node in my cluster. I did not face this issue when working with
cf-for-k8s
, from which I recently moved to kubecf.What I tried already:
mycustom.db
to/etc/hosts
of all nodes in cluster. And then changed the jdbcUrl accodingly. This resolves in anUnknownHostException
I assume that the requests addressed with the IP and port never leave the diego-cell and that the DNS entry in
/etc/hosts
of the hosts are not used. So my question is: How can I address the external database from my app?