Skip to content

Commit 74adc0b

Browse files
authored
Merge pull request kubernetes#122489 from carlory/fix-120080
storage e2e: update hostpath and mock images
2 parents 791fd50 + 2bd7f4f commit 74adc0b

File tree

16 files changed

+152
-36
lines changed

16 files changed

+152
-36
lines changed

test/e2e/storage/utils/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ func LoadFromManifests(files ...string) ([]interface{}, error) {
6262
if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), data, &what); err != nil {
6363
return fmt.Errorf("decode TypeMeta: %w", err)
6464
}
65+
// Ignore empty documents.
66+
if what.Kind == "" {
67+
return nil
68+
}
6569

6670
factory := factories[what]
6771
if factory == nil {

test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-attacher/raw/v3.4.0/deploy/kubernetes//rbac.yaml
2-
# for csi-driver-host-path v1.8.0
1+
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-attacher/raw/v4.5.0/deploy/kubernetes//rbac.yaml
2+
# for csi-driver-host-path release-1.13
33
# by ./update-hostpath.sh
44
#
55
# This YAML file contains all RBAC objects that are necessary to run external

test/e2e/testing-manifests/storage-csi/external-health-monitor/external-health-monitor-controller/rbac.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-health-monitor/raw/v0.4.0/deploy/kubernetes/external-health-monitor-controller/rbac.yaml
2-
# for csi-driver-host-path v1.8.0
1+
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-health-monitor/raw/v0.11.0/deploy/kubernetes/external-health-monitor-controller/rbac.yaml
2+
# for csi-driver-host-path release-1.13
33
# by ./update-hostpath.sh
44
#
55
# This YAML file contains all RBAC objects that are necessary to run external

test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-provisioner/raw/v3.1.0/deploy/kubernetes//rbac.yaml
2-
# for csi-driver-host-path v1.8.0
1+
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-provisioner/raw/v4.0.0/deploy/kubernetes//rbac.yaml
2+
# for csi-driver-host-path release-1.13
33
# by ./update-hostpath.sh
44
#
55
# This YAML file contains all RBAC objects that are necessary to run external
@@ -61,6 +61,13 @@ rules:
6161
- apiGroups: ["storage.k8s.io"]
6262
resources: ["volumeattachments"]
6363
verbs: ["get", "list", "watch"]
64+
# (Alpha) Access to referencegrants is only needed when the CSI driver
65+
# has the CrossNamespaceVolumeDataSource controller capability.
66+
# In that case, external-provisioner requires "get", "list", "watch"
67+
# permissions for "referencegrants" on "gateway.networking.k8s.io".
68+
#- apiGroups: ["gateway.networking.k8s.io"]
69+
# resources: ["referencegrants"]
70+
# verbs: ["get", "list", "watch"]
6471

6572
---
6673
kind: ClusterRoleBinding
@@ -89,9 +96,6 @@ metadata:
8996
rules:
9097
# Only one of the following rules for endpoints or leases is required based on
9198
# what is set for `--leader-election-type`. Endpoints are deprecated in favor of Leases.
92-
- apiGroups: [""]
93-
resources: ["endpoints"]
94-
verbs: ["get", "watch", "list", "delete", "update", "create"]
9599
- apiGroups: ["coordination.k8s.io"]
96100
resources: ["leases"]
97101
verbs: ["get", "watch", "list", "delete", "update", "create"]

test/e2e/testing-manifests/storage-csi/external-resizer/rbac.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-resizer/raw/v1.4.0/deploy/kubernetes//rbac.yaml
2-
# for csi-driver-host-path v1.8.0
1+
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-resizer/raw/v1.10.0/deploy/kubernetes//rbac.yaml
2+
# for csi-driver-host-path release-1.13
33
# by ./update-hostpath.sh
44
#
55
# This YAML file contains all RBAC objects that are necessary to run external
@@ -46,6 +46,10 @@ rules:
4646
- apiGroups: [""]
4747
resources: ["events"]
4848
verbs: ["list", "watch", "create", "update", "patch"]
49+
# only required if enabling the alpha volume modify feature
50+
- apiGroups: ["storage.k8s.io"]
51+
resources: ["volumeattributesclasses"]
52+
verbs: ["get", "list", "watch"]
4953

5054
---
5155
kind: ClusterRoleBinding
@@ -63,7 +67,7 @@ roleRef:
6367
apiGroup: rbac.authorization.k8s.io
6468

6569
---
66-
# Resizer must be able to work with end point in current namespace
70+
# Resizer must be able to work with `leases` in current namespace
6771
# if (and only if) leadership election is enabled
6872
kind: Role
6973
apiVersion: rbac.authorization.k8s.io/v1

test/e2e/testing-manifests/storage-csi/external-snapshotter/csi-snapshotter/rbac-csi-snapshotter.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-snapshotter/raw/v5.0.1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
2-
# for csi-driver-host-path v1.8.0
1+
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-snapshotter/raw/v7.0.1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
2+
# for csi-driver-host-path release-1.13
33
# by ./update-hostpath.sh
44
#
55
# Together with the RBAC file for external-provisioner, this YAML file
@@ -12,6 +12,7 @@
1212
# - optionally rename the non-namespaced ClusterRole if there
1313
# are conflicts with other deployments
1414

15+
---
1516
apiVersion: v1
1617
kind: ServiceAccount
1718
metadata:
@@ -37,13 +38,24 @@ rules:
3738
- apiGroups: ["snapshot.storage.k8s.io"]
3839
resources: ["volumesnapshotclasses"]
3940
verbs: ["get", "list", "watch"]
41+
- apiGroups: ["snapshot.storage.k8s.io"]
42+
resources: ["volumesnapshots"]
43+
verbs: ["get", "list", "watch", "update", "patch", "create"]
4044
- apiGroups: ["snapshot.storage.k8s.io"]
4145
resources: ["volumesnapshotcontents"]
42-
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
46+
verbs: ["get", "list", "watch", "update", "patch", "create"]
4347
- apiGroups: ["snapshot.storage.k8s.io"]
4448
resources: ["volumesnapshotcontents/status"]
4549
verbs: ["update", "patch"]
46-
50+
- apiGroups: ["groupsnapshot.storage.k8s.io"]
51+
resources: ["volumegroupsnapshotclasses"]
52+
verbs: ["get", "list", "watch"]
53+
- apiGroups: ["groupsnapshot.storage.k8s.io"]
54+
resources: ["volumegroupsnapshotcontents"]
55+
verbs: ["get", "list", "watch", "update", "patch"]
56+
- apiGroups: ["groupsnapshot.storage.k8s.io"]
57+
resources: ["volumegroupsnapshotcontents/status"]
58+
verbs: ["update", "patch"]
4759
---
4860
kind: ClusterRoleBinding
4961
apiVersion: rbac.authorization.k8s.io/v1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
The files in this directory are exact copies of "kubernetes-latest" in
2-
https://github.com/kubernetes-csi/csi-driver-host-path/tree/v1.8.0/deploy/
2+
https://github.com/kubernetes-csi/csi-driver-host-path/tree/release-1.13/deploy/
33

44
Do not edit manually. Run ./update-hostpath.sh to refresh the content.

test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-driverinfo.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ spec:
1515
# To determine at runtime which mode a volume uses, pod info and its
1616
# "csi.storage.k8s.io/ephemeral" entry are needed.
1717
podInfoOnMount: true
18+
# Kubernetes may use fsGroup to change permissions and ownership
19+
# of the volume to match user requested fsGroup in the pod's SecurityPolicy
20+
fsGroupPolicy: File

test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-plugin.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# All of the individual sidecar RBAC roles get bound
1+
# All of the individual sidecar RBAC roles get bound
22
# to this account.
33
kind: ServiceAccount
44
apiVersion: v1
@@ -190,6 +190,7 @@ kind: StatefulSet
190190
apiVersion: apps/v1
191191
metadata:
192192
name: csi-hostpathplugin
193+
namespace: default
193194
labels:
194195
app.kubernetes.io/instance: hostpath.csi.k8s.io
195196
app.kubernetes.io/part-of: csi-driver-host-path
@@ -218,7 +219,7 @@ spec:
218219
serviceAccountName: csi-hostpathplugin-sa
219220
containers:
220221
- name: hostpath
221-
image: registry.k8s.io/sig-storage/hostpathplugin:v1.11.0
222+
image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
222223
args:
223224
- "--drivername=hostpath.csi.k8s.io"
224225
- "--v=5"
@@ -261,7 +262,7 @@ spec:
261262
name: dev-dir
262263

263264
- name: csi-external-health-monitor-controller
264-
image: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.7.0
265+
image: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.11.0
265266
args:
266267
- "--v=5"
267268
- "--csi-address=$(ADDRESS)"
@@ -275,7 +276,7 @@ spec:
275276
mountPath: /csi
276277

277278
- name: node-driver-registrar
278-
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1
279+
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0
279280
args:
280281
- --v=5
281282
- --csi-address=/csi/csi.sock
@@ -303,13 +304,13 @@ spec:
303304
volumeMounts:
304305
- mountPath: /csi
305306
name: socket-dir
306-
image: registry.k8s.io/sig-storage/livenessprobe:v2.7.0
307+
image: registry.k8s.io/sig-storage/livenessprobe:v2.12.0
307308
args:
308309
- --csi-address=/csi/csi.sock
309310
- --health-port=9898
310311

311312
- name: csi-attacher
312-
image: registry.k8s.io/sig-storage/csi-attacher:v4.0.0
313+
image: registry.k8s.io/sig-storage/csi-attacher:v4.5.0
313314
args:
314315
- --v=5
315316
- --csi-address=/csi/csi.sock
@@ -323,11 +324,12 @@ spec:
323324
name: socket-dir
324325

325326
- name: csi-provisioner
326-
image: registry.k8s.io/sig-storage/csi-provisioner:v3.4.0
327+
image: registry.k8s.io/sig-storage/csi-provisioner:v4.0.0
327328
args:
328329
- -v=5
329330
- --csi-address=/csi/csi.sock
330331
- --feature-gates=Topology=true
332+
# end csi-provisioner args
331333
securityContext:
332334
# This is necessary only for systems with SELinux, where
333335
# non-privileged sidecar containers cannot access unix domain socket
@@ -338,7 +340,7 @@ spec:
338340
name: socket-dir
339341

340342
- name: csi-resizer
341-
image: registry.k8s.io/sig-storage/csi-resizer:v1.6.0
343+
image: registry.k8s.io/sig-storage/csi-resizer:v1.10.0
342344
args:
343345
- -v=5
344346
- -csi-address=/csi/csi.sock
@@ -352,7 +354,7 @@ spec:
352354
name: socket-dir
353355

354356
- name: csi-snapshotter
355-
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.1.0
357+
image: registry.k8s.io/sig-storage/csi-snapshotter:v7.0.1
356358
args:
357359
- -v=5
358360
- --csi-address=/csi/csi.sock
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# WARNING: this is only for testing purposes. Do not install in a production
2+
# cluster.
3+
#
4+
# This exposes the hostpath's Unix domain csi.sock as a TCP port to the
5+
# outside world. The mapping from Unix domain socket to TCP is done
6+
# by socat.
7+
#
8+
# This is useful for testing with csi-sanity or csc.
9+
10+
apiVersion: v1
11+
kind: Service
12+
metadata:
13+
name: hostpath-service
14+
namespace: default
15+
labels:
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-hostpath-socat
19+
app.kubernetes.io/component: socat
20+
spec:
21+
type: NodePort
22+
selector:
23+
app.kubernetes.io/instance: hostpath.csi.k8s.io
24+
app.kubernetes.io/part-of: csi-driver-host-path
25+
app.kubernetes.io/name: csi-hostpath-socat
26+
app.kubernetes.io/component: socat
27+
ports:
28+
- port: 10000 # fixed port inside the pod, dynamically allocated port outside
29+
---
30+
kind: StatefulSet
31+
apiVersion: apps/v1
32+
metadata:
33+
name: csi-hostpath-socat
34+
namespace: default
35+
labels:
36+
app.kubernetes.io/instance: hostpath.csi.k8s.io
37+
app.kubernetes.io/part-of: csi-driver-host-path
38+
app.kubernetes.io/name: csi-hostpath-socat
39+
app.kubernetes.io/component: socat
40+
spec:
41+
serviceName: "csi-hostpath-socat"
42+
replicas: 1
43+
selector:
44+
matchLabels:
45+
app.kubernetes.io/instance: hostpath.csi.k8s.io
46+
app.kubernetes.io/part-of: csi-driver-host-path
47+
app.kubernetes.io/name: csi-hostpath-socat
48+
app.kubernetes.io/component: socat
49+
template:
50+
metadata:
51+
labels:
52+
app.kubernetes.io/instance: hostpath.csi.k8s.io
53+
app.kubernetes.io/part-of: csi-driver-host-path
54+
app.kubernetes.io/name: csi-hostpath-socat
55+
app.kubernetes.io/component: socat
56+
spec:
57+
affinity:
58+
podAffinity:
59+
requiredDuringSchedulingIgnoredDuringExecution:
60+
- labelSelector:
61+
matchExpressions:
62+
- key: app.kubernetes.io/instance
63+
operator: In
64+
values:
65+
- hostpath.csi.k8s.io
66+
topologyKey: kubernetes.io/hostname
67+
containers:
68+
- name: socat
69+
image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
70+
command:
71+
- socat
72+
args:
73+
- tcp-listen:10000,fork,reuseaddr
74+
- unix-connect:/csi/csi.sock
75+
securityContext:
76+
# This is necessary only for systems with SELinux, where
77+
# non-privileged sidecar containers cannot access unix domain socket
78+
# created by privileged CSI driver container.
79+
privileged: true
80+
volumeMounts:
81+
- mountPath: /csi
82+
name: socket-dir
83+
volumes:
84+
- hostPath:
85+
path: /var/lib/kubelet/plugins/csi-hostpath
86+
type: DirectoryOrCreate
87+
name: socket-dir

0 commit comments

Comments
 (0)