Skip to content

Commit f22da6d

Browse files
author
Néstor Salceda
committed
Use sysdig/sysdig image directly
Avoid paying the maintenance price of having another image while it can be done just with the sysdig/sysdig one
1 parent fb415f7 commit f22da6d

File tree

4 files changed

+7
-43
lines changed

4 files changed

+7
-43
lines changed

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
.PHONY: test
22

3-
build_and_push:
4-
docker build -t sysdig/capture-and-sleep docker/
5-
docker push sysdig/capture-and-sleep
6-
73
test:
84
bats test/*.bats

docker/Dockerfile

Lines changed: 0 additions & 11 deletions
This file was deleted.

docker/docker-entrypoint.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

kubectl-sysdig_capture

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ metadata:
7575
spec:
7676
containers:
7777
- name: capturer
78-
image: sysdig/capture-and-sleep
78+
image: sysdig/sysdig
79+
args:
80+
- /bin/bash
81+
- "-c"
82+
- "echo '* Capturing system calls'; sysdig -S -M ${duration} -pk -z -w /${capture_pod}.scap.gz; touch /.finished; trap 'exit 0' TERM; sleep infinity & wait $!"
7983
imagePullPolicy: IfNotPresent
8084
securityContext:
8185
privileged: true
@@ -86,11 +90,6 @@ spec:
8690
limits:
8791
cpu: 100m
8892
memory: 128Mi
89-
env:
90-
- name: CAPTURE_DURATION
91-
value: "${duration}"
92-
- name: CAPTURE_FILE_NAME
93-
value: ${capture_pod}
9493
volumeMounts:
9594
- mountPath: /host/var/run/docker.sock
9695
name: docker-socket
@@ -147,12 +146,12 @@ EOF
147146

148147
sleep ${duration}
149148
while [[ ! -e .finished ]]; do
150-
kubectl cp ${capture_pod}:/captures/.finished .finished > /dev/null 2>&1
149+
kubectl cp ${capture_pod}:/.finished .finished > /dev/null 2>&1
151150
sleep 20
152151
done
153152
rm .finished
154153

155-
kubectl cp ${capture_pod}:/captures/${capture_pod}.scap.gz ${capture_pod}.scap.gz > /dev/null 2>&1
154+
kubectl cp ${capture_pod}:/${capture_pod}.scap.gz ${capture_pod}.scap.gz > /dev/null 2>&1
156155
kubectl delete pod ${capture_pod} > /dev/null 2>&1
157156
echo "Your capture is now available at ${capture_pod}.scap.gz"
158157
}

0 commit comments

Comments
 (0)