Backlog: Multi-port Traefik routing per app #149
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Today an app can only expose one external port through Traefik.
TraefikLabelBuilder.build(...)emits a singleloadbalancer.server.portlabel fromconfig.appPort()and a single router rule (path-prefix or subdomain). ThecontainerConfig.exposedPortsfield (UI: Resources → Exposed Ports) was only writing Docker'sConfig.ExposedPortsmetadata viawithExposedPorts(...)— it never produced a host binding or a Traefik route. The field is cosmetic and has been removed from the UI for now (see follow-up commit).Use case
Apps that need to expose two or more HTTP surfaces externally with different routing (e.g. a REST API on 9090 and a management/admin interface on 9091). Current workarounds:
appPort— independent Traefik routes, but 2× resource cost for the same JVM.cameleer-traefik/cameleer-env-{tenantId}-{envSlug}can reach any listening port via Docker DNS, no config needed.Proposal
Extend the container config to support N externally-routed ports:
containerConfig.additionalPorts: List<{ port: int, pathSuffix?: string, subdomainSuffix?: string }>(alongside the existingappPortwhich stays the primary).TraefikLabelBuilderemits one extratraefik.http.services.{svc}-{suffix}.loadbalancer.server.port+traefik.http.routers.{svc}-{suffix}.ruleper entry./{envSlug}/{appSlug}-admin/.{appSlug}-admin-{envSlug}.{domain}.ConfigMerger/ResolvedContainerConfig/ContainerRequestcarry the new list.sslOffloading/stripPathPrefixwith the primary, or do they get their own toggles? (Default: share — simpler.)Scope
exposedPortsJSONB values stay on disk;ConfigMergercan ignore them or a one-liner can drop them on next write.Out of scope
-p/withPortBindings) — not needed; all ingress flows through Traefik.Acceptance
curl.TraefikLabelBuilderunit tests cover multi-port label generation in both path and subdomain modes.