Skip to content

Commit 6433506

Browse files
committed
Merge branch 'add-logrotate' of https://github.com/Zero3River/curve-operator into add-logrotate
2 parents c745018 + 286296e commit 6433506

File tree

8 files changed

+245
-128
lines changed

8 files changed

+245
-128
lines changed

README.md

+47-125
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1+
#### English | [简体中文](https://github.com/opencurve/curve-operator/tree/master/docs/readme_cn.md)
2+
13
# Curve-Operator
24

35
## What's curve-operator
46

5-
The curve-operator project helps deploy a Curve cluster orchestrated by Kubernetes.(Currently only supports CurveBS cluster deployment)
7+
curve-operator manages [Curve](https://github.com/opencurve/curve) cluster on [Kuberentes](https://kubernetes.io/docs/home/). It make Curve a truly cloud-native distributed storage system.
68

7-
![Curve BS deploy architecture](./docs/images/curvebs-deploy-arch.png)
9+
![Curve BS deploy architecture](./docs/images/curve-deploy-arch.jpg)
810

9-
## Prerequisite
11+
## Setup
1012

11-
* Kubernetes 1.19,1.20
12-
* Three-nodes cluster(stand-alone deployment is not supported at persent)
13+
### 0.Prerequisite
1314

14-
## Install and Deploy
15+
* Kubernetes 1.19,1.20
1516

16-
### 1. Install Operator
17+
### 1.Install Operator
1718

1819
The first step is to install the Curve Operator.
1920

@@ -23,126 +24,35 @@ $ cd curve-operator
2324
$ kubectl apply -f config/deploy/
2425
```
2526

26-
verify the curve-operator is in the `Running` state in `curve` namespace.
27+
verify the curve-operator on the `Running` state in `curve` namespace.
2728

2829
```shell
2930
$ kubectl get pod -n curve
30-
3131
NAME READY STATUS RESTARTS AGE
3232
curve-operator-69bc69c75d-jfsjg 1/1 Running 0 7s
3333
```
3434

35-
### 2. Deploy Curve cluster
35+
### 2. Deploy Curve Cluster
3636

37-
#### Modify the cluster Declarative yaml file
37+
Operator deploys Curve cluster based on declarative API. You can get and modify customized the cluster yaml file in [config/sample.](https://github.com/opencurve/curve-operator/tree/master/config/samples)
3838

39-
```shell
40-
$ vim config/samples/cluster.yaml
41-
```
39+
[CurveBS Stand-alone deployment](https://github.com/opencurve/curve-operator/blob/master/config/samples/bscluster-onehost.yaml)
4240

43-
```yaml
44-
apiVersion: operator.curve.io/v1
45-
kind: CurveCluster
46-
metadata:
47-
name: curvebs-cluster-cloud
48-
# The namespace to deploy CurveBS cluster.
49-
# Curve operator is deployed in this namespace,Do not modify if not necessary
50-
namespace: curve
51-
spec:
52-
# The container image used to launch the Curve daemon pods(etcd, mds, chunkserver, snapshotclone).
53-
# v1.2 is Pacific and v1.3 is not tested.
54-
curveVersion:
55-
image: opencurvedocker/curvebs:v1.2.6
56-
# Container image pull policy,
57-
# By default the pull policy of all containers in that pod will be set to IfNotPresent if it is not explicitly specified and no modification necessary.
58-
imagePullPolicy: IfNotPresent
59-
# The K8s cluster nodes name in cluster that prepare to deploy Curve daemon pods(etcd, mds, snapshotclone).
60-
# For stand-alone deploy, set one node here and see bscluster-onehost.yaml
61-
# - node1 -> etcd-a, mds-a, snapshotclone-a
62-
# - node2 -> etcd-b, mds-b, snapshotclone-b
63-
# - node3 -> etcd-c, mds-c, snapshotclone-c
64-
nodes:
65-
- curve-operator-node1
66-
- curve-operator-node2
67-
- curve-operator-node3
68-
# hostDataDir where data files and log files will be persisted on host machine. Must be specified.
69-
# If you reinstall the cluster, make surce that you delete this directory from each host.
70-
hostDataDir: /curvebs
71-
etcd:
72-
# Port for listening to partner communication.
73-
# Etcd member accept incoming requests from its peers on a specific scheme://IP:port combination and the IP is host ip because we use hostnetwork:true.
74-
peerPort: 23800
75-
# clientPort for listening server port.
76-
clientPort: 23790
77-
mds:
78-
port: 6700
79-
dummyPort: 7700
80-
storage:
81-
# useSelectedNodes is to control whether to use individual nodes and their configured devices can be specified as well.
82-
# This field is not implemented at present and is must set false here.
83-
# You can refer following selectoedNodes setting commented if the function is completed later.
84-
# But the func is not implemented yet.
85-
useSelectedNodes: false
86-
# The hosts specified to deployment chunkserver as storage resource.
87-
# And you can configure the same nodes above configure that deploy etcd, mds and snapshotclone service.
88-
nodes:
89-
- curve-operator-node1
90-
- curve-operator-node2
91-
- curve-operator-node3
92-
port: 8200
93-
copySets: 100
94-
# Make sure the devices configured are available on hosts above.
95-
devices:
96-
- name: /dev/vdc
97-
mountPath: /data/chunkserver0
98-
percentage: 80
99-
# Not implement yet
100-
#selectedNodes:
101-
#- node: curve-operator-node1
102-
# - devices:
103-
# name: /dev/vdd
104-
# mountPath: /data/chunkserver1
105-
# percentage: 90
106-
# - devices:
107-
# name: /dev/vdf
108-
# mountPath: /data/chunkserver2
109-
# percentage: 80
110-
#- node: curve-operator-node2
111-
# - devices:
112-
# name:
113-
# mountPath:
114-
# percentage:
115-
snapShotClone:
116-
# set false if there is no S3 service available temporarily or don't need to use the snapshot clone service
117-
# Make sure s3 service exist if enable is set true
118-
enable: false
119-
port: 5555
120-
dummyPort: 8800
121-
proxyPort: 8900
122-
s3Config:
123-
# Access Key for the S3 service. Uploading snapshots
124-
ak: <>
125-
# Access Key for the S3 service. Uploading snapshots
126-
sk: <>
127-
# S3 service address
128-
nosAddress: <>
129-
# S3 service bucket name to store snapshots
130-
bucketName: <>
131-
```
41+
[CurveBS three replicas deployment](https://github.com/opencurve/curve-operator/blob/master/config/samples/cluster.yaml)
42+
43+
[CurveFS Stand-alone deployment](https://github.com/opencurve/curve-operator/blob/master/config/samples/fscluster-onehost.yaml)
13244

133-
#### Deploy cluster
45+
[CurveFS three replicase deployment](https://github.com/opencurve/curve-operator/blob/master/config/samples/fscluster.yaml)
13446

135-
The specific meaning of each configuration item is already in the comments above `cluster.yaml`, which can be modified according to the instructions. Then you can deploy it in cluster.
47+
Here we take the deployment of a three-node `CurveBS` cluster as an example. The yaml file is [cluster.yaml](https://github.com/opencurve/curve-operator/blob/master/config/samples/cluster.yaml) and you can learn more about how to modify this configuration file through the comments in it.
13648

137-
Create the cluster:
49+
Type the command to create the cluster
13850

13951
```shell
14052
$ kubectl apply -f config/samples/cluster.yaml
141-
142-
// or you can deploy stand-alone cluster using `bscluster-onhost.yaml`
14353
```
14454

145-
using `kubectl` to list pods in the curve namespace. You should be able to see the following pods once they are all running. The chunkserver numbers of will depend on the number of nodes in the cluster and the the number of devices configured.
55+
list all pods in the `curve` namespace:
14656

14757
```shell
14858
$ kubectl -n curve get pod
@@ -167,7 +77,9 @@ read-config-k272k 0/1 Completed
16777

16878
> Tips: The chunkserver pods may not start immediately, because the disk needs to be formatted in the background(`prepare-chunkfile` jobs), so it may take a while to see the chunkserver pod. The waiting time is determined according to the number and percentage of configured disks, and it may be a long time.
16979
170-
To verify that the cluster is in healthy state, enter one curve-chunkserver pod and `curve_ops_tools status` command to check.
80+
### 3. Check cluster health
81+
82+
To verify that the cluster is in healthy state, enter one `curve-chunkserver` pod and type `curve_ops_tools status` command to check.
17183

17284
```shell
17385
$ kubectl exec -it <any one chunkserver pod> -- bash
@@ -186,48 +98,58 @@ nebd-server: version-1.2.5+2c4861ca: 1
18698
...
18799
```
188100

189-
The cluster is deploymented completed and successfully if you see `cluster is healthy` prompt.
101+
The cluster deployment completed and successfully if you see `cluster is healthy` prompt.
190102

191-
### 3. Use Curve CSI
103+
## Curve CSI
192104

193-
After installing the operator and curve cluster, you can create a PVC that to use curvebs as pod storage.
105+
Create a PVC that to use curvebs as pod storage.
194106

195-
Refer to the documentation [deploy curve-csi](https://ask.opencurve.io/t/topic/89) to deploy curve-csi and use curve as backend storage of pod.
107+
you can deploy and get more details from [curve-csi](https://github.com/opencurve/curve-csi) project that dock `curvebs` cluster or [curvefs-csi](https://github.com/opencurve/curvefs-csi) project that dock `curvefs` cluster.
196108

197-
More details can see `curve-csi` project at [curve-csi github](https://github.com/opencurve/curve-csi).
109+
## Remove
198110

199-
## Uninstall curve cluster
111+
Remove curve cluster deployed already and clean up data on host.
200112

201-
You can uninstall curve cluster deployed and clean up data on host.
202-
203-
### 1. Delete the `Curvecluster` CR:
113+
### 1.Delete the cluster cr
204114

205115
```shell
206116
$ kubectl -n curve delete curvecluster my-cluster
207117
```
208118

209-
Verify that the cluster CR has been deleted before continuing to the next step.
119+
Verify the cluster CR has been deleted before continuing to the next step.
210120

211121
```shell
212122
$ kubectl -n curve get curvecluster
213123
```
214124

215-
### 2. Delete the Operator and related Resources
216-
217-
This will begin the process of the curve-operator and all other resources being cleaned up.
125+
### 2.Delete the Operator and related Resources
218126

219127
```shell
220128
$ kubectl delete -f config/deploy/
221129
```
222130

223131
### 3. Delete data and log on host
224132

225-
The final cleanup setp requires deleting files on each host in the cluster. All files under the `hostDataDir` property specified in the cluster CRD will need to be deleted. Otherwise, inconsistent state will remain when a new cluster is started.
133+
The final cleanup step requires deleting files on each host in the cluster. All files under the `hostDataDir` property specified in the cluster CRD will need to be deleted. Otherwise, inconsistent state will remain when a new cluster is started.
226134

227135
Connect to each machine and delete `/curvebs`, or the path specified by the `dataDirHostPath` and `logDirHostPath`.
228136

229137
```shell
230138
$ rm -rf /curvebs
231139
```
232140

233-
In the future this setp will not neccssary that we can delete it by running job on cluster if `cleanUpConfirm` is set.
141+
## Contributing
142+
143+
We welcome help in any form, including but not limited to improving documentation, asking questions, fixing bugs, and adding features.
144+
145+
## Meeting
146+
147+
We have an online community meeting every two weeks which talk about what `Curve` is doing and planning to do. You can view meeting minutes and agenda here [Double Week Meetings](https://github.com/opencurve/curve-meetup-slides/tree/main/2023/Double%20Week%20Meetings).
148+
149+
## License
150+
151+
You are required to comply with the [CNCF](https://www.cncf.io/) Code of Conduct while participating in this project.
152+
153+
## Contact
154+
155+
If you encounter any problems during use, please submit an [Issue](https://github.com/opencurve/curve-operator/issues) for feedback. You can also scan [the WeChat QR code](https://github.com/opencurve/curve-operator/tree/master/docs/images/curve-wechat.jpeg) to join the technical exchange group.

docs/images/curve-deploy-arch.jpg

152 KB
Loading

docs/images/curve-wechat.jpeg

67.2 KB
Loading

docs/images/curvebs-deploy-arch.png

-36 KB
Binary file not shown.

0 commit comments

Comments
 (0)