-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathk8s-test-go125.yaml
More file actions
89 lines (87 loc) · 1.8 KB
/
Copy pathk8s-test-go125.yaml
File metadata and controls
89 lines (87 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# This test approximates `skaffold debug` for a go app.
apiVersion: v1
kind: Pod
metadata:
name: go125pod
labels:
app: hello
protocol: dlv
runtime: go125
spec:
containers:
- name: go125app
image: go125app
args:
- /dbg/go/bin/dlv
- exec
- --log
- --headless
- --continue
- --accept-multiclient
# listen on 0.0.0.0 as it is exposed as a service
- --listen=0.0.0.0:56286
- --api-version=2
- ./app
ports:
- containerPort: 8080
- containerPort: 56286
name: dlv
readinessProbe:
httpGet:
path: /
port: 8080
volumeMounts:
- mountPath: /dbg
name: go-debugging-support
initContainers:
- image: skaffold-debug-go
name: install-go-support
resources: {}
volumeMounts:
- mountPath: /dbg
name: go-debugging-support
volumes:
- emptyDir: {}
name: go-debugging-support
---
apiVersion: v1
kind: Service
metadata:
name: hello-dlv-go125
spec:
ports:
- name: http
port: 8080
protocol: TCP
- name: dlv
port: 56286
protocol: TCP
selector:
app: hello
protocol: dlv
runtime: go125
---
apiVersion: batch/v1
kind: Job
metadata:
name: connect-to-go125
labels:
project: container-debug-support
type: integration-test
spec:
ttlSecondsAfterFinished: 10
backoffLimit: 1
template:
spec:
restartPolicy: Never
initContainers:
- name: wait-for-go125
image: kubectl
command: [sh, -c, "while ! curl -s hello-dlv-go125:8080 2>/dev/null; do echo waiting for app; sleep 1; done"]
containers:
- name: dlv-to-go125
image: skaffold-debug-go
command: [sh, -c, '
(echo bt; echo exit -c) > init.txt;
set -x;
/duct-tape/go/bin/dlv connect --init init.txt hello-dlv-go125:56286']