Browse Source

initial commit

master
dave 1 year ago
commit
1f3c48fca2
6 changed files with 170 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +3
    -0
      Dockerfile
  3. +16
    -0
      Makefile
  4. +24
    -0
      README.md
  5. +28
    -0
      antiroach.yml
  6. +97
    -0
      cmd/swarm/main.go

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
swarm
.DS_Store

+ 3
- 0
Dockerfile View File

@@ -0,0 +1,3 @@
FROM scratch
COPY swarm /
ENTRYPOINT ["/swarm"]

+ 16
- 0
Makefile View File

@@ -0,0 +1,16 @@
.PHONY: swarm
swarm:
go build -o swarm cmd/swarm/main.go

.PHONY: linux
linux:
GOOS=linux GOARCH=amd64 go build -o swarm -ldflags '-w -s' cmd/swarm/main.go
#GOOS=linux GOARCH=amd64 go build -o swarm cmd/swarm/main.go

.PHONY: clean
clean:
rm -vf swarm

.PHONY: image
image: linux
docker build -t dockermirror:5000/dpedu/antiroachswarm .

+ 24
- 0
README.md View File

@@ -0,0 +1,24 @@
# antiroachlol

## Building server binary

```
# A stripped binary
# You need golang...
go build -ldflags="-w -s" ./...
```
## Building docker

```
docker build -t antiroachlol
docker tag antiroachlol your.docker.endpoint.here/name
docker push your.docker.endpoint.here/name

```
## Building kubernetes

Edit `antiroach.yml` to match the docker name and desired replicas you put above and then apply it

```
kubectl apply -f antiroach.yml
```

+ 28
- 0
antiroach.yml View File

@@ -0,0 +1,28 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace:
name: antiroachlol
labels:
app: antiroachlol
spec:
replicas: 1
selector:
matchLabels:
app: antiroachlol
template:
metadata:
labels:
app: antiroachlol
spec:
containers:
- name: antiroachlol
image: dockermirror:5000/dpedu/antiroachswarm
env:
- name: IRC_SERVER
value: irc.129irc.com:6667
- name: IRC_CHANNEL
value: "#ansi"
- name: IRC_VICTIM
value: antiroach

+ 97
- 0
cmd/swarm/main.go
File diff suppressed because it is too large
View File


Loading…
Cancel
Save