Skip to content

feat: allow ip prefix in x-ports#358

Open
miekg wants to merge 14 commits into
psviderski:mainfrom
miekg:miek/26/mei06wo/hostip
Open

feat: allow ip prefix in x-ports#358
miekg wants to merge 14 commits into
psviderski:mainfrom
miekg:miek/26/mei06wo/hostip

Conversation

@miekg
Copy link
Copy Markdown
Contributor

@miekg miekg commented May 6, 2026

This allows you to specify a, portable but global compose that binds only to certain interfaces. Namely those that are contained in the prefix spec.

This should a better idea than #333

This allows you to specify a, portable but global compose that binds
only to certain interfaces. Namely those that are contained in the
prefix spec.

This should a better idea than psviderski#333

Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg miekg changed the title feat: allow ip prefix in x-port feat: allow ip prefix in x-ports May 6, 2026
Signed-off-by: Miek Gieben <miek@miek.nl>
miekg added 2 commits May 11, 2026 09:45
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg
Copy link
Copy Markdown
Contributor Author

miekg commented May 11, 2026

finally came around to actually deploy this, with the fixed I pushed:

% uc deploy -y     
Deployment plan

+ create service caddy (global)
  │   image: registry.science.ru.nl/cncz/sys/image/caddy:v0.1.14
  │
  ├── +   run container caddy on machine-lyrk
  ╰── +   run container caddy on machine-vkre

────────────────────────────
2 create · across 2 machines

[+] Deploying 6/6
 ✔ Container caddy-el2a on machine-lyrk                                   Running                                                      7.3s
   ✔ Image registry.science.ru.nl/cncz/sys/image/caddy:v0.1.14 on machine-lyrk  Pulled                                                 1.9s
 ✔ Container caddy-yntr on machine-vkre                                   Running                                                      6.5s
   ✔ Image registry.science.ru.nl/cncz/sys/image/caddy:v0.1.14 on machine-vkre  Pulled                                                 1.1s
%    
% uc ls        
NAME    MODE     REPLICAS   IMAGE                                                 ENDPOINTS
caddy   global   2          registry.science.ru.nl/cncz/sys/image/caddy:v0.1.14   (custom Caddy config)
%   
% uc ls|cat 
Connecting to ssh://test@uncloud2.vm.science.ru.nl
Connected to cluster.
NAME    MODE     REPLICAS   IMAGE                                                 ENDPOINTS
caddy   global   2          registry.science.ru.nl/cncz/sys/image/caddy:v0.1.14   (custom Caddy config)

with

    x-ports:
      - 80:80@host
      - 443:443@host
      - 443:443/udp@host
      - 131.174.88.0/24:53:53/tcp@host
      - 131.174.88.0/24:53:53/udp@host

Signed-off-by: Miek Gieben <miek@miek.nl>
Copy link
Copy Markdown
Owner

@psviderski psviderski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good but please see a comment about another unhandled case when splitting by slashes. We might want to rework the entire logic to start splitting by colons first.

Comment thread pkg/api/port.go Outdated
Comment thread pkg/api/port.go
Comment thread pkg/api/port.go Outdated
Comment thread pkg/api/port.go
Comment thread internal/machine/docker/interface.go Outdated
Comment thread internal/machine/docker/interface.go Outdated
Comment thread cmd/uncloud/service/run.go Outdated
Comment thread website/docs/3-concepts/2-ingress/2-publishing-services.md Outdated
Comment thread website/docs/3-concepts/2-ingress/2-publishing-services.md Outdated
miekg and others added 9 commits May 12, 2026 12:06
Co-authored-by: Pasha Sviderski <me@psviderski.name>
Co-authored-by: Pasha Sviderski <me@psviderski.name>
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Added this back, makes diff smaller

Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Miek Gieben <miek@miek.nl>
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

Successfully merging this pull request may close these issues.

2 participants