From 5c0753d863ef5573516443109f11ac829fc39ed9 Mon Sep 17 00:00:00 2001 From: ddiiwoong Date: Tue, 3 Aug 2021 18:01:16 +0900 Subject: [PATCH 1/2] add docker packaging files --- cmd/goul/Dockerfile | 14 ++++++++++++++ cmd/goul/docker-compose.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 cmd/goul/Dockerfile create mode 100644 cmd/goul/docker-compose.yml diff --git a/cmd/goul/Dockerfile b/cmd/goul/Dockerfile new file mode 100644 index 0000000..24717d9 --- /dev/null +++ b/cmd/goul/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:alpine AS build +RUN apk add --update git gcc musl-dev libpcap-dev openssh-client + +WORKDIR /app +COPY . . +RUN go mod init nexclipper/goul +RUN go mod tidy +RUN go build -o goul + +FROM alpine +LABEL version=0.1.0 +RUN apk add --update --no-cache libpcap-dev +COPY --from=build /app/goul /usr/bin/goul +CMD [ "goul", "--help" ] \ No newline at end of file diff --git a/cmd/goul/docker-compose.yml b/cmd/goul/docker-compose.yml new file mode 100644 index 0000000..c1c7646 --- /dev/null +++ b/cmd/goul/docker-compose.yml @@ -0,0 +1,30 @@ +version: '3' +services: + goul-server: + image: nexclipper/goul:0.2-head + restart: always + privileged: true + environment: + - GOUL_DEVICE="eth0" + ports: + - "6001:6001" + command: + - goul + - --server + - --debug + - --dev=eth0 + + goul-client: + image: nexclipper/goul:0.2-head + depends_on: + - goul-server + links: + - goul-server + environment: + - GOUL_SERVER_ADDRESS="goul-server" + - GOUL_DEVICE="eth0" + command: + - goul + - --addr=goul-server + - --dev=eth0 + - --debug From 174409e7dd311796edd1811e89deeba0cc5c8fe2 Mon Sep 17 00:00:00 2001 From: ddiiwoong Date: Tue, 3 Aug 2021 19:37:36 +0900 Subject: [PATCH 2/2] add kubernetes manifests --- cmd/goul/goul-client.yml | 34 ++++++++++++++++++++++++++++++++++ cmd/goul/goul-server.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 cmd/goul/goul-client.yml create mode 100644 cmd/goul/goul-server.yml diff --git a/cmd/goul/goul-client.yml b/cmd/goul/goul-client.yml new file mode 100644 index 0000000..1e1c2ca --- /dev/null +++ b/cmd/goul/goul-client.yml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: goul-client + namespace: nc + labels: + app: goul-client +spec: + replicas: 1 + selector: + matchLabels: + app: goul-client + template: + metadata: + labels: + app: goul-client + spec: + # nodeSelector: + # key: client + hostNetwork: true + containers: + - name: goul-client + image: nexclipper/goul:0.2-head + ports: + - containerPort: 6001 + env: + - name: GOUL_PORT + value: "6001" + - name: GOUL_DEVICE + value: "ens6f0" + - name: GOUL_SERVER_ADDRESS + value: "172.16.9.126" + command: ["goul"] + args: ["--addr=$(GOUL_SERVER_ADDRESS)", "--debug", "--dev=$(GOUL_DEVICE)", "--port=$(GOUL_PORT)"] diff --git a/cmd/goul/goul-server.yml b/cmd/goul/goul-server.yml new file mode 100644 index 0000000..21d5a81 --- /dev/null +++ b/cmd/goul/goul-server.yml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: goul-server + namespace: nc + labels: + app: goul-server +spec: + replicas: 1 + selector: + matchLabels: + app: goul-server + template: + metadata: + labels: + app: goul-server + spec: + # nodeSelector: + # key: server + hostNetwork: true + containers: + - name: goul-server + image: nexclipper/goul:0.2-head + ports: + - containerPort: 6001 + env: + - name: GOUL_DEVICE + value: "ens6f0" + command: ["goul"] + args: ["--server", "--debug", "--dev=$(GOUL_DEVICE)"]