Skip to content

Commit

Permalink
organize kubernetes daemonset
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay288 committed Sep 29, 2022
1 parent 107cd3a commit 91bf94c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ build-dockers:
docker build -f deploy/backend/Dockerfile -t metlo/backend:latest .
docker build -f deploy/frontend/Dockerfile -t metlo/frontend:latest .
docker build -f deploy/jobrunner/Dockerfile -t metlo/jobrunner:latest .
docker build -f deploy/suricata-daemon/Dockerfile -t metlo/suricata-daemon:latest .

push-latest-dockers:
docker push metlo/backend:latest
docker push metlo/frontend:latest
docker push metlo/jobrunner:latest
docker push metlo/jobrunner:latest
docker push metlo/suricata-daemon:latest
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ RUN apk add --no-cache grep procps git suricata=$VERSION

WORKDIR /app

COPY . /app
ADD ../../../deploy/suricata-daemon suricata-daemon
ADD ../../../ingestors/suricata metlo-ingestor

RUN chmod +x /app/entrypoint.sh
RUN chmod +x /app/suricata-daemon/entrypoint.sh

# Setup pre-reqs
RUN mkdir -p /etc/metlo-ingestor && \
cd /etc/ && \
rm -rf /etc/metlo-ingestor/* && \
git clone https://github.com/metlo-labs/metlo.git metlo-ingestor && \
mkdir -p /etc/metlo-ingestor/ingestors && \
cp -r /app/metlo-ingestor /etc/metlo-ingestor/ingestors/suricata && \
cd /etc/metlo-ingestor && \
mkdir -p /etc/suricata-logs && \
chmod 777 /etc/suricata-logs && \
mkdir -p /var/lib/suricata && \
mkdir -p /var/lib/suricata/rules

RUN cp /app/suricata.yaml /etc/suricata/suricata.yaml && \
cp /app/local.rules /var/lib/suricata/rules
RUN cp /app/suricata-daemon/suricata.yaml /etc/suricata/suricata.yaml && \
cp /app/suricata-daemon/local.rules /var/lib/suricata/rules

RUN cd /etc/metlo-ingestor/ingestors/suricata && \
yarn install && \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions ingestors/kubernetes/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: metlo-daemonset-pod
spec:
selector:
matchLabels:
name: metlo-app
template:
metadata:
labels:
name: metlo-app
spec:
containers:
- name: suricata-daemon
image: metlo/suricata-daemon
imagePullPolicy: Never
securityContext:
privileged: true
env:
- name: METLO_ADDR
value: <YOUR METLO HOST ADDRESS>
- name: METLO_KEY
value: <YOUR METLO API KEY>
nodeSelector:
<SOME APP SELECTOR>

0 comments on commit 91bf94c

Please sign in to comment.