Skip to content

Commit

Permalink
Merge pull request #30 from chengyu-l/master
Browse files Browse the repository at this point in the history
Refactor: simplify code
  • Loading branch information
awzhgw authored Jul 22, 2020
2 parents 8a3fdbc + a853626 commit fadd3ce
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 435 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ChubaoFS Container Storage Interface (CSI) plugins.
## Prerequisite

* Kubernetes 1.16.0
* ChubaoFS 2.0.0
* CSI spec version 1.1.0

## Prepare on-premise ChubaoFS cluster
Expand Down Expand Up @@ -57,7 +56,7 @@ provisioner: csi.chubaofs.com
reclaimPolicy: Delete
parameters:
masterAddr: "master-service.chubaofs.svc.cluster.local:17010"
consulAddr: "consul-service.chubaofs.svc.cluster.local:8500"
consulAddr: "http://consul-service.chubaofs.svc.cluster.local:8500"
owner: "csiuser"
logLevel: "debug"
```
Expand Down
5 changes: 4 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ FROM centos:7.2.1511
RUN curl -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo && \
yum install -y wget bind-utils jq fuse
RUN mkdir -p /cfs/bin /cfs/conf /cfs/logs
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-amd64 /bin/tini
ADD bin/cfs-client /cfs/bin
ADD bin/cfs-csi-driver /cfs/bin
ADD tini /bin
ADD start.sh /cfs/bin
RUN chmod +x /bin/tini && chmod +x /cfs/bin/cfs-client && chmod +x /cfs/bin/cfs-csi-driver && chmod +x /cfs/bin/start.sh
ENTRYPOINT [ "/bin/tini", "--" ]
CMD [""]
2 changes: 1 addition & 1 deletion build/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ echo "CSI_ENDPOINT:"${CSI_ENDPOINT}
echo "KUBE_NODE_NAME:"${KUBE_NODE_NAME}
echo "DRIVER_NAME:"${DRIVER_NAME}
echo "KUBE_CONFIG:"${KUBE_CONFIG}
/cfs/bin/cfs-csi-driver -v=${LOG_LEVEL} --endpoint=${CSI_ENDPOINT} --nodeid=${KUBE_NODE_NAME} --drivername=${DRIVER_NAME} --kubeconfig=${KUBE_CONFIG}> /cfs/logs/cfs-driver.out 2>&1
/cfs/bin/cfs-csi-driver -v=${LOG_LEVEL} --endpoint=${CSI_ENDPOINT} --nodeid=${KUBE_NODE_NAME} --drivername=${DRIVER_NAME} --kubeconfig=${KUBE_CONFIG} > /cfs/logs/cfs-driver.out 2>&1
Binary file removed build/tini
Binary file not shown.
6 changes: 2 additions & 4 deletions deploy/csi-controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ spec:
- mountPath: /csi
name: socket-dir
- name: cfs-driver
image: chubaofs/cfs-csi-driver:3.0.1
image: chubaofs/cfs-csi-driver:3.0.2
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
command:
- /bin/tini
- "--"
args:
- bash
- "-c"
- |-
Expand Down
6 changes: 2 additions & 4 deletions deploy/csi-node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ spec:
- mountPath: /registration
name: registration-dir
- name: cfs-driver
image: chubaofs/cfs-csi-driver:3.0.1
image: chubaofs/cfs-csi-driver:3.0.2
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
command:
- /bin/tini
- "--"
args:
- bash
- "-c"
- |-
Expand Down
2 changes: 1 addition & 1 deletion deploy/storageclass-share-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
# Resource manager IP address or URL
masterAddr: "master-service.chubaofs.svc.cluster.local:17010"
# Consul Service IP address or URL
consulAddr: "consul-service.chubaofs.svc.cluster.local:8500"
consulAddr: "http://consul-service.chubaofs.svc.cluster.local:8500"
# Owner name as authentication
owner: "csiuser"
crossZone: "false"
Expand Down
2 changes: 1 addition & 1 deletion deploy/storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
# Resource manager IP address or URL
masterAddr: "master-service.chubaofs.svc.cluster.local:17010"
# Consul Service IP address or URL
consulAddr: "consul-service.chubaofs.svc.cluster.local:8500"
consulAddr: "http://consul-service.chubaofs.svc.cluster.local:8500"
# Owner name as authentication
owner: "csiuser"
crossZone: "false"
Expand Down
2 changes: 2 additions & 0 deletions pkg/chubaofs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/utils/mount"
)

type driver struct {
Expand Down Expand Up @@ -85,6 +86,7 @@ func initClientSet(kubeconfig string) (*kubernetes.Clientset, error) {
func NewNodeServer(d *driver) *nodeServer {
return &nodeServer{
DefaultNodeServer: csicommon.NewDefaultNodeServer(d.CSIDriver),
mounter: mount.New(""),
}
}

Expand Down
265 changes: 0 additions & 265 deletions pkg/chubaofs/mountpoint_monitor.go

This file was deleted.

Loading

0 comments on commit fadd3ce

Please sign in to comment.