-
Notifications
You must be signed in to change notification settings - Fork 277
/
debug-driver.yaml
157 lines (155 loc) · 4.37 KB
/
debug-driver.yaml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-secrets-store
namespace: kube-system
spec:
selector:
matchLabels:
app: csi-secrets-store
template:
metadata:
labels:
app: csi-secrets-store
annotations:
kubectl.kubernetes.io/default-container: secrets-store
spec:
serviceAccountName: secrets-store-csi-driver
containers:
- name: node-driver-registrar
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.2.0
args:
- --v=5
- --csi-address=/csi/csi.sock
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi-secrets-store/csi.sock
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
imagePullPolicy: IfNotPresent
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi
- name: liveness-probe
image: registry.k8s.io/sig-storage/livenessprobe:v2.3.0
imagePullPolicy: IfNotPresent
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --http-endpoint=0.0.0.0:9808
- -v=2
volumeMounts:
- name: plugin-dir
mountPath: /csi
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 10m
memory: 20Mi
volumes:
- name: mountpoint-dir
hostPath:
path: /var/lib/kubelet/pods
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-secrets-store/
type: DirectoryOrCreate
- name: providers-dir
hostPath:
path: /etc/kubernetes/secrets-store-csi-providers
type: DirectoryOrCreate
---
# Separate deployment to manage actual driver debugging independent of node registrar and livenessprobe
apiVersion: apps/v1
kind: Deployment
metadata:
name: debug-driver
namespace: kube-system
spec:
replicas: 1 # Keep single replica for debugging
selector:
matchLabels:
app: debug-driver
template:
metadata:
labels:
app: debug-driver
spec:
serviceAccountName: secrets-store-csi-driver
containers:
- name: debug-driver
image: debug-driver:latest # dlv debug image built locally
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
volumeMounts:
- mountPath: /secrets-store-csi-driver-codebase
name: driver-volume
- name: plugin-dir
mountPath: /csi
- name: mountpoint-dir
mountPath: /var/lib/kubelet/pods
mountPropagation: Bidirectional
- name: providers-dir
mountPath: /etc/kubernetes/secrets-store-csi-providers
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 250m
memory: 512Mi
volumes:
- name: driver-volume
persistentVolumeClaim:
claimName: driver-pvc
- name: mountpoint-dir
hostPath:
path: /var/lib/kubelet/pods
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-secrets-store/
type: DirectoryOrCreate
- name: providers-dir
hostPath:
path: /etc/kubernetes/secrets-store-csi-providers
type: DirectoryOrCreate
---
# Service to connect dlv apis
apiVersion: v1
kind: Service
metadata:
name: service-debug
namespace: kube-system
spec:
type: NodePort
selector:
app: debug-driver
ports:
- name: debug
port: 30123
targetPort: 30123
nodePort: 30123