generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDebugTasks.yml
75 lines (72 loc) · 2.24 KB
/
DebugTasks.yml
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
---
version: "3"
tasks:
network:
desc: Create a netshoot container for debugging
cmds:
- kubectl run netshoot --rm -i --tty --image ghcr.io/nicolaka/netshoot:latest {{.CLI_ARGS}}
volume:
desc: |-
Create a container for debugging a PVC (ex. task PVC=plex-config-v1 debug:volume)
interactive: true
cmds:
- |
kubectl run -n $(kubectl get pvc -A | grep {{.PVC}} | awk '{print $1}') debug-{{.PVC}} -i --tty --rm --image=null --privileged --overrides='
{
"apiVersion": "v1",
"spec": {
"containers": [
{
"name": "debug",
"image": "ghcr.io/onedr0p/alpine:rolling",
"command": [
"/bin/bash"
],
"stdin": true,
"stdinOnce": true,
"tty": true,
"volumeMounts": [
{
"name": "config",
"mountPath": "/data/config"
},
{
"name": "backups",
"mountPath": "/data/backups"
}
]
}
],
"volumes": [
{
"name": "config",
"persistentVolumeClaim": {
"claimName": "{{.PVC}}"
}
},
{
"name": "backups",
"nfs": {
"server": "{{.NAS_ADDRESS | default "nas01"}}",
"path": "{{.NAS_PATH | default "/tank/data/backups"}}"
}
}
],
"restartPolicy": "Never"
}
}'
node:
desc: |-
Create a privileged container on a node for debugging (ex. task NODE=k8s-control01 debug:node)
interactive: true
cmds:
- |
kubectl run debug-{{.NODE}} -i --tty --rm --image="docker.io/library/alpine:3.16" --privileged --overrides='
{
"spec": {
"nodeSelector": {
"kubernetes.io/hostname": "{{.NODE}}"
},
"restartPolicy": "Never"
}
}'