0

I have a cloudfoundry webservice app, recently it was moved from the public domain to the internal domain(apps.internal), it looks the internal app should be on the port 8080. if I have another app running the public domain, however to set the user-provided-service to access the port 8080.

based on the doc: https://cli.cloudfoundry.org/en-US/v6/create-user-provided-service.html

it just can set the url, username,password, however, there isn't option for port. the url "https://>:8080" isn't accecptable, since as mentioned on the doc: https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html

the internal domain http route for the App just can be on the 80 or 443.

any input would be appreciated, in short, just question, how to create the user-provided-service the app running inside the internal domain.

Thanks,

jason

Miguel-F
  • 13,450
  • 6
  • 38
  • 63

1 Answers1

0

When you create and map the route, you don't need to specify the port. For the internal domains, you can really think of it as enabling DNS resolution for your route. DNS just maps the host/domain to an internal IP. It has nothing to do with the port.

The actual port to be used for communication needs to be enabled through network policy. The default policy is to deny everything, so if you don't add a network policy to allow traffic, it'll fail regardless of the port (including 80/443).

This means that your service and consuming clients need to coordinate on the ports being used. You'll need to open the port with network policy, but you'll also need to instruct the service and clients on which ports to use.

Since you're using user-provided services, you can just include the port information within that.

cf cups -p url,username,password

and include the port in the URL you specify or you could include a separate port property and pass the port separately. What you do probably depends on the clients to which you'll bind the service & what is easiest for them. Many languages can parse a URL from a string, including the port, so that's often the easiest. If your language can't parse the URL, you could go with the separate property for the port. Again, whatever works best for your apps.

Daniel Mikusa
  • 13,716
  • 1
  • 22
  • 28