diff --git a/.travis.yml b/.travis.yml index 7880be474..b74ec331f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,7 @@ jobs: - make dep-check || travis_terminate 1; - name: cephcsi with kube 1.13.7 + env: K8S_FEATURE_GATES="BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true" script: - scripts/skip-doc-change.sh || travis_terminate 0; - make image-cephcsi || travis_terminate 1; diff --git a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml index ebb1de53f..7d968eb05 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml @@ -72,6 +72,7 @@ spec: args: - "--v=5" - "--csi-address=$(ADDRESS)" + - "--csiTimeout={{ .Values.provisioner.timeout }}" - "--leader-election" env: - name: ADDRESS diff --git a/deploy/cephfs/kubernetes/v1.13/csi-provisioner-rbac.yaml b/deploy/cephfs/kubernetes/v1.13/csi-provisioner-rbac.yaml index 5fcc16477..dc67c1b39 100644 --- a/deploy/cephfs/kubernetes/v1.13/csi-provisioner-rbac.yaml +++ b/deploy/cephfs/kubernetes/v1.13/csi-provisioner-rbac.yaml @@ -46,6 +46,7 @@ rules: - apiGroups: ["storage.k8s.io"] resources: ["volumeattachments"] verbs: ["get", "list", "watch", "update"] + --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/cephfs/kubernetes/v1.14+/csi-cephfsplugin-provisioner.yaml b/deploy/cephfs/kubernetes/v1.14+/csi-cephfsplugin-provisioner.yaml index 0dcf9d7c7..59735c3c2 100644 --- a/deploy/cephfs/kubernetes/v1.14+/csi-cephfsplugin-provisioner.yaml +++ b/deploy/cephfs/kubernetes/v1.14+/csi-cephfsplugin-provisioner.yaml @@ -40,7 +40,7 @@ spec: args: - "--csi-address=$(ADDRESS)" - "--v=5" - - "--timeout=60s" + - "--timeout=150s" - "--enable-leader-election=true" - "--leader-election-type=leases" - "--retry-interval-start=500ms" @@ -56,6 +56,7 @@ spec: args: - "--csi-address=$(ADDRESS)" - "--v=5" + - "--csiTimeout=150s" - "--leader-election" env: - name: ADDRESS diff --git a/pkg/cephfs/controllerserver.go b/pkg/cephfs/controllerserver.go index 1b7a794e5..3bd00607b 100644 --- a/pkg/cephfs/controllerserver.go +++ b/pkg/cephfs/controllerserver.go @@ -324,13 +324,15 @@ func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi return nil, status.Error(codes.InvalidArgument, err.Error()) } - if err = createVolume(ctx, volOptions, cr, volumeID(volIdentifier.FsSubvolName), req.GetCapacityRange().GetRequiredBytes()); err != nil { + RoundOffSize := util.RoundOffBytes(req.GetCapacityRange().GetRequiredBytes()) + + if err = createVolume(ctx, volOptions, cr, volumeID(volIdentifier.FsSubvolName), RoundOffSize); err != nil { klog.Errorf("failed to expand volume %s: %v", volumeID(volIdentifier.FsSubvolName), err) return nil, status.Error(codes.Internal, err.Error()) } return &csi.ControllerExpandVolumeResponse{ - CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), + CapacityBytes: RoundOffSize, NodeExpansionRequired: false, }, nil diff --git a/scripts/minikube.sh b/scripts/minikube.sh index 588cd18ef..0a7b1dce6 100755 --- a/scripts/minikube.sh +++ b/scripts/minikube.sh @@ -63,7 +63,7 @@ CEPHCSI_IMAGE_REPO=${CEPHCSI_IMAGE_REPO:-"quay.io/cephcsi"} K8S_IMAGE_REPO=${K8S_IMAGE_REPO:-"quay.io/k8scsi"} #feature-gates for kube -K8S_FEATURE_GATES=${K8S_FEATURE_GATES:-"BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true,ExpandCSIVolumes=true,ExpandInUsePersistentVolumes=true"} +K8S_FEATURE_GATES=${K8S_FEATURE_GATES:-"BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true,ExpandCSIVolumes=true"} case "${1:-}" in up)