Skip to content

Gateway exports#3845

Merged
jvstme merged 11 commits intomasterfrom
gateway_exports
May 6, 2026
Merged

Gateway exports#3845
jvstme merged 11 commits intomasterfrom
gateway_exports

Conversation

@jvstme
Copy link
Copy Markdown
Collaborator

@jvstme jvstme commented May 4, 2026

Allow exporting gateways to other projects.

$ dstack export --project main
 NAME       FLEETS   GATEWAYS      IMPORTERS 
 my-export  -        main-gateway  team      

$ dstack import --project team
 NAME            FLEETS   GATEWAYS     
 main/my-export  -        main-gateway 

$ dstack gateway --project team
 NAME               BACKEND          HOSTNAME        DOMAIN                 DEFAULT  STATUS  
 main/main-gateway  aws (eu-west-1)  108.131.126.35  gtw.mycompany.example           running

Imported gateways can be used by specifying them in the gateway property in service configurations.

type: service
port: 80
image: nginx
gateway: main/main-gateway

Limitations:

  • Setting an imported gateway as the default gateway is not yet supported.
  • Evicting services from a gateway that is no longer imported is not yet supported.

#3851

@jvstme jvstme requested a review from r4victor May 5, 2026 11:24
@jvstme
Copy link
Copy Markdown
Collaborator Author

jvstme commented May 5, 2026

@r4victor, sorry for the huge PR. It's mostly boilerplate, but at least server/services and server/security are worth reviewing

async def get_gateway(
body: schemas.GetGatewayRequest,
session: AsyncSession = Depends(get_session),
user_project: Tuple[UserModel, ProjectModel] = Depends(ProjectMemberOrPublicAccess()),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems ProjectMemberOrPublicAccess() was used so that everyone could get gateways in public projects. Is the tightening intentional? Does the UI for public projects continue to work without problems?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Wasn't intentional, thanks

@jvstme jvstme merged commit a9b1db9 into master May 6, 2026
25 checks passed
@jvstme jvstme deleted the gateway_exports branch May 6, 2026 23:18
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