Skip to content

Commit

Permalink
Merge pull request #1 from liuxuzxx/release-v1.1.0
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
liuxuzxx authored Apr 8, 2024
2 parents 558efcf + d23a29d commit 5ccd3c1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cmd/s3csi/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
tag="release-v0.0.0.22"
tag="v1.1.0"

go build

Expand Down
4 changes: 0 additions & 4 deletions deploy/s3-csi/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ spec:
- --nodeId=$(NODE_NAME)
- --v=5
env:
- name: AWS_ACCESS_KEY_ID
value: {{ .Values.minio.accessKey }}
- name: AWS_SECRET_ACCESS_KEY
value: {{ .Values.minio.accessSecret }}
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: NODE_NAME
Expand Down
8 changes: 4 additions & 4 deletions deploy/s3-csi/templates/storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
provisioner: minio.s3.csi.xw.com
parameters:
mounter: mount-s3
bucket: k8s-dev-sc
access-key: admin
secret-key: minioadmin
endpoint: 10.20.121.41:30629
bucket: {{ .Values.minio.bucket }}
access-key: {{ .Values.minio.accessKey }}
secret-key: {{ .Values.minio.accessSecret }}
endpoint: {{ .Values.minio.url }}
5 changes: 3 additions & 2 deletions deploy/s3-csi/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
global:
image: xwharbor.wxchina.com/cpaas-dev/component/csi-s3
tag: release-v0.0.0.22
tag: v1.1.0

minio:
url: http://10.20.121.41:30629
url: 10.20.121.41:30629
accessKey: admin
accessSecret: minioadmin
bucket: k8s-dev-sc
2 changes: 0 additions & 2 deletions deploy/test/nginx-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ spec:
labels:
app: nginx
spec:
nodeSelector:
kubernetes.io/hostname: h-10-20-121-130-dev-k8s-node
containers:
- image: xwharbor.wxchina.com/cpaas-pub/nginx:1.24.0
name: nginx
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis

mnt := s3.NewRclone(req)
err = mnt.Mount(volumeId, target)
klog.V(4).Info("Rclone mount command execute finish!")
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
Expand Down Expand Up @@ -103,7 +104,6 @@ func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV
return nil, status.Error(codes.Unimplemented, "")
}

// TODO 看到Pod里面其实没有创建/var/lib/kubelet/pods/d51de966-1a5f-4d35-843a-56b5e4cf6ed2/volumes/kubernetes.io~csi/pvc-967ee658-01ec-445c-ac7f-6fb058e22c7b/mount 后面这个路径,问题出现在这个地方
func checkMount(path string) (bool, error) {
err := mkDirAll(path)
if err != nil {
Expand Down
8 changes: 6 additions & 2 deletions pkg/s3/mountpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ func (m *MountpointS3) Unstage(path string) error {
}

func (m *MountpointS3) Mount(source string, target string) error {
os.Setenv(AwsAccessKeyId, m.accessKey)
os.Setenv(AwsSecretAccessKey, m.secretKey)
url := m.endpointUrl()
args := []string{
"--endpoint-url=" + url,
Expand All @@ -69,6 +67,12 @@ func (m *MountpointS3) Mount(source string, target string) error {
}

cmd := exec.Command(mountS3Command, args...)
envs := []string{
"AWS_ACCESS_KEY_ID=" + m.accessKey,
"AWS_SECRET_ACCESS_KEY=" + m.secretKey,
}
cmd.Stderr = os.Stderr
cmd.Env = append(cmd.Environ(), envs...)
klog.V(4).Infof("Mount fuse with command:%s and args:%s", mountS3Command, args)

if err := cmd.Run(); err != nil {
Expand Down
8 changes: 6 additions & 2 deletions pkg/s3/rclone.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ func (r *Rclone) Unstage(path string) error {
}

func (r *Rclone) Mount(source string, target string) error {
os.Setenv(AwsAccessKeyId, r.accessKey)
os.Setenv(AwsSecretAccessKey, r.secretKey)
url := r.endpointUrl()

args := []string{
Expand All @@ -58,9 +56,15 @@ func (r *Rclone) Mount(source string, target string) error {
"--vfs-cache-max-size=10G",
"--vfs-read-chunk-size-limit=100M",
"--buffer-size=100M",
"--daemon",
}
envs := []string{
"AWS_ACCESS_KEY_ID=" + r.accessKey,
"AWS_SECRET_ACCESS_KEY=" + r.secretKey,
}
cmd := exec.Command(rcloneCommand, args...)
cmd.Stderr = os.Stderr
cmd.Env = append(cmd.Environ(), envs...)
klog.V(4).Infof("Rclone with command:%s and args:%s", rcloneCommand, args)

if out, err := cmd.Output(); err != nil {
Expand Down

0 comments on commit 5ccd3c1

Please sign in to comment.