Skip to content

feat: Docker Swarm API emulation on Kubernetes#17

Merged
stevensbkang merged 3 commits intoportainer:developfrom
neil-cresswell-portainer:feature/swarm-mode
Apr 16, 2026
Merged

feat: Docker Swarm API emulation on Kubernetes#17
stevensbkang merged 3 commits intoportainer:developfrom
neil-cresswell-portainer:feature/swarm-mode

Conversation

@neil-cresswell-portainer
Copy link
Copy Markdown
Collaborator

Implements the Docker Swarm API surface backed by Kubernetes, allowing existing Swarm toolchains (Docker CLI, Portainer) to transparently use a Kubernetes cluster as a Swarm backend.

Endpoints implemented:

  • GET/POST /swarm, /swarm/init, /swarm/leave
  • GET/POST /nodes, /nodes/{id}, /nodes/{id}/update
  • POST /services/create, GET /services, GET/POST/DELETE /services/{id}
  • GET /services/{id}/logs (multiplexed stream with swarm details context)
  • GET /tasks, GET /tasks/{id}
  • POST/GET/DELETE /secrets, /configs
  • GET /stacks, DELETE /stacks/{name}
  • GET/POST/DELETE /networks (with label filtering)

Tested and confirmed working:

  • docker service create/ls/scale/update/rm with progress convergence
  • docker service logs and --follow with context cancellation
  • docker stack deploy/ls/ps/rm alongside standalone services
  • docker secret and docker config CRUD
  • Portainer Swarm cluster view, networks, services, stacks

Implements the Docker Swarm API surface backed by Kubernetes, allowing
existing Swarm toolchains (Docker CLI, Portainer) to transparently use
a Kubernetes cluster as a Swarm backend.

Endpoints implemented:
- GET/POST /swarm, /swarm/init, /swarm/leave
- GET/POST /nodes, /nodes/{id}, /nodes/{id}/update
- POST /services/create, GET /services, GET/POST/DELETE /services/{id}
- GET /services/{id}/logs (multiplexed stream with swarm details context)
- GET /tasks, GET /tasks/{id}
- POST/GET/DELETE /secrets, /configs
- GET /stacks, DELETE /stacks/{name}
- GET/POST/DELETE /networks (with label filtering)

Tested and confirmed working:
- docker service create/ls/scale/update/rm with progress convergence
- docker service logs and --follow with context cancellation
- docker stack deploy/ls/ps/rm alongside standalone services
- docker secret and docker config CRUD
- Portainer Swarm cluster view, networks, services, stacks
Comment thread internal/api/system/system.go
Comment thread internal/router/router.go
@stevensbkang stevensbkang merged commit 324ab69 into portainer:develop Apr 16, 2026
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