Merge pull request #81467 from bertinatto/e2e_volume_expand

Graduate Volume Expansion to Beta + e2e tests
This commit is contained in:
Kubernetes Prow Robot 2019-08-28 01:37:25 -07:00 committed by GitHub
commit dccd28269a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 69 additions and 10 deletions

View File

@ -109,6 +109,7 @@ const (
// owner: @gnufied // owner: @gnufied
// alpha: v1.14 // alpha: v1.14
// beta: v1.16
// Ability to expand CSI volumes // Ability to expand CSI volumes
ExpandCSIVolumes featuregate.Feature = "ExpandCSIVolumes" ExpandCSIVolumes featuregate.Feature = "ExpandCSIVolumes"
@ -495,7 +496,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
QOSReserved: {Default: false, PreRelease: featuregate.Alpha}, QOSReserved: {Default: false, PreRelease: featuregate.Alpha},
ExpandPersistentVolumes: {Default: true, PreRelease: featuregate.Beta}, ExpandPersistentVolumes: {Default: true, PreRelease: featuregate.Beta},
ExpandInUsePersistentVolumes: {Default: true, PreRelease: featuregate.Beta}, ExpandInUsePersistentVolumes: {Default: true, PreRelease: featuregate.Beta},
ExpandCSIVolumes: {Default: false, PreRelease: featuregate.Alpha}, ExpandCSIVolumes: {Default: true, PreRelease: featuregate.Beta},
AttachVolumeLimit: {Default: true, PreRelease: featuregate.Beta}, AttachVolumeLimit: {Default: true, PreRelease: featuregate.Beta},
CPUManager: {Default: true, PreRelease: featuregate.Beta}, CPUManager: {Default: true, PreRelease: featuregate.Beta},
CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha}, CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha},

View File

@ -414,7 +414,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
}) })
}) })
ginkgo.Context("CSI Volume expansion [Feature:ExpandCSIVolumes]", func() { ginkgo.Context("CSI Volume expansion", func() {
tests := []struct { tests := []struct {
name string name string
nodeExpansionRequired bool nodeExpansionRequired bool
@ -525,7 +525,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
}) })
} }
}) })
ginkgo.Context("CSI online volume expansion [Feature:ExpandCSIVolumes][Feature:ExpandInUseVolumes]", func() { ginkgo.Context("CSI online volume expansion", func() {
tests := []struct { tests := []struct {
name string name string
disableAttach bool disableAttach bool

View File

@ -50,6 +50,7 @@ var csiTestSuites = []func() testsuites.TestSuite{
testsuites.InitSnapshottableTestSuite, testsuites.InitSnapshottableTestSuite,
testsuites.InitMultiVolumeTestSuite, testsuites.InitMultiVolumeTestSuite,
testsuites.InitDisruptiveTestSuite, testsuites.InitDisruptiveTestSuite,
testsuites.InitVolumeExpandTestSuite,
} }
// This executes testSuites for csi volumes. // This executes testSuites for csi volumes.

View File

@ -41,7 +41,7 @@ import (
"strconv" "strconv"
"github.com/onsi/ginkgo" "github.com/onsi/ginkgo"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1" storagev1 "k8s.io/api/storage/v1"
storagev1beta1 "k8s.io/api/storage/v1beta1" storagev1beta1 "k8s.io/api/storage/v1beta1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@ -87,17 +87,25 @@ var _ testsuites.SnapshottableTestDriver = &hostpathCSIDriver{}
// InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface // InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface
func InitHostPathCSIDriver() testsuites.TestDriver { func InitHostPathCSIDriver() testsuites.TestDriver {
capabilities := map[testsuites.Capability]bool{
testsuites.CapPersistence: true,
testsuites.CapSnapshotDataSource: true,
testsuites.CapMultiPODs: true,
testsuites.CapBlock: true,
testsuites.CapPVCDataSource: true,
testsuites.CapControllerExpansion: true,
}
return initHostPathCSIDriver("csi-hostpath", return initHostPathCSIDriver("csi-hostpath",
map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapSnapshotDataSource: true, capabilities,
testsuites.CapMultiPODs: true, testsuites.CapBlock: true,
testsuites.CapPVCDataSource: true},
"test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml", "test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml", "test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml", "test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/external-snapshotter/rbac.yaml", "test/e2e/testing-manifests/storage-csi/external-snapshotter/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/external-resizer/rbac.yaml",
"test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-attacher.yaml", "test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-attacher.yaml",
"test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-provisioner.yaml", "test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-provisioner.yaml",
"test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-snapshotter.yaml", "test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-snapshotter.yaml",
"test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-resizer.yaml",
"test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpathplugin.yaml", "test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpathplugin.yaml",
"test/e2e/testing-manifests/storage-csi/hostpath/hostpath/e2e-test-rbac.yaml", "test/e2e/testing-manifests/storage-csi/hostpath/hostpath/e2e-test-rbac.yaml",
) )

View File

@ -221,7 +221,6 @@ var (
DefaultFsDynamicPVAllowExpansion = TestPattern{ DefaultFsDynamicPVAllowExpansion = TestPattern{
Name: "Dynamic PV (default fs)(allowExpansion)", Name: "Dynamic PV (default fs)(allowExpansion)",
VolType: DynamicPV, VolType: DynamicPV,
BindingMode: storagev1.VolumeBindingWaitForFirstConsumer,
AllowExpansion: true, AllowExpansion: true,
} }
// BlockVolModeDynamicPVAllowExpansion is TestPattern for "Dynamic PV (block volmode)(allowExpansion)" // BlockVolModeDynamicPVAllowExpansion is TestPattern for "Dynamic PV (block volmode)(allowExpansion)"
@ -229,7 +228,6 @@ var (
Name: "Dynamic PV (block volmode)(allowExpansion)", Name: "Dynamic PV (block volmode)(allowExpansion)",
VolType: DynamicPV, VolType: DynamicPV,
VolMode: v1.PersistentVolumeBlock, VolMode: v1.PersistentVolumeBlock,
BindingMode: storagev1.VolumeBindingWaitForFirstConsumer,
AllowExpansion: true, AllowExpansion: true,
} }
) )

View File

@ -0,0 +1,48 @@
kind: Service
apiVersion: v1
metadata:
name: csi-hostpath-resizer
labels:
app: csi-hostpath-resizer
spec:
selector:
app: csi-hostpath-resizer
ports:
- name: dummy
port: 12345
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: csi-hostpath-resizer
spec:
serviceName: "csi-hostpath-resizer"
replicas: 1
selector:
matchLabels:
app: csi-hostpath-resizer
template:
metadata:
labels:
app: csi-hostpath-resizer
spec:
serviceAccountName: csi-resizer
containers:
- name: csi-resizer
image: quay.io/k8scsi/csi-resizer:v0.2.0
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /csi/csi.sock
imagePullPolicy: Always
volumeMounts:
- mountPath: /csi
name: socket-dir
volumes:
- hostPath:
path: /var/lib/kubelet/plugins/csi-hostpath
type: DirectoryOrCreate
name: socket-dir

View File

@ -33,7 +33,7 @@ spec:
- mountPath: /registration - mountPath: /registration
name: registration-dir name: registration-dir
- name: hostpath - name: hostpath
image: quay.io/k8scsi/hostpathplugin:v1.2.0-rc4 image: quay.io/k8scsi/hostpathplugin:v1.2.0-rc5
args: args:
- "--v=5" - "--v=5"
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"

View File

@ -16,6 +16,9 @@ subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: csi-snapshotter name: csi-snapshotter
namespace: default namespace: default
- kind: ServiceAccount
name: csi-resizer
namespace: default
roleRef: roleRef:
kind: ClusterRole kind: ClusterRole
name: e2e-test-privileged-psp name: e2e-test-privileged-psp