Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 API does not allow to specify ports on an app's processes #4079

Closed
Tracked by #1001
jochenehret opened this issue Nov 8, 2024 · 4 comments
Closed
Tracked by #1001

v3 API does not allow to specify ports on an app's processes #4079

jochenehret opened this issue Nov 8, 2024 · 4 comments

Comments

@jochenehret
Copy link
Contributor

Issue

With the v2 API, you could assign ports to your app's processes. This was required e.g. if you want to enable traffic to sidecars. With the v3 API, this seems no longer possible. We should discuss if this is a regression or if the feature was intentionally left out.

Context

The v2 API allows to specify ports on which the app shall listen:
https://v2-apidocs.cloudfoundry.org/apps/updating_an_app.html (see body parameter "ports").
Note that the list of ports is stored in the "processes" table.

The feature is used in the "sidecars" test of the CAPI BARAs suite:
https://github.com/cloudfoundry/capi-bara-tests/blob/f407866fdd668387f1283507f72a89022522586f/baras/sidecars.go#L64

With the v3 API this seems no longer possible. The "apps" and the "processes" resources do not allow to specify ports:
https://v3-apidocs.cloudfoundry.org/version/3.180.0/index.html#apps
https://v3-apidocs.cloudfoundry.org/version/3.180.0/index.html#processes

As part of the CF API v2 End of Life story, we have set up a test landscape where v2 is completely disabled:
https://concourse.app-runtime-interfaces.ci.cloudfoundry.org/teams/capi-team/pipelines/capi/jobs/gyro-exp-tests
Now we are trying to migrate the mentioned "sidecars" test to v3. If opening additional ports shall not be supported in v3, we would have to remove the test.

Steps to Reproduce

N/A

Expected result

N/A

Current result

N/A

Possible Fix

Add parameter to v3 "processes" resource that allows to specify additional ports.

@Gerg
Copy link
Member

Gerg commented Nov 8, 2024

This was an intentional change with v3, but I think it's not easy to find in the docs.

In v3, mapping a route to a port on a process should "automatically" open that port (though, it currently requires a restart to take effect).

I have a demo repo that goes into details on more advanced sidecar networking: https://github.com/Gerg/cf-sidecar-networking

@jochenehret
Copy link
Contributor Author

A restart seems to do the trick: cloudfoundry/capi-bara-tests#105

@Gerg
Copy link
Member

Gerg commented Nov 11, 2024

Yes, I think in v2 it automatically restarts the app when you modify the exposed ports, but we removed that behavior in v3 to give users more control over when their apps restart.

@jochenehret
Copy link
Contributor Author

Ok, thanks for the clarification! Closing the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants