Git Product home page Git Product logo

opengauss-operator's Introduction

openGauss-operator

The openGauss-operator uses the client-go library to develop a custom controller monitoring, scheduling and updating openGauss cluster in kubernetes.

Table of Content

1. Build & Run

Deploy Prometheus Monitoring

Use prometheus to monitor the pod and node status.

Follow kube-prometheus quick start to install prometheus stack.

Generate code

Before generating code, make sure your project is in a directory with path xxx/github.com/waterme7on/.

Fetch code-generator repo and execute script.

go mod vendor
./hack/update-codegen.sh

Deploy OpenGauss controller

Fetch the project

git clone https://github.com/waterme7on/openGauss-operator.git
cd openGauss-operator

Build and Run in Process

go build -o controller .
# kubeconfig won't be needed if run in-cluster
./controller -kubeconfig=$HOME/.kube/config

Or Run in Deploymente

kubectl apply -f manifests manifests/serviceaccount.yaml 
kubectl apply -f manifests/deploy.yaml

Create Crd and example OpenGauss cluster

# create openGauss CustomResourceDefination
kubectl create -f manifests/crd.yaml
# create a openGauss object
kubectl create -f example/opengauss.yaml

Check status

# check all the components of opengauss defined by example
kubectl get all | grep opengauss

Add new master

# connect to mycat with mysql client, default user "mycat" and password "123456"
# create table using mysql client

# example in example/opengauss.yaml and example/opengauss-new-master.yaml

2. Structure

data flow and logic graph


components


3. Develop

Contributions

  1. modify
  2. git checkout -b xxx
  3. git push origin xxx:feat_xxx
  4. pull request

Use code-generator to update apis

Use code-generator to update code if you want to modify openGauss apis.

You may need to manually install code-generator or use command go mod vendor to create and populate vendor diretory to get the source file.

Build command:

# get the code-generator
go mod vendor
# or use command "go get k8s.io/code-generator"

# update apis
bash hack/update-codegen.sh
# then build and run

how the various components in the client-go library work and their interaction points with the custom controller code

grpc code generate

For protoc installation and instructions, see grpc in go

cd rpc
protoc --go_out=. --go_opt=paths=source_relative     --go-grpc_out=. --go-grpc_opt=paths=source_relative    protobuf/clients.proto

opengauss-operator's People

Contributors

huasiy avatar waterme7on avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

huasiy

opengauss-operator's Issues

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.