mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #106791 from pohly/replace-mock-driver
storage e2e: replace mock driver, update images
This commit is contained in:
commit
7f24f8c1a2
@ -618,10 +618,10 @@ func (m *mockCSIDriver) PrepareTest(f *framework.Framework) (*storageframework.P
|
||||
} else {
|
||||
// When using the mock driver inside the cluster it has to be reconfigured
|
||||
// via command line parameters.
|
||||
containerArgs = append(containerArgs, "--name=csi-mock-"+f.UniqueName)
|
||||
containerArgs = append(containerArgs, "--drivername=csi-mock-"+f.UniqueName)
|
||||
|
||||
if !m.attachable {
|
||||
containerArgs = append(containerArgs, "--disable-attach")
|
||||
if m.attachable {
|
||||
containerArgs = append(containerArgs, "--enable-attach")
|
||||
}
|
||||
|
||||
if m.enableTopology {
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-attacher/raw/v3.2.1/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.7.2
|
||||
# by test/e2e/testing-manifests/storage-csi/update-hostpath.sh
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-attacher/raw/v3.3.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.7.3
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
# CSI attacher.
|
||||
|
@ -1,60 +0,0 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-health-monitor/raw/v0.2.0/deploy/kubernetes/external-health-monitor-agent/rbac.yaml
|
||||
# for csi-driver-host-path v1.7.2
|
||||
# by test/e2e/testing-manifests/storage-csi/update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
# CSI health monitor agent.
|
||||
#
|
||||
# In production, each CSI driver deployment has to be customized:
|
||||
# - to avoid conflicts, use non-default namespace and different names
|
||||
# for non-namespaced entities like the ClusterRole
|
||||
# - decide whether the deployment replicates the external CSI
|
||||
# health monitor agent, in which case leadership election must be enabled;
|
||||
# this influences the RBAC setup, see below
|
||||
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: csi-external-health-monitor-agent
|
||||
# replace with non-default namespace name
|
||||
namespace: default
|
||||
|
||||
---
|
||||
# Health monitor agent must be able to work with PVs, PVCs, Nodes and Pods
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: external-health-monitor-agent-runner
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumeclaims"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["get", "list", "watch", "create", "patch"]
|
||||
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: csi-external-health-monitor-agent-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: csi-external-health-monitor-agent
|
||||
# replace with non-default namespace name
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: external-health-monitor-agent-runner
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-health-monitor/raw/v0.3.0/deploy/kubernetes/external-health-monitor-controller/rbac.yaml
|
||||
# for csi-driver-host-path v1.7.2
|
||||
# by test/e2e/testing-manifests/storage-csi/update-hostpath.sh
|
||||
# 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
|
||||
# for csi-driver-host-path v1.7.3
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
# CSI health monitor controller.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-provisioner/raw/v2.2.1/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.7.2
|
||||
# by test/e2e/testing-manifests/storage-csi/update-hostpath.sh
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-provisioner/raw/v3.0.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.7.3
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
# CSI provisioner.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-resizer/raw/v1.2.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.7.2
|
||||
# by test/e2e/testing-manifests/storage-csi/update-hostpath.sh
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-resizer/raw/v1.3.0/deploy/kubernetes//rbac.yaml
|
||||
# for csi-driver-host-path v1.7.3
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# This YAML file contains all RBAC objects that are necessary to run external
|
||||
# CSI resizer.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-snapshotter/raw/v4.1.1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
|
||||
# for csi-driver-host-path v1.7.2
|
||||
# by test/e2e/testing-manifests/storage-csi/update-hostpath.sh
|
||||
# Do not edit, downloaded from https://github.com/kubernetes-csi/external-snapshotter/raw/v5.0.0-rc1/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
|
||||
# for csi-driver-host-path master
|
||||
# by ./update-hostpath.sh
|
||||
#
|
||||
# Together with the RBAC file for external-provisioner, this YAML file
|
||||
# contains all RBAC objects that are necessary to run external CSI
|
||||
@ -39,10 +39,10 @@ rules:
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents"]
|
||||
verbs: ["create", "get", "list", "watch", "update", "delete"]
|
||||
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
|
||||
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||
resources: ["volumesnapshotcontents/status"]
|
||||
verbs: ["update"]
|
||||
verbs: ["update", "patch"]
|
||||
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
|
@ -1,4 +1,4 @@
|
||||
The files in this directory are exact copys of "kubernetes-latest" in
|
||||
https://github.com/kubernetes-csi/csi-driver-host-path/tree/v1.7.2/deploy/
|
||||
https://github.com/kubernetes-csi/csi-driver-host-path/tree/v1.7.3/deploy/
|
||||
|
||||
Do not edit manually. Run test/e2e/testing-manifests/storage-csi/update-hostpath.sh to refresh the content.
|
||||
Do not edit manually. Run ./update-hostpath.sh to refresh the content.
|
||||
|
@ -218,7 +218,7 @@ spec:
|
||||
serviceAccountName: csi-hostpathplugin-sa
|
||||
containers:
|
||||
- name: hostpath
|
||||
image: k8s.gcr.io/sig-storage/hostpathplugin:v1.7.1
|
||||
image: k8s.gcr.io/sig-storage/hostpathplugin:v1.7.3
|
||||
args:
|
||||
- "--drivername=hostpath.csi.k8s.io"
|
||||
- "--v=5"
|
||||
@ -260,24 +260,8 @@ spec:
|
||||
- mountPath: /dev
|
||||
name: dev-dir
|
||||
|
||||
- name: csi-external-health-monitor-agent
|
||||
image: k8s.gcr.io/sig-storage/csi-external-health-monitor-agent:v0.2.0
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
env:
|
||||
- name: NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /csi
|
||||
- name: csi-external-health-monitor-controller
|
||||
image: k8s.gcr.io/sig-storage/csi-external-health-monitor-controller:v0.3.0
|
||||
image: k8s.gcr.io/sig-storage/csi-external-health-monitor-controller:v0.4.0
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
@ -291,7 +275,7 @@ spec:
|
||||
mountPath: /csi
|
||||
|
||||
- name: node-driver-registrar
|
||||
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.2.0
|
||||
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -325,7 +309,7 @@ spec:
|
||||
- --health-port=9898
|
||||
|
||||
- name: csi-attacher
|
||||
image: k8s.gcr.io/sig-storage/csi-attacher:v3.2.1
|
||||
image: k8s.gcr.io/sig-storage/csi-attacher:v3.3.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -339,7 +323,7 @@ spec:
|
||||
name: socket-dir
|
||||
|
||||
- name: csi-provisioner
|
||||
image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.1
|
||||
image: k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0
|
||||
args:
|
||||
- -v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -354,7 +338,7 @@ spec:
|
||||
name: socket-dir
|
||||
|
||||
- name: csi-resizer
|
||||
image: k8s.gcr.io/sig-storage/csi-resizer:v1.2.0
|
||||
image: k8s.gcr.io/sig-storage/csi-resizer:v1.3.0
|
||||
args:
|
||||
- -v=5
|
||||
- -csi-address=/csi/csi.sock
|
||||
@ -368,7 +352,7 @@ spec:
|
||||
name: socket-dir
|
||||
|
||||
- name: csi-snapshotter
|
||||
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.1.1
|
||||
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1
|
||||
args:
|
||||
- -v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-attacher
|
||||
image: k8s.gcr.io/sig-storage/csi-attacher:v3.2.0
|
||||
image: k8s.gcr.io/sig-storage/csi-attacher:v3.3.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=$(ADDRESS)
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-resizer
|
||||
image: k8s.gcr.io/sig-storage/csi-resizer:v1.1.0
|
||||
image: k8s.gcr.io/sig-storage/csi-resizer:v1.3.0
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-snapshotter
|
||||
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.0
|
||||
image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.2.1
|
||||
args:
|
||||
- "--v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-provisioner
|
||||
image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.0
|
||||
image: k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
# Topology support is needed for the pod rescheduling test
|
||||
@ -34,7 +34,7 @@ spec:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- name: driver-registrar
|
||||
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0
|
||||
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -53,10 +53,13 @@ spec:
|
||||
- mountPath: /registration
|
||||
name: registration-dir
|
||||
- name: mock
|
||||
image: k8s.gcr.io/sig-storage/mock-driver:v4.1.0
|
||||
image: k8s.gcr.io/sig-storage/hostpathplugin:v1.7.3
|
||||
args:
|
||||
- "--name=mock.storage.k8s.io"
|
||||
- "-v=3" # enabled the gRPC call logging
|
||||
- "--drivername=mock.storage.k8s.io"
|
||||
- "--nodeid=$(KUBE_NODE_NAME)"
|
||||
- "--endpoint=/csi/csi.sock"
|
||||
- "--statedir=/tmp/csi-hotpath-data"
|
||||
- "-v=5" # enabled the gRPC call logging
|
||||
env:
|
||||
- name: CSI_ENDPOINT
|
||||
value: /csi/csi.sock
|
||||
@ -74,6 +77,8 @@ spec:
|
||||
name: kubelet-pods-dir
|
||||
- mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi
|
||||
name: kubelet-csi-dir
|
||||
- mountPath: /dev
|
||||
name: dev-dir
|
||||
volumes:
|
||||
- hostPath:
|
||||
path: /var/lib/kubelet/plugins/csi-mock
|
||||
@ -93,3 +98,7 @@ spec:
|
||||
path: /var/lib/kubelet/plugins_registry
|
||||
type: Directory
|
||||
name: registration-dir
|
||||
- hostPath:
|
||||
path: /dev
|
||||
type: Directory
|
||||
name: dev-dir
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: csi-mock
|
||||
containers:
|
||||
- name: csi-provisioner
|
||||
image: k8s.gcr.io/sig-storage/csi-provisioner:v2.2.0
|
||||
image: k8s.gcr.io/sig-storage/csi-provisioner:v3.0.0
|
||||
args:
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
# Topology support is needed for the pod rescheduling test
|
||||
@ -35,7 +35,7 @@ spec:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
- name: driver-registrar
|
||||
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0
|
||||
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/csi/csi.sock
|
||||
@ -53,16 +53,20 @@ spec:
|
||||
- mountPath: /registration
|
||||
name: registration-dir
|
||||
- name: mock
|
||||
image: k8s.gcr.io/sig-storage/mock-driver:v4.1.0
|
||||
image: k8s.gcr.io/sig-storage/hostpathplugin:v1.7.3
|
||||
args:
|
||||
# -v3 shows when connections get established. Higher log levels print information about
|
||||
# transferred bytes, but cannot print message content (no gRPC parsing), so this is usually
|
||||
# not interesting.
|
||||
- -v=3
|
||||
- -v=5
|
||||
- -nodeid=$(KUBE_NODE_NAME)
|
||||
- -endpoint=/csi/csi.sock
|
||||
- -proxy-endpoint=tcp://:9000
|
||||
env:
|
||||
- name: CSI_ENDPOINT
|
||||
value: /csi/csi.sock
|
||||
- name: KUBE_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
ports:
|
||||
- containerPort: 9000
|
||||
name: socat
|
||||
|
@ -132,3 +132,10 @@ for image in $images; do
|
||||
esac
|
||||
download "$project" "$path" "$tag" "$rbac"
|
||||
done
|
||||
|
||||
# Update the mock driver manifests, too.
|
||||
grep -r image: hostpath/hostpath/csi-hostpath-plugin.yaml | while read -r image; do
|
||||
version=$(echo "$image" | sed -e 's/.*:\(.*\)/\1/')
|
||||
image=$(echo "$image" | sed -e 's/.*image: \([^:]*\).*/\1/')
|
||||
sed -i -e "s;$image:.*;$image:$version;" mock/*.yaml
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user