Skip to content

Commit 79fcbe6

Browse files
committed
INITIAL COMMIT THAT IS INSANE, USE WITH CARE
1 parent 6b500f0 commit 79fcbe6

16 files changed

+179
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# TODO can probably use something thinner
2+
FROM python:latest
3+
4+
LABEL maintainer="Snyk Ltd"
5+
6+
RUN mkdir -p /srv/app
7+
WORKDIR /srv/app
8+
9+
RUN useradd --home-dir /srv/app -s /bin/bash snyk
10+
RUN chown -R snyk:snyk /srv/app
11+
USER snyk
12+
13+
# TODO maybe be more explicit about what we need?
14+
ADD --chown=snyk:snyk . .
15+
16+
# upgrade pip?
17+
RUN pip install --user -r requirements.txt
18+
19+
CMD ["bin/start"]

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
all: clean test build
2+
3+
clean:
4+
5+
build:
6+
docker build -t snyk-k8s-monitor .
7+
8+
install:
9+
pip install -r requirements.txt
10+
11+
test: export PYTHONPATH=.
12+
test:
13+
python -m unittest discover ./tests
14+
15+
.PHONY: all clean build install test

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# snyk-kubernetes-monitor
22
Docker container to monitor Kubernetes clusters' security
3+
4+
# developing locally
5+
https://kubernetes.io/docs/tasks/tools/install-minikube/
6+
7+
kubectl run snyk-k8s-monitor --image-pull-policy=Never --image=snyk-k8s-monitor:latest

bin/start

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /bin/sh
2+
PYTHONPATH=. python3 ./k8smonitor/main.py

k8smonitor/__init__.py

Whitespace-only changes.
154 Bytes
Binary file not shown.
368 Bytes
Binary file not shown.
284 Bytes
Binary file not shown.
692 Bytes
Binary file not shown.

k8smonitor/config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"KUBERNETES_AGENT": {
3+
"HOSTNAME": "127.0.0.1",
4+
"PORT": 8050
5+
}
6+
}

0 commit comments

Comments
 (0)