Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create public container image for executing privileged swarm actions #2

Closed
bfosberry opened this issue Sep 19, 2015 · 1 comment
Closed
Assignees
Milestone

Comments

@bfosberry
Copy link
Collaborator

We need a public container we can run on a node in our cluster, which reaches out to the swarm cluster and performs privileged actions. Since no apis exist for this, and we will be remote this will have to be a container.

Container needs to have docker experimental client, and it'll have to be run with the DOCKER_HOST and certs for the swarm master node. Running it should execute the docker cluster change as needed.

These changes include

  • Create a ship on the cluster
  • Kill a ship
  • Move a ship between networks (kill the container, start it on the new network, update god api with details, this should not consitute a kill)

the image should be run with the following args, some of which are optional for remove:

  • ACTION - which action to perform (start/stop/move)
  • CONTAINER_ID - the id of the container on the cluster
  • CONTAINER_NAME - the user provided ship name
  • CONTAINER_IMAGE - the user provided ship image
  • DESIRED_NETWORK - which sector the ship should be started in
  • API_URL - a url to the God api for the ship to use

Move is a combination of start and stop, and tt should execute the following changes:

verify current network is not desired network
docker rm -f CONTAINER_ID
docker run --publish-service CONTAINER_NAME.DESIRED_NETWORK --name CONTAINER_NAME -tid CONTAINER_IMAGE
return the new CONTAINER_ID and HOST_IP
@bfosberry
Copy link
Collaborator Author

This is done, image repo is bfosberry/docker-than-light-controller available at https://github.com/bfosberry/docker-than-light-controller/

This issue was closed.
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

No branches or pull requests

1 participant