Skip to content

Commit 03204df

Browse files
aayushrangwalaAyush Rangwala
authored and
Ayush Rangwala
committed
Add a script to remove all the resources deployed as the part of CSI Driver
- added a version specific destroy script parallel to deploy-script - added labels to all the resources of csi deployment along with the podSpec template label-selector - added labels to rbac files on the fly locally in /tmp/* folder to be able to track using kustomize - cleanup gitignore - Useful to cleanup the resources which can interfere with the redeployments or on some automations based on the Driver deployment
1 parent d0d44ab commit 03204df

28 files changed

+400
-53
lines changed

deploy/kubernetes-1.18/destroy.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../util/destroy-hostpath.sh

deploy/kubernetes-1.18/hostpath/csi-hostpath-attacher.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@ kind: StatefulSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-hostpath-attacher
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: csi-hostpath-attacher
9+
app.kubernetes.io/component: attacher
510
spec:
611
serviceName: "csi-hostpath-attacher"
712
replicas: 1
813
selector:
914
matchLabels:
10-
app: csi-hostpath-attacher
15+
app.kubernetes.io/instance: hostpath.csi.k8s.io
16+
app.kubernetes.io/part-of: csi-driver-host-path
17+
app.kubernetes.io/name: csi-hostpath-attacher
18+
app.kubernetes.io/component: attacher
1119
template:
1220
metadata:
1321
labels:
14-
app: csi-hostpath-attacher
22+
app.kubernetes.io/instance: hostpath.csi.k8s.io
23+
app.kubernetes.io/part-of: csi-driver-host-path
24+
app.kubernetes.io/name: csi-hostpath-attacher
25+
app.kubernetes.io/component: attacher
1526
spec:
1627
affinity:
1728
podAffinity:
1829
requiredDuringSchedulingIgnoredDuringExecution:
1930
- labelSelector:
2031
matchExpressions:
21-
- key: app
32+
- key: app.kubernetes.io/name
2233
operator: In
2334
values:
2435
- csi-hostpathplugin

deploy/kubernetes-1.18/hostpath/csi-hostpath-driverinfo.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ apiVersion: storage.k8s.io/v1
22
kind: CSIDriver
33
metadata:
44
name: hostpath.csi.k8s.io
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: hostpath.csi.k8s.io
9+
app.kubernetes.io/component: csi-driver
510
spec:
611
# Supports persistent and ephemeral inline volumes.
712
volumeLifecycleModes:

deploy/kubernetes-1.18/hostpath/csi-hostpath-plugin.yaml

+21-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ apiVersion: v1
77
metadata:
88
name: csi-hostpathplugin
99
labels:
10-
app: csi-hostpathplugin
10+
app.kubernetes.io/instance: hostpath.csi.k8s.io
11+
app.kubernetes.io/part-of: csi-driver-host-path
12+
app.kubernetes.io/name: csi-hostpathplugin
13+
app.kubernetes.io/component: plugin
1114
spec:
1215
selector:
13-
app: csi-hostpathplugin
16+
app.kubernetes.io/instance: hostpath.csi.k8s.io
17+
app.kubernetes.io/part-of: csi-driver-host-path
18+
app.kubernetes.io/name: csi-hostpathplugin
19+
app.kubernetes.io/component: plugin
1420
ports:
1521
- name: dummy
1622
port: 12345
@@ -19,6 +25,11 @@ kind: StatefulSet
1925
apiVersion: apps/v1
2026
metadata:
2127
name: csi-hostpathplugin
28+
labels:
29+
app.kubernetes.io/instance: hostpath.csi.k8s.io
30+
app.kubernetes.io/part-of: csi-driver-host-path
31+
app.kubernetes.io/name: csi-hostpathplugin
32+
app.kubernetes.io/component: plugin
2233
spec:
2334
serviceName: "csi-hostpathplugin"
2435
# One replica only:
@@ -28,11 +39,17 @@ spec:
2839
replicas: 1
2940
selector:
3041
matchLabels:
31-
app: csi-hostpathplugin
42+
app.kubernetes.io/instance: hostpath.csi.k8s.io
43+
app.kubernetes.io/part-of: csi-driver-host-path
44+
app.kubernetes.io/name: csi-hostpathplugin
45+
app.kubernetes.io/component: plugin
3246
template:
3347
metadata:
3448
labels:
35-
app: csi-hostpathplugin
49+
app.kubernetes.io/instance: hostpath.csi.k8s.io
50+
app.kubernetes.io/part-of: csi-driver-host-path
51+
app.kubernetes.io/name: csi-hostpathplugin
52+
app.kubernetes.io/component: plugin
3653
spec:
3754
serviceAccountName: csi-external-health-monitor-controller
3855
containers:

deploy/kubernetes-1.18/hostpath/csi-hostpath-provisioner.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@ kind: StatefulSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-hostpath-provisioner
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: csi-hostpath-provisioner
9+
app.kubernetes.io/component: provisioner
510
spec:
611
serviceName: "csi-hostpath-provisioner"
712
replicas: 1
813
selector:
914
matchLabels:
10-
app: csi-hostpath-provisioner
15+
app.kubernetes.io/instance: hostpath.csi.k8s.io
16+
app.kubernetes.io/part-of: csi-driver-host-path
17+
app.kubernetes.io/name: csi-hostpath-provisioner
18+
app.kubernetes.io/component: provisioner
1119
template:
1220
metadata:
1321
labels:
14-
app: csi-hostpath-provisioner
22+
app.kubernetes.io/instance: hostpath.csi.k8s.io
23+
app.kubernetes.io/part-of: csi-driver-host-path
24+
app.kubernetes.io/name: csi-hostpath-provisioner
25+
app.kubernetes.io/component: provisioner
1526
spec:
1627
affinity:
1728
podAffinity:
1829
requiredDuringSchedulingIgnoredDuringExecution:
1930
- labelSelector:
2031
matchExpressions:
21-
- key: app
32+
- key: app.kubernetes.io/name
2233
operator: In
2334
values:
2435
- csi-hostpathplugin

deploy/kubernetes-1.18/hostpath/csi-hostpath-resizer.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@ kind: StatefulSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-hostpath-resizer
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: csi-hostpath-resizer
9+
app.kubernetes.io/component: resizer
510
spec:
611
serviceName: "csi-hostpath-resizer"
712
replicas: 1
813
selector:
914
matchLabels:
10-
app: csi-hostpath-resizer
15+
app.kubernetes.io/instance: hostpath.csi.k8s.io
16+
app.kubernetes.io/part-of: csi-driver-host-path
17+
app.kubernetes.io/name: csi-hostpath-resizer
18+
app.kubernetes.io/component: resizer
1119
template:
1220
metadata:
1321
labels:
14-
app: csi-hostpath-resizer
22+
app.kubernetes.io/instance: hostpath.csi.k8s.io
23+
app.kubernetes.io/part-of: csi-driver-host-path
24+
app.kubernetes.io/name: csi-hostpath-resizer
25+
app.kubernetes.io/component: resizer
1526
spec:
1627
affinity:
1728
podAffinity:
1829
requiredDuringSchedulingIgnoredDuringExecution:
1930
- labelSelector:
2031
matchExpressions:
21-
- key: app
32+
- key: app.kubernetes.io/name
2233
operator: In
2334
values:
2435
- csi-hostpathplugin

deploy/kubernetes-1.18/hostpath/csi-hostpath-snapshotter.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@ kind: StatefulSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-hostpath-snapshotter
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: csi-hostpath-snapshotter
9+
app.kubernetes.io/component: snapshotter
510
spec:
611
serviceName: "csi-hostpath-snapshotter"
712
replicas: 1
813
selector:
914
matchLabels:
10-
app: csi-hostpath-snapshotter
15+
app.kubernetes.io/instance: hostpath.csi.k8s.io
16+
app.kubernetes.io/part-of: csi-driver-host-path
17+
app.kubernetes.io/name: csi-hostpath-snapshotter
18+
app.kubernetes.io/component: snapshotter
1119
template:
1220
metadata:
1321
labels:
14-
app: csi-hostpath-snapshotter
22+
app.kubernetes.io/instance: hostpath.csi.k8s.io
23+
app.kubernetes.io/part-of: csi-driver-host-path
24+
app.kubernetes.io/name: csi-hostpath-snapshotter
25+
app.kubernetes.io/component: snapshotter
1526
spec:
1627
affinity:
1728
podAffinity:
1829
requiredDuringSchedulingIgnoredDuringExecution:
1930
- labelSelector:
2031
matchExpressions:
21-
- key: app
32+
- key: app.kubernetes.io/name
2233
operator: In
2334
values:
2435
- csi-hostpathplugin

deploy/kubernetes-1.18/hostpath/csi-hostpath-testing.yaml

+23-4
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,53 @@ apiVersion: v1
1111
kind: Service
1212
metadata:
1313
name: hostpath-service
14+
labels:
15+
app.kubernetes.io/instance: hostpath.csi.k8s.io
16+
app.kubernetes.io/part-of: csi-driver-host-path
17+
app.kubernetes.io/name: csi-hostpath-socat
18+
app.kubernetes.io/component: socat
1419
spec:
1520
type: NodePort
1621
selector:
17-
app: csi-hostpath-socat
22+
app.kubernetes.io/instance: hostpath.csi.k8s.io
23+
app.kubernetes.io/part-of: csi-driver-host-path
24+
app.kubernetes.io/name: csi-hostpath-socat
25+
app.kubernetes.io/component: socat
1826
ports:
1927
- port: 10000 # fixed port inside the pod, dynamically allocated port outside
2028
---
2129
kind: StatefulSet
2230
apiVersion: apps/v1
2331
metadata:
2432
name: csi-hostpath-socat
33+
labels:
34+
app.kubernetes.io/instance: hostpath.csi.k8s.io
35+
app.kubernetes.io/part-of: csi-driver-host-path
36+
app.kubernetes.io/name: csi-hostpath-socat
37+
app.kubernetes.io/component: socat
2538
spec:
2639
serviceName: "csi-hostpath-socat"
2740
replicas: 1
2841
selector:
2942
matchLabels:
30-
app: csi-hostpath-socat
43+
app.kubernetes.io/instance: hostpath.csi.k8s.io
44+
app.kubernetes.io/part-of: csi-driver-host-path
45+
app.kubernetes.io/name: csi-hostpath-socat
46+
app.kubernetes.io/component: socat
3147
template:
3248
metadata:
3349
labels:
34-
app: csi-hostpath-socat
50+
app.kubernetes.io/instance: hostpath.csi.k8s.io
51+
app.kubernetes.io/part-of: csi-driver-host-path
52+
app.kubernetes.io/name: csi-hostpath-socat
53+
app.kubernetes.io/component: socat
3554
spec:
3655
affinity:
3756
podAffinity:
3857
requiredDuringSchedulingIgnoredDuringExecution:
3958
- labelSelector:
4059
matchExpressions:
41-
- key: app
60+
- key: app.kubernetes.io/name
4261
operator: In
4362
values:
4463
- csi-hostpathplugin

deploy/kubernetes-1.18/snapshotter/csi-hostpath-snapshotclass.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@ apiVersion: snapshot.storage.k8s.io/v1beta1
22
kind: VolumeSnapshotClass
33
metadata:
44
name: csi-hostpath-snapclass
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: csi-hostpath-snapclass
9+
app.kubernetes.io/component: volumesnapshotclass
510
driver: hostpath.csi.k8s.io #csi-hostpath
611
deletionPolicy: Delete

deploy/kubernetes-1.20/destroy.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../util/destroy-hostpath.sh

deploy/kubernetes-1.20/hostpath/csi-hostpath-attacher.yaml

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,37 @@ kind: StatefulSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-hostpath-attacher
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: csi-hostpath-attacher
9+
app.kubernetes.io/component: attacher
510
spec:
611
serviceName: "csi-hostpath-attacher"
712
replicas: 1
813
selector:
914
matchLabels:
10-
app: csi-hostpath-attacher
15+
app.kubernetes.io/instance: hostpath.csi.k8s.io
16+
app.kubernetes.io/part-of: csi-driver-host-path
17+
app.kubernetes.io/name: csi-hostpath-attacher
18+
app.kubernetes.io/component: attacher
1119
template:
1220
metadata:
1321
labels:
14-
app: csi-hostpath-attacher
22+
app.kubernetes.io/instance: hostpath.csi.k8s.io
23+
app.kubernetes.io/part-of: csi-driver-host-path
24+
app.kubernetes.io/name: csi-hostpath-attacher
25+
app.kubernetes.io/component: attacher
1526
spec:
1627
affinity:
1728
podAffinity:
1829
requiredDuringSchedulingIgnoredDuringExecution:
1930
- labelSelector:
2031
matchExpressions:
21-
- key: app
32+
- key: app.kubernetes.io/instance
2233
operator: In
2334
values:
24-
- csi-hostpathplugin
35+
- hostpath.csi.k8s.io
2536
topologyKey: kubernetes.io/hostname
2637
serviceAccountName: csi-attacher
2738
containers:

deploy/kubernetes-1.20/hostpath/csi-hostpath-driverinfo.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ apiVersion: storage.k8s.io/v1
22
kind: CSIDriver
33
metadata:
44
name: hostpath.csi.k8s.io
5+
labels:
6+
app.kubernetes.io/instance: hostpath.csi.k8s.io
7+
app.kubernetes.io/part-of: csi-driver-host-path
8+
app.kubernetes.io/name: hostpath.csi.k8s.io
9+
app.kubernetes.io/component: csi-driver
510
spec:
611
# Supports persistent and ephemeral inline volumes.
712
volumeLifecycleModes:

deploy/kubernetes-1.20/hostpath/csi-hostpath-plugin.yaml

+17-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ apiVersion: v1
77
metadata:
88
name: csi-hostpathplugin
99
labels:
10-
app: csi-hostpathplugin
10+
app.kubernetes.io/instance: hostpath.csi.k8s.io
11+
app.kubernetes.io/part-of: csi-driver-host-path
12+
app.kubernetes.io/name: csi-hostpathplugin
13+
app.kubernetes.io/component: plugin
1114
spec:
1215
selector:
1316
app: csi-hostpathplugin
@@ -19,6 +22,11 @@ kind: StatefulSet
1922
apiVersion: apps/v1
2023
metadata:
2124
name: csi-hostpathplugin
25+
labels:
26+
app.kubernetes.io/instance: hostpath.csi.k8s.io
27+
app.kubernetes.io/part-of: csi-driver-host-path
28+
app.kubernetes.io/name: csi-hostpathplugin
29+
app.kubernetes.io/component: plugin
2230
spec:
2331
serviceName: "csi-hostpathplugin"
2432
# One replica only:
@@ -28,11 +36,17 @@ spec:
2836
replicas: 1
2937
selector:
3038
matchLabels:
31-
app: csi-hostpathplugin
39+
app.kubernetes.io/instance: hostpath.csi.k8s.io
40+
app.kubernetes.io/part-of: csi-driver-host-path
41+
app.kubernetes.io/name: csi-hostpathplugin
42+
app.kubernetes.io/component: plugin
3243
template:
3344
metadata:
3445
labels:
35-
app: csi-hostpathplugin
46+
app.kubernetes.io/instance: hostpath.csi.k8s.io
47+
app.kubernetes.io/part-of: csi-driver-host-path
48+
app.kubernetes.io/name: csi-hostpathplugin
49+
app.kubernetes.io/component: plugin
3650
spec:
3751
serviceAccountName: csi-external-health-monitor-controller
3852
containers:

0 commit comments

Comments
 (0)