Skip to content

Commit aa0ee01

Browse files
authored
Merge pull request #100 from andyzhangx/limit
Set bigger limit
2 parents 0086632 + dda97dd commit aa0ee01

File tree

6 files changed

+16
-102
lines changed

6 files changed

+16
-102
lines changed

charts/latest/blobfuse-csi-driver/templates/csi-blobfuse-controller.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ spec:
134134
name: msi
135135
resources:
136136
limits:
137-
cpu: 200m
138-
memory: 200Mi
137+
cpu: 2
138+
memory: 2Gi
139139
requests:
140140
cpu: 10m
141141
memory: 20Mi

charts/latest/blobfuse-csi-driver/templates/csi-blobfuse-node.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ spec:
108108
name: blobfuse-cache
109109
resources:
110110
limits:
111-
cpu: 200m
112-
memory: 200Mi
111+
cpu: 4
112+
memory: 6Gi
113113
requests:
114114
cpu: 10m
115115
memory: 20Mi
@@ -135,4 +135,4 @@ spec:
135135
name: msi
136136
- hostPath:
137137
path: /mnt
138-
name: blobfuse-cache
138+
name: blobfuse-cache

deploy/csi-blobfuse-controller.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ spec:
132132
name: msi
133133
resources:
134134
limits:
135-
cpu: 200m
136-
memory: 200Mi
135+
cpu: 2
136+
memory: 2Gi
137137
requests:
138138
cpu: 10m
139139
memory: 20Mi

deploy/csi-blobfuse-node.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ spec:
107107
name: blobfuse-cache
108108
resources:
109109
limits:
110-
cpu: 4000m
111-
memory: 4000Mi
110+
cpu: 4
111+
memory: 6Gi
112112
requests:
113113
cpu: 10m
114114
memory: 20Mi

pkg/blobfuse/nodeserver.go

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,15 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
5555
return nil, status.Error(codes.InvalidArgument, "Target path not provided")
5656
}
5757

58-
mountOptions := getNodePublishMountOptions(req)
58+
mountOptions := []string{"bind"}
59+
if req.GetReadonly() {
60+
mountOptions = append(mountOptions, "ro")
61+
}
5962

6063
if err := d.ensureMountPoint(target); err != nil {
6164
return nil, status.Errorf(codes.Internal, "Could not mount target %q: %v", target, err)
6265
}
6366

64-
readOnly := req.GetReadonly()
65-
volumeID := req.GetVolumeId()
66-
attrib := req.GetVolumeContext()
67-
mountFlags := req.GetVolumeCapability().GetMount().GetMountFlags()
68-
69-
klog.V(2).Infof("target %v\n\nreadonly %v\nvolumeId %v\nContext %v\nmountflags %v\n",
70-
target, readOnly, volumeID, attrib, mountFlags)
71-
72-
klog.V(2).Infof("NodePublishVolume: creating dir %s", target)
73-
if err := d.mounter.MakeDir(target); err != nil {
74-
return nil, status.Errorf(codes.Internal, "Could not create dir %q: %v", target, err)
75-
}
76-
7767
klog.V(2).Infof("NodePublishVolume: mounting %s at %s with mountOptions: %v", source, target, mountOptions)
7868
if err := d.mounter.Mount(source, target, "", mountOptions); err != nil {
7969
if removeErr := os.Remove(target); removeErr != nil {
@@ -259,19 +249,7 @@ func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolume
259249
return nil, status.Error(codes.Unimplemented, fmt.Sprintf("NodeExpandVolume is not yet implemented"))
260250
}
261251

262-
func getNodePublishMountOptions(req *csi.NodePublishVolumeRequest) []string {
263-
mountFlags := req.GetVolumeCapability().GetMount().GetMountFlags()
264-
mountOptions := []string{"bind"}
265-
if req.GetReadonly() {
266-
mountOptions = append(mountOptions, "ro")
267-
}
268-
mountOptions = util.JoinMountOptions(mountFlags, mountOptions)
269-
270-
return mountOptions
271-
}
272-
273-
// ensureMountPoint: ensure mount point to be valid.
274-
// If it is not existed, it will be created.
252+
// ensureMountPoint: create mount point if not exists
275253
func (d *Driver) ensureMountPoint(target string) error {
276254
notMnt, err := d.mounter.IsLikelyNotMountPoint(target)
277255
if err != nil && !os.IsNotExist(err) {
@@ -294,8 +272,8 @@ func (d *Driver) ensureMountPoint(target string) error {
294272
// notMnt = true
295273
}
296274

297-
if err := os.MkdirAll(target, 0750); err != nil {
298-
klog.Errorf("mkdir failed on target: %s (%v)", target, err)
275+
if err := d.mounter.MakeDir(target); err != nil {
276+
klog.Errorf("MakeDir failed on target: %s (%v)", target, err)
299277
return err
300278
}
301279

pkg/blobfuse/nodeserver_test.go

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)