Skip to content

Commit

Permalink
Merge pull request #62 from Huweicai/master
Browse files Browse the repository at this point in the history
Rename project name from ChubaoFS to CubeFS
  • Loading branch information
shuoranliu committed Feb 16, 2022
2 parents 0ad399c + 8e882b3 commit df3943c
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 113 deletions.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build CSI driver image

Build the ChubaoFS client and CSI driver using the following commands
Build the CubeFS client and CSI driver using the following commands
```
make
```
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ChubaoFS CSI Makefile
# CubeFS CSI Makefile

IMAGE_TAG=chubaofs/cfs-csi-driver:3.0.0
IMAGE_TAG=cubefs/cfs-csi-driver:3.0.0

.PHONY: all build image push clean

Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[![Build Status](https://travis-ci.org/chubaofs/chubaofs-csi.svg?branch=master)](https://travis-ci.org/chubaofs/chubaofs-csi)
[![Build Status](https://travis-ci.org/cubefs/cubefs-csi.svg?branch=master)](https://travis-ci.org/cubefs/cubefs-csi)

# ChubaoFS CSI Driver
# CubeFS CSI Driver

## Overview

ChubaoFS Container Storage Interface (CSI) plugins.
CubeFS Container Storage Interface (CSI) plugins.

## Prerequisite

* Kubernetes 1.16.0
* CSI spec version 1.1.0

## Prepare on-premise ChubaoFS cluster
## Prepare on-premise CubeFS cluster

An on-premise ChubaoFS cluster can be deployed separately, or within the same Kubernetes cluster as applications which require persistent volumes. Please refer to [chubaofs-helm](https://github.com/chubaofs/chubaofs-helm) for more details on deployment using Helm.
An on-premise CubeFS cluster can be deployed separately, or within the same Kubernetes cluster as applications which require persistent volumes. Please refer to [cubefs-helm](https://github.com/cubefs/cubefs-helm) for more details on deployment using Helm.

## Add labels to Kubernetes node

You should tag each Kubernetes node with the appropriate labels accorindly for CSI node of ChubaoFS.
You should tag each Kubernetes node with the appropriate labels accorindly for CSI node of CubeFS.
`deploy/csi-controller-deployment.yaml` and `deploy/csi-node-daemonset.yaml` have `nodeSelector` element,
so you should add a label for nodes. If you want using ChubaoFS CSI in whole kubernetes cluster, you can delete `nodeSelector` element.
so you should add a label for nodes. If you want using CubeFS CSI in whole kubernetes cluster, you can delete `nodeSelector` element.

```
kubectl label node <nodename> chubaofs-csi-controller=enabled
kubectl label node <nodename> chubaofs-csi-node=enabled
kubectl label node <nodename> cubefs-csi-controller=enabled
kubectl label node <nodename> cubefs-csi-node=enabled
```

## Deploy the CSI driver
Expand All @@ -39,9 +39,9 @@ $ kubectl apply -f deploy/csi-node-daemonset.yaml
>
> `sed -i 's#/var/lib/kubelet#/data1/k8s/lib/kubelet#g' deploy/csi-node-daemonset.yaml`
## Use Remote ChubaoFS Cluster as backend storage
## Use Remote CubeFS Cluster as backend storage

There is only 3 steps before finally using remote ChubaoFS cluster as file system
There is only 3 steps before finally using remote CubeFS cluster as file system

1. Create StorageClass
2. Create PVC (Persistent Volume Claim)
Expand All @@ -56,11 +56,11 @@ kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: cfs-sc
provisioner: csi.chubaofs.com
provisioner: csi.cubefs.com
reclaimPolicy: Delete
parameters:
masterAddr: "master-service.chubaofs.svc.cluster.local:17010"
consulAddr: "http://consul-service.chubaofs.svc.cluster.local:8500"
masterAddr: "master-service.cubefs.svc.cluster.local:17010"
consulAddr: "http://consul-service.cubefs.svc.cluster.local:8500"
owner: "csiuser"
logLevel: "debug"
```
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
app: cfs-csi-demo-pod
spec:
containers:
- name: chubaofs-csi-demo
- name: cubefs-csi-demo
image: nginx:1.17.9
imagePullPolicy: "IfNotPresent"
ports:
Expand Down
12 changes: 6 additions & 6 deletions build/build_cfs_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

RootPath=$(cd "$(dirname $0)";pwd)
test -e ${RootPath}/bin/cfs-client && exit 0
test -d ${RootPath}/chubaofs && rm -rf ${RootPath}/chubaofs
git clone https://github.com/chubaofs/chubaofs.git ${RootPath}/chubaofs && cd ${RootPath}/chubaofs
ChubaoFSSrcPath=${RootPath}/chubaofs
Out=`docker run -it --rm --privileged -v ${ChubaoFSSrcPath}:/root/go/src/github.com/chubaofs/chubaofs chubaofs/cfs-base:1.0.1 \
/bin/bash -c 'cd /root/go/src/github.com/chubaofs/chubaofs/build && bash ./build.sh > build.out 2>&1 && echo 0 || echo 1'`
test -d ${RootPath}/cubefs && rm -rf ${RootPath}/cubefs
git clone https://github.com/cubefs/cubefs.git ${RootPath}/cubefs && cd ${RootPath}/cubefs
CubeFSSrcPath=${RootPath}/cubefs
Out=`docker run -it --rm --privileged -v ${CubeFSSrcPath}:/root/go/src/github.com/cubefs/cubefs cubefs/cfs-base:1.0.1 \
/bin/bash -c 'cd /root/go/src/github.com/cubefs/cubefs/build && bash ./build.sh > build.out 2>&1 && echo 0 || echo 1'`
if [[ "X${Out:0:1}" != "X0" ]]; then
echo "build cfs-client fail"
exit 1
fi

test -d ${RootPath}/bin || mkdir -p ${RootPath}/bin
test -e ${RootPath}/bin/cfs-client && rm ${RootPath}/bin/cfs-client
mv ${ChubaoFSSrcPath}/build/bin/cfs-client ${RootPath}/bin && rm -rf ${RootPath}/chubaofs
mv ${CubeFSSrcPath}/build/bin/cfs-client ${RootPath}/bin && rm -rf ${RootPath}/cubefs
echo "build cfs-client success"


4 changes: 2 additions & 2 deletions build/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Version="1.0.0"
if [[ -n "$1" ]] ;then
# docker image tag of ChubaoFS CSI Driver
# docker image tag of CubeFS CSI Driver
Version=$1
fi

RootPath=$(cd $(dirname $0); pwd)
CfsCsiDriver="chubaofs/cfs-csi-driver:$Version"
CfsCsiDriver="cubefs/cfs-csi-driver:$Version"
docker build -t ${CfsCsiDriver} -f ${RootPath}/Dockerfile ${RootPath}
10 changes: 5 additions & 5 deletions cmd/chubaofs.go → cmd/cubefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import (
"os/signal"
"syscall"

"github.com/cubefs/cubefs-csi/pkg/cubefs"
"github.com/golang/glog"

"github.com/chubaofs/chubaofs-csi/pkg/chubaofs"
"github.com/spf13/cobra"
)

var (
endpoint string
version = "1.0.0"
conf chubaofs.Config
conf cubefs.Config
)

func init() {
Expand All @@ -52,7 +52,7 @@ func main() {
cmd.Flags().AddGoFlagSet(flag.CommandLine)
cmd.PersistentFlags().StringVar(&conf.NodeID, "nodeid", "", "This node's ID")
cmd.PersistentFlags().StringVar(&endpoint, "endpoint", "unix:///csi/csi.sock", "CSI endpoint, must be a UNIX socket")
cmd.PersistentFlags().StringVar(&conf.DriverName, "drivername", chubaofs.DriverName, "name of the driver (Kubernetes: `provisioner` field in StorageClass must correspond to this value)")
cmd.PersistentFlags().StringVar(&conf.DriverName, "drivername", cubefs.DriverName, "name of the driver (Kubernetes: `provisioner` field in StorageClass must correspond to this value)")
cmd.PersistentFlags().StringVar(&conf.Version, "version", version, "Driver version")
cmd.PersistentFlags().StringVar(&conf.KubeConfig, "kubeconfig", "", "Kubernetes config")
cmd.PersistentFlags().BoolVar(&conf.RemountDamaged, "remountdamaged", false,
Expand All @@ -68,9 +68,9 @@ func main() {
}

func handle() {
d, err := chubaofs.NewDriver(conf)
d, err := cubefs.NewDriver(conf)
if err != nil {
glog.Errorf("chubaofs.NewDriver error:%v\n", err)
glog.Errorf("cubefs.NewDriver error:%v\n", err)
os.Exit(1)
}

Expand Down
12 changes: 6 additions & 6 deletions deploy/csi-controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Deployment
apiVersion: apps/v1
metadata:
name: cfs-csi-controller
namespace: default
namespace: cubefs
spec:
selector:
matchLabels:
Expand All @@ -15,15 +15,15 @@ spec:
spec:
serviceAccount: cfs-csi-service-account
nodeSelector:
chubaofs-csi-controller: enabled
cubefs-csi-controller: enabled
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.6.0
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
args:
- --provisioner=csi.chubaofs.com
- --provisioner=csi.cubefs.com
- --csi-address=$(ADDRESS)
env:
- name: TZ
Expand Down Expand Up @@ -79,7 +79,7 @@ spec:
- mountPath: /csi
name: socket-dir
- name: cfs-driver
image: ghcr.io/cubefs/cfs-csi-driver:2.4.1.110.0
image: ghcr.io/cubefs/cfs-csi-driver:2.4.1.110.1
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
Expand All @@ -98,7 +98,7 @@ spec:
- name: CSI_ENDPOINT
value: unix:///csi/csi-controller.sock
- name: DRIVER_NAME
value: csi.chubaofs.com
value: csi.cubefs.com
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -123,7 +123,7 @@ spec:
name: mountpoint-dir
volumes:
- hostPath:
path: /var/lib/kubelet/plugins/csi.chubaofs.com
path: /var/lib/kubelet/plugins/csi.cubefs.com
type: DirectoryOrCreate
name: socket-dir
- hostPath:
Expand Down
12 changes: 6 additions & 6 deletions deploy/csi-node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: DaemonSet
apiVersion: apps/v1
metadata:
name: cfs-csi-node
namespace: default
namespace: cubefs
spec:
updateStrategy:
type: OnDelete
Expand All @@ -16,7 +16,7 @@ spec:
spec:
serviceAccount: cfs-csi-service-account
nodeSelector:
chubaofs-csi-node: enabled
cubefs-csi-node: enabled
containers:
- name: csi-node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.3.0
Expand All @@ -32,7 +32,7 @@ spec:
- name: ADDRESS
value: /csi/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: /var/lib/kubelet/plugins/csi.chubaofs.com/csi.sock
value: /var/lib/kubelet/plugins/csi.cubefs.com/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -48,7 +48,7 @@ spec:
- mountPath: /registration
name: registration-dir
- name: cfs-driver
image: ghcr.io/cubefs/cfs-csi-driver:2.4.1.110.0
image: ghcr.io/cubefs/cfs-csi-driver:2.4.1.110.1
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
Expand All @@ -67,7 +67,7 @@ spec:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: DRIVER_NAME
value: csi.chubaofs.com
value: csi.cubefs.com
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -92,7 +92,7 @@ spec:
name: mountpoint-dir
volumes:
- hostPath:
path: /var/lib/kubelet/plugins/csi.chubaofs.com
path: /var/lib/kubelet/plugins/csi.cubefs.com
type: DirectoryOrCreate
name: socket-dir
- hostPath:
Expand Down

0 comments on commit df3943c

Please sign in to comment.