Skip to content

Ability to specify static port when using --enable-lb-port-mapping #417

Description

@jarpoole

This was suggested a while back in #182 and while I agree that port conflicts could be undesirable, the dramatic increase in complexity required to dynamically retrieve the ephemeral port and configure it in dependent applications is not worth it for local development IMO.

I would really like to see a --port or --publish flag added for this. Would a PR be accepted?

As an aside, the --enable-lb-port-mapping flag did not seem to work for me at first and I found it very difficult to debug because it seems like the port information returned about the kindccm envoy container is incorrect:

docker ps

CONTAINER ID   IMAGE                      COMMAND                  CREATED          STATUS          PORTS                                                                    NAMES
4cebb83e06dc   envoyproxy/envoy:v1.33.2   "/docker-entrypoint.…"   41 minutes ago   Up 41 minutes   127.0.0.1:32784->80/tcp, 0.0.0.0:32785->10000/tcp, :::32785->10000/tcp   kindccm-gw-4eff45ecc9be
4671e3a7b274   kindest/node:v1.35.0       "/usr/local/bin/entr…"   42 minutes ago   Up 42 minutes   127.0.0.1:46517->6443/tcp                                                control-plane

Based on 127.0.0.1:32784->80/tcp, I tried curl localhost:32784 from the host but this does not work.

However I eventually discovered that docker port reports different, seemingly more up to date information:

docker port kindccm-gw-4eff45ecc9be

80/tcp -> 0.0.0.0:65481
10000/tcp -> 0.0.0.0:32785
10000/tcp -> [::]:32785

And sure enough, curl localhost:65481 does work....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions