2020-08-02 01:01:15 +00:00
# SeaweedFS Operator
2020-10-27 07:37:07 +00:00
Goals:
2020-10-27 07:54:25 +00:00
* Automatically deploy a SeaweedFS cluster with 3 masters, N volume servers, and M filers with customizable filer store managed by other operators.
2020-10-27 07:37:07 +00:00
* Auto rolling upgrade and restart.
* Ingress for volume server, filer and S3, to support HDFS, REST filer, S3 API and cross-cluster replication.
* Support all major cloud Kubernetes: AWS, Google, Azure.
2020-10-27 07:56:59 +00:00
* Scheduled backup to cloud storage: S3, Google Cloud Storage , Azure.
2020-10-27 07:58:58 +00:00
* Put warm data to cloud storage tier: S3, Google Cloud Storage , Azure.
2020-10-27 07:54:25 +00:00
* Grafana dashboard.
2020-10-27 07:37:07 +00:00
2020-08-02 01:01:15 +00:00
## Installation
2020-11-15 03:18:19 +00:00
This operator uses `kustomize` to deploy. The installation process will install one for you if you do not have one.
By default, the defaulting and validation webhooks are disabled. We strongly recommend that the webhooks be enabled.
First clone the repository:
```bash
$ git clone https://github.com/seaweedfs/seaweedfs-operator --depth=1
```
2020-11-28 01:26:47 +00:00
To deploy the operator with webhooks enabled, make sure you have installed the `cert-manager` (Installation docs: https://cert-manager.io/docs/installation/) in your cluster, then follow the instructions in the `config/default/kustomization.yaml` file to uncomment the components you need.
2020-11-15 03:18:19 +00:00
2020-11-28 01:31:24 +00:00
Lastly, change the value of `ENABLE_WEBHOOKS` to `"true"` in `seaweedfs-operator/config/manager/manager.yaml`
2020-11-15 03:18:19 +00:00
Then run the command to deploy the operator into your cluster:
```
$ make deploy
```
2020-08-02 01:01:15 +00:00
## Development
2020-09-20 23:34:57 +00:00
Follow the instructions in https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/
2020-08-02 01:01:15 +00:00
```
$ git clone https://github.com/seaweedfs/seaweedfs-operator
$ cd seaweedfs-operator
# register the CRD with the Kubernetes
2020-11-09 00:23:17 +00:00
$ make deploy
2020-08-02 01:01:15 +00:00
2020-11-09 00:23:17 +00:00
# build the operator image
$ make docker-build
# load the image into Kind cluster
$ kind load docker-image seaweedfs/operator:v0.0.1
2020-08-02 01:01:15 +00:00
# From another terminal in the same directory
2020-08-02 06:27:46 +00:00
$ kubectl apply -f config/samples/seaweed_v1_seaweed.yaml
2020-08-02 01:01:15 +00:00
```
2020-11-09 07:29:57 +00:00
2020-11-10 07:28:13 +00:00
### Update the operator
2020-11-09 07:29:57 +00:00
```
# delete the existing operator
$ kubectl delete namespace seaweedfs-operator-system
# rebuild the operator image
$ make docker-build
# load the image into Kind cluster
$ kind load docker-image seaweedfs/operator:v0.0.1
# register the CRD with the Kubernetes
$ make deploy
2020-11-10 07:28:13 +00:00
```
### develop outside of k8s
```
$ git clone https://github.com/seaweedfs/seaweedfs-operator
$ cd seaweedfs-operator
# register the CRD with the Kubernetes
$ make install
# run the operator locally outside the Kubernetes cluster
$ make run ENABLE_WEBHOOKS=false
# From another terminal in the same directory
$ kubectl apply -f config/samples/seaweed_v1_seaweed.yaml
2020-11-28 01:26:47 +00:00
```