File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Duct Tape
2+
3+ _ Caution: this is work-in-progress_
4+
5+ This repository gathers additional dependencies required to debug
6+ particular language runtimes with ` skaffold debug ` . These dependencies
7+ are packaged into an image container suitable for use as an
8+ ` initContainer ` on a pod.
9+
10+ Currently supported:
11+ * None!
12+
13+ In Progress:
14+
15+ * Go: provides Delve
16+
17+ ## Development
18+
19+ The idea is that ` skaffold debug ` will transform k8s manifests to
20+ make available any support files required to debug specific language
21+ runtimes. For example, the ` k8s-pod.yaml.orig ` file shows an k8s
22+ podspec that would be transformed to ` k8s-pod.yaml ` to:
23+ - mount a volume to hold the debugging support files
24+ - provide an initContainer to populate the volume
25+ - mount the volume to the applicable containers
Original file line number Diff line number Diff line change 1+ FROM golang:1.11 as delve
2+ RUN curl --location --output delve-1.2.0.tar.gz https://github.com/go-delve/delve/archive/v1.2.0.tar.gz \
3+ && tar xzf delve-1.2.0.tar.gz
4+ RUN cd delve-1.2.0/cmd/dlv && go install
5+
6+ #
7+ # FROM python:2.7 as python27
8+ # RUN curl --location --output ptsvd.zip https://github.com/Microsoft/ptvsd/archive/v4.2.4.zip \
9+ # && unzip ptsvd.zip \
10+ # && cd ptsvd-4.2.4 \
11+ # &&
12+
13+ # The debian image is about 95MB bigger
14+ FROM gcr.io/distroless/base:debug
15+ SHELL ["/busybox/sh" ,"-c" ]
16+ WORKDIR /duct-tape
17+ COPY --from=delve /go/bin/dlv .
18+ COPY install.sh /
19+ ENTRYPOINT ["/busybox/sh" , "/install.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+ echo " This is the duct-tape installation script!"
5+
6+ if [ ! -d /dbg ]; then
7+ echo " Debugging installation requires a volume mount at /dbg" 1>&2
8+ exit 1
9+ fi
10+
11+ # Install Delve for Go
12+ cp -p /duct-tape/dlv /dbg
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Pod
3+ metadata :
4+ name : demo-duct-tape
5+ labels :
6+ app : demo-duct-tape
7+ spec :
8+ initContainers :
9+ - name : apply-duct-tape
10+ image : gcr.io/gcp-dev-tools/duct-tape:latest
11+ volumeMounts :
12+ - name : dbg
13+ mountPath : " /dbg"
14+ containers :
15+ - name : helloworld1
16+ image : busybox
17+ command : ['sh', '-c', 'echo "The app is running"; ls / /dbg; sleep 3600']
18+ volumeMounts :
19+ - name : dbg
20+ mountPath : " /dbg"
21+ readOnly : true
22+ - name : helloworld2
23+ image : busybox
24+ command : ['sh', '-c', 'echo "The app is running"; ls / /dbg; sleep 3600']
25+ volumeMounts :
26+ - name : dbg
27+ mountPath : " /dbg"
28+ readOnly : true
29+ volumes :
30+ - name : dbg
31+ emptyDir : {}
Original file line number Diff line number Diff line change 1+ apiVersion: v1
2+ kind: Pod
3+ metadata:
4+ name: demo-duct-tape
5+ labels:
6+ app: demo-duct-tape
7+ spec:
8+ containers:
9+ - name: helloworld1
10+ image: busybox
11+ command: ['sh', '-c', 'echo "The app is running"; ls / /dbg; sleep 3600']
12+ - name: helloworld2
13+ image: busybox
14+ command: ['sh', '-c', 'echo "The app is running"; ls / /dbg; sleep 3600']
You can’t perform that action at this time.
0 commit comments