Giter Site home page Giter Site logo

hankhannah / seaweedfs-operator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seaweedfs/seaweedfs-operator

0.0 0.0 0.0 17.3 MB

seaweedfs kubernetes operator

License: Apache License 2.0

Shell 1.29% Go 91.82% Makefile 3.93% Smarty 2.19% Dockerfile 0.77%

seaweedfs-operator's Introduction

Build Status

SeaweedFS Operator

This Kubernetes Operator is made to easily deploy SeaweedFS onto your Kubernetes-Cluster.

The difference to seaweedfs-csi-driver is that the infrastructure (SeaweedFS) itself runs on Kubernetes as well (Master, Filer, Volume-Servers) and can as such easily scale with it as you need. It is also by far more resilent to failures then a simple systemD service in regards to handling crashing services or accidental deletes.

By using make deploy it will deploy a Resource of type 'Seaweed' onto your current kubectl $KUBECONFIG target (the operator itself) which by default will do nothing unless you configurate it (see examples in config/samples/).

Goals:

  • Automatically deploy and manage a SeaweedFS cluster.
  • Ability to be managed by other Operators.
  • Compability with seaweedfs-csi-driver
  • 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.
  • Scheduled backup to cloud storage: S3, Google Cloud Storage , Azure.
  • Put warm data to cloud storage tier: S3, Google Cloud Storage , Azure.
  • Grafana dashboard.

Installation

This operator uses kustomize to deploy. Please install kustomize 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:

$ git clone https://github.com/seaweedfs/seaweedfs-operator --depth=1

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.
Lastly, change the value of ENABLE_WEBHOOKS to "true" in config/manager/manager.yaml

Manager image must be locally built and published into a registry accessible from your k8s cluster:

$ export IMG=<registry/image>
$ make docker-build
$ make docker-push

Afterwards fire up to install CRDs:

$ make install

Then run the command to deploy the operator into your cluster using Kustomize or Helm:

# if using Kustomize
$ make deploy
# if using Helm
$ helm install seaweedfs-operator ./deploy/helm

Verify if it was correctly deployed with:

$ kubectl get pods --all-namespaces

Which may return:

NAMESPACE                   NAME                                                     READY   STATUS    RESTARTS   AGE
kube-system                 coredns-f9fd979d6-68p4c                                  1/1     Running   0          34m
kube-system                 coredns-f9fd979d6-x992t                                  1/1     Running   0          34m
kube-system                 etcd-kind-control-plane                                  1/1     Running   0          34m
kube-system                 kindnet-rp7wr                                            1/1     Running   0          34m
kube-system                 kube-apiserver-kind-control-plane                        1/1     Running   0          34m
kube-system                 kube-controller-manager-kind-control-plane               1/1     Running   0          34m
kube-system                 kube-proxy-dqfg2                                         1/1     Running   0          34m
kube-system                 kube-scheduler-kind-control-plane                        1/1     Running   0          34m
local-path-storage          local-path-provisioner-78776bfc44-7zvxx                  1/1     Running   0          34m
seaweedfs-operator-system   seaweedfs-operator-controller-manager-54cc768f4c-cwz2k   2/2     Running   0          34m

See the next section for example usage - at this point you only deployed the Operator itself!

You need to also deploy an configuration to get it running (see next section)!

Configuration Examples

apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
  name: seaweed1
  namespace: default
spec:
  # Add fields here
  image: chrislusf/seaweedfs:latest
  volumeServerDiskCount: 1
  hostSuffix: seaweed.abcdefg.com
  master:
    replicas: 3
    volumeSizeLimitMB: 1024
  volume:
    replicas: 1
    requests:
      storage: 2Gi
  filer:
    replicas: 2
    config: |
      [leveldb2]
      enabled = true
      dir = "/data/filerldb2"

Maintenance and Uninstallation

  • TBD

Development

Follow the instructions in https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/

$ git clone https://github.com/seaweedfs/seaweedfs-operator
$ cd seaweedfs-operator

# register the CRD with the Kubernetes
$ make deploy

# build the operator image
$ make docker-build

# load the image into Kind cluster
$ kind load docker-image chrislusf/seaweedfs-operator:v0.0.1

# From another terminal in the same directory
$ kubectl apply -f config/samples/seaweed_v1_seaweed.yaml

Update the operator

# 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 chrislusf/seaweedfs-operator:v0.0.1

# register the CRD with the Kubernetes
$ make deploy

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

seaweedfs-operator's People

Contributors

chrislusf avatar howardlau1999 avatar thiscantbeserious avatar scrayos avatar chrisluroblox avatar hz89 avatar 70data avatar chrisluuber avatar dependabot[bot] avatar arthurzenika avatar lamorigin007 avatar ixday avatar oliverblaha avatar robinbraemer avatar kvaster avatar programmeris avatar rkmsk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.