Skip to content
Snippets Groups Projects
Commit 9c53a343 authored by Andrew Melnick's avatar Andrew Melnick Committed by Derek Su
Browse files

Add E2E test for multiple storage classes

parent 90f92695
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,12 @@ func (p *PodTestSuite) TestPodWithSubpath() {
runTest(p, []string{p.config.IMAGE}, "ready", hostPathVolumeType)
}
func (p *PodTestSuite) TestPodWithMultipleStorageClasses() {
p.kustomizeDir = "multiple-storage-classes"
runTest(p, []string{p.config.IMAGE}, "ready", hostPathVolumeType)
}
func runTest(p *PodTestSuite, images []string, waitCondition, volumeType string) {
kustomizeDir := testdataFile(p.kustomizeDir)
......
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../deploy
- storage-class-shared.yaml
- pod.yaml
- pvc.yaml
patchesStrategicMerge:
- local-path-config.yaml
commonLabels:
app: local-path-provisioner
images:
- name: rancher/local-path-provisioner
newTag: dev
kind: ConfigMap
apiVersion: v1
metadata:
name: local-path-config
namespace: local-path-storage
data:
config.json: |-
{
"storageClassConfigs":{
"local-path": {
"nodePathMap": [
{
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
"paths":["/opt/local-path-provisioner"]
}
]
},
"local-path-shared": {
"sharedFilesystemPath": "/opt/local-path-provisioner-shared"
}
}
}
apiVersion: v1
kind: Pod
metadata:
name: volume-test
spec:
containers:
- name: volume-test
image: nginx:stable-alpine
imagePullPolicy: IfNotPresent
volumeMounts:
- name: volv
mountPath: /data
- name: volv-shared
mountPath: /shared-data
ports:
- containerPort: 80
volumes:
- name: volv
persistentVolumeClaim:
claimName: local-path-pvc
- name: volv-shared
persistentVolumeClaim:
claimName: local-path-shared-pvc
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-path-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 128Mi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-path-shared-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: local-path-shared
resources:
requests:
storage: 128Mi
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-path-shared
provisioner: rancher.io/local-path
volumeBindingMode: Immediate
reclaimPolicy: Delete
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment