-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename to moby-ryuk, replace HTTP based scheduling with TCP connection
- Loading branch information
Showing
6 changed files
with
113 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
FROM golang:1.9 as workspace | ||
WORKDIR /go/src/github.com/bsideup/moby-massacrer | ||
WORKDIR /go/src/github.com/bsideup/moby-ryuk | ||
COPY glide.lock glide.yaml Makefile ./ | ||
RUN make bootstrap | ||
COPY . . | ||
RUN make build | ||
|
||
FROM alpine:latest | ||
RUN apk --no-cache add ca-certificates | ||
COPY --from=workspace /go/src/github.com/bsideup/moby-massacrer/bin/moby-massacrer /app | ||
COPY --from=workspace /go/src/github.com/bsideup/moby-ryuk/bin/moby-ryuk /app | ||
CMD ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
# Moby Massacrer | ||
# Moby Ryuk | ||
|
||
This project helps you to remove containers/networks/volumes by given filter after specified delay. | ||
|
||
# Usage | ||
|
||
1. Start it: | ||
|
||
$ ./bin/moby-massacrer -p 8080 | ||
$ ./bin/moby-ryuk -p 8080 | ||
$ # You can also run it with Docker | ||
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 bsideup/moby-massacrer | ||
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 bsideup/moby-ryuk | ||
|
||
1. Submit cleanup request: | ||
1. Connect via TCP: | ||
|
||
$ curl -d "label=testing=true" -d "health=unhealthy" http://localhost:8080/schedule?delay=1h | ||
$ nc localhost 8080 | ||
|
||
1. Realize that 1 hour is too long for the demo and change it to 5 seconds: | ||
1. Send some filters: | ||
|
||
$ curl -d "label=testing=true" -d "health=unhealthy" http://localhost:8080/schedule?delay=5s | ||
label=testing=true&health=unhealthy | ||
ACK | ||
label=something | ||
ACK | ||
|
||
1. See containers/networks/volumes deleted after 5s: | ||
1. Close the connection | ||
|
||
Removed 1 container(s), 0 network(s), 0 volume(s) | ||
1. Send more filters with "one-off" style: | ||
|
||
printf "label=something_else" | nc localhost 8080 | ||
|
||
1. See containers/networks/volumes deleted after 10s: | ||
|
||
2018/01/15 18:38:52 Timed out waiting for connection | ||
2018/01/15 18:38:52 Deleting {"label":{"something":true}} | ||
2018/01/15 18:38:52 Deleting {"label":{"something_else":true}} | ||
2018/01/15 18:38:52 Deleting {"health":{"unhealthy":true},"label":{"testing=true":true}} | ||
2018/01/15 18:38:52 Removed 1 container(s), 0 network(s), 0 volume(s) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters