Skip to content

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

Closed

Description

@jochenehret

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.

Activity

  1. Gerg commented on Nov 8, 2024

    @Gerg
    Member

    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

  2. jochenehret commented on Nov 11, 2024

    @jochenehret
    ContributorAuthor

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

  3. Gerg commented on Nov 11, 2024

    @Gerg
    Member

    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.

  4. jochenehret commented on Nov 12, 2024

    @jochenehret
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions