All Projects → jomkz → rethinkdb-operator

jomkz / rethinkdb-operator

Licence: Apache-2.0 license
A Kubernetes operator to manage RethinkDB clusters.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to rethinkdb-operator

vpc-peering-operator
A Kubernetes Operator to manage the lifecycle of AWS VPC Peering Connections
Stars: ✭ 23 (+4.55%)
Mutual labels:  operator
sieve
Automatic Reliability Testing for Kubernetes Controllers
Stars: ✭ 183 (+731.82%)
Mutual labels:  operator
dokku-rethinkdb
a rethinkdb plugin for dokku
Stars: ✭ 42 (+90.91%)
Mutual labels:  rethinkdb
cmak-operator
CMAK (prev. Kafka Manager) for Kubernetes
Stars: ✭ 45 (+104.55%)
Mutual labels:  operator
r6operators
r6operators is a collection of high-quality vectorized Rainbow Six: Siege Operator icons & metadata for Node.js
Stars: ✭ 75 (+240.91%)
Mutual labels:  operator
aws-nlb-helper-operator
Simple operator to manage AWS NLB attributes using Kubernetes Service object annotations
Stars: ✭ 23 (+4.55%)
Mutual labels:  operator
ava-rethinkdb
🔗 RethinkDB helpers for AVA
Stars: ✭ 24 (+9.09%)
Mutual labels:  rethinkdb
deploy
Deploy Development Builds of Open Cluster Management (OCM) on RedHat Openshift Container Platform
Stars: ✭ 133 (+504.55%)
Mutual labels:  operator
kstone
Kstone is an etcd management platform, providing cluster management, monitoring, backup, inspection, data migration, visual viewing of etcd data, and intelligent diagnosis.
Stars: ✭ 592 (+2590.91%)
Mutual labels:  operator
openstf-arm7-docker
Smartphone Test Farm using Docker on Raspberry Pi
Stars: ✭ 19 (-13.64%)
Mutual labels:  rethinkdb
actions-runner-controller
Kubernetes controller for GitHub Actions self-hosted runners
Stars: ✭ 2,636 (+11881.82%)
Mutual labels:  operator
logging-operator
A golang based operator to create and manage EFK (Elasticsearch, Fluentd, and Kibana) stack on Kubernetes
Stars: ✭ 42 (+90.91%)
Mutual labels:  operator
galaxykube
PolarDB-X Operator is a Kubernetes extension that aims to create and manage PolarDB-X cluster on Kubernetes.
Stars: ✭ 65 (+195.45%)
Mutual labels:  operator
marin3r
Lightweight, CRD based envoy control plane for kubernetes
Stars: ✭ 51 (+131.82%)
Mutual labels:  operator
european-transport-operators
NOT UP-TO-DATE ANYMORE, UNMAINTAINED. CHECK european-transport-feeds INSTEAD. List of european long-distance transport operators, available API endpoints, GTFS feeds and client modules.
Stars: ✭ 47 (+113.64%)
Mutual labels:  operator
nmt
Network mapping tool
Stars: ✭ 16 (-27.27%)
Mutual labels:  rethinkdb
kubexpose-operator
CRD and Operator to access your Kubernetes Deployment over the Internet
Stars: ✭ 45 (+104.55%)
Mutual labels:  operator
provider-kubernetes
Crossplane provider to provision and manage Kubernetes objects on (remote) Kubernetes clusters.
Stars: ✭ 63 (+186.36%)
Mutual labels:  operator
carvel-secretgen-controller
secretgen-controller provides CRDs to specify what secrets need to be on Kubernetes cluster (to be generated or not)
Stars: ✭ 54 (+145.45%)
Mutual labels:  operator
whitebox-controller
Extensible generic controller for Kubernetes
Stars: ✭ 34 (+54.55%)
Mutual labels:  operator

RethinkDB Operator

A Kubernetes operator to manage RethinkDB clusters.

Overview

This Operator is built using the Operator SDK, which is part of the Operator Framework and manages one or more RethinkDB instances deployed on Kubernetes.

Usage

The first step is to deploy the RethinkDB Operator into the cluster where it will watch for requests to create RethinkDBCluster resources, much like the native Kubernetes Deployment Controller watches for Deployment resource requests.

Deploy RethinkDB Operator

The deploy directory contains the manifests needed to properly install the Operator.

Create the service account for the operator.

kubectl create -f deploy/service_account.yaml

Next, create the RBAC role and role-binding that grants the permissions necessary for the operator to function.

kubectl create -f deploy/role.yaml
kubectl create -f deploy/role_binding.yaml

Add the CRD to the cluster that defines the RethinkDB resource.

kubectl create -f deploy/crds/rethinkdb_v1alpha1_rethinkdbcluster_crd.yaml

Finally, deploy the operator into the cluster.

$ kubectl create -f deploy/operator.yaml

You can watch the list of pods and wait until the Operator pod is in a Running state, it should not take long.

kubectl get pods -wl name=rethinkdb-operator

You can have a look at the logs for troubleshooting if needed.

kubectl logs -l name=rethinkdb-operator

Once the RethinkDB Operator is deployed, Have a look in the examples directory for example manifests that create RethinkDB resources.

Create RethinkDB Cluster

Once the Operator is deployed and running, we can create an example RethinkDB cluster. The example directory contains several example manifests for creating RethinkDB clusters using the Operator.

kubectl apply -f example/rethinkdb-minimal.yaml

Watch the list of pods to see that each requested node starts successfully.

kubectl get pods -wl cluster=rethinkdb-minimal-example

Destroy RethinkDB Cluster

Simply delete the RethinkDB Custom Resource to remove the cluster.

kubectl delete -f example/rethinkdb-minimal.yaml

Persistent Volumes

The RethinkDB Operator supports the use of Persistent Volumes for each node in the RethinkDB cluster. See rethinkdb-custom.yaml for the syntax to enable.

kubectl apply -f example/rethinkdb-custom.yaml

When deleting a RethinkDB cluster that uses Persistent Volumes, remember to remove the left-over volumes when the cluster is no longer needed, as these will not be removed automatically.

kubectl delete rethinkdbcluster,pvc -l cluster=rethinkdb-custom-example

Test Connection

You can spin up a simple client Pod to test accessing the cluster. The following code will list the names of each node in the cluster. See the full client in the examples directory.

r = require('rethinkdb');
fs = require('fs');

const SERVER_HOST = 'rethinkdb-minimal-example.default.svc.cluster.local';
const SERVER_PORT = 28015;
const SERVER_TIMEOUT = 10;
const SERVER_PASSWORD = fs.readFileSync('/etc/rethinkdb/credentials/admin-password', 'utf8');

r.connect({
    host: SERVER_HOST,
    port: SERVER_PORT,
    timeout: SERVER_TIMEOUT,
    password: SERVER_PASSWORD,
    ssl: {
        'ca': fs.readFileSync('/etc/rethinkdb/tls/ca.crt', 'utf8'),
        'cert': fs.readFileSync('/etc/rethinkdb/tls/client.crt', 'utf8'),
        'key': fs.readFileSync('/etc/rethinkdb/tls/client.key', 'utf8')
    }
}, function (err, conn) {
    if (err) throw err;
    r.db('rethinkdb').table('server_status').pluck('name').run(conn, function (err, res) {
        if (err) throw err;
        res.toArray(function (err, results) {
            if (err) throw err;
            console.log(results);
            process.exit();
        });
    });
});

Development

Local development is usually done with minikube or minishift.

Minikube

When using minikube for local development and testing, it may be necessary to increase the resources for the minikube VM.

minikube start --cpus 2 --memory 8192 --disk-size 40g

Source Code

Clone the repository to a location on your workstation, generally this should be in someplace like $GOPATH/src/github.com/ORG/REPO.

Navigate to the location where the repository has been cloned and install the dependencies.

cd YOUR_REPO_PATH
dep ensure && dep status

Run Locally

Once the dependencies are present, ensure the service account, role, role binding and CRD are added to your local cluster.

kubectl create -f deploy/service_account.yaml
kubectl create -f deploy/role.yaml
kubectl create -f deploy/role_binding.yaml
kubectl create -f deploy/crds/rethinkdb_v1alpha1_rethinkdbcluster_crd.yaml

Once the CRD is present, we can start the operator locally and begin development.

operator-sdk up local --namespace default

You can now create a RethinkDB resource to test your changes.

kubectl create -f example/rethinkdb-minimal.yaml

Keep in mind that when you make changes to the code, you must restart the operator. Use Ctrl+c to kill the process and restart.

Changelog

See the Changelog for the detail on what changed with each release.

License

RethinkDB Operator is released under the Apache 2.0 license. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].