Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graduate Volume Expansion to Beta + e2e tests #81467

Merged
merged 2 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/features/kube_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const (

// owner: @gnufied
// alpha: v1.14
// beta: v1.16
bertinatto marked this conversation as resolved.
Show resolved Hide resolved
// Ability to expand CSI volumes
ExpandCSIVolumes featuregate.Feature = "ExpandCSIVolumes"

Expand Down Expand Up @@ -495,7 +496,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
QOSReserved: {Default: false, PreRelease: featuregate.Alpha},
ExpandPersistentVolumes: {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},
CPUManager: {Default: true, PreRelease: featuregate.Beta},
CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/storage/csi_mock_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
name string
nodeExpansionRequired bool
Expand Down Expand Up @@ -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 {
name string
disableAttach bool
Expand Down
1 change: 1 addition & 0 deletions test/e2e/storage/csi_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var csiTestSuites = []func() testsuites.TestSuite{
testsuites.InitSnapshottableTestSuite,
testsuites.InitMultiVolumeTestSuite,
testsuites.InitDisruptiveTestSuite,
testsuites.InitVolumeExpandTestSuite,
}

// This executes testSuites for csi volumes.
Expand Down
16 changes: 12 additions & 4 deletions test/e2e/storage/drivers/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
"strconv"

"github.com/onsi/ginkgo"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
storagev1beta1 "k8s.io/api/storage/v1beta1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down Expand Up @@ -87,17 +87,25 @@ var _ testsuites.SnapshottableTestDriver = &hostpathCSIDriver{}

// InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface
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",
map[testsuites.Capability]bool{testsuites.CapPersistence: true, testsuites.CapSnapshotDataSource: true,
testsuites.CapMultiPODs: true, testsuites.CapBlock: true,
testsuites.CapPVCDataSource: true},
capabilities,
"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-provisioner/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-provisioner.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/e2e-test-rbac.yaml",
)
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/storage/testpatterns/testpattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,13 @@ var (
DefaultFsDynamicPVAllowExpansion = TestPattern{
Name: "Dynamic PV (default fs)(allowExpansion)",
VolType: DynamicPV,
BindingMode: storagev1.VolumeBindingWaitForFirstConsumer,
AllowExpansion: true,
}
// BlockVolModeDynamicPVAllowExpansion is TestPattern for "Dynamic PV (block volmode)(allowExpansion)"
BlockVolModeDynamicPVAllowExpansion = TestPattern{
Name: "Dynamic PV (block volmode)(allowExpansion)",
VolType: DynamicPV,
VolMode: v1.PersistentVolumeBlock,
BindingMode: storagev1.VolumeBindingWaitForFirstConsumer,
AllowExpansion: true,
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
- mountPath: /registration
name: registration-dir
- name: hostpath
image: quay.io/k8scsi/hostpathplugin:v1.2.0-rc4
image: quay.io/k8scsi/hostpathplugin:v1.2.0-rc5
args:
- "--v=5"
- "--endpoint=$(CSI_ENDPOINT)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ subjects:
- kind: ServiceAccount
name: csi-snapshotter
namespace: default
- kind: ServiceAccount
name: csi-resizer
namespace: default
roleRef:
kind: ClusterRole
name: e2e-test-privileged-psp
Expand Down