Skip to content

crate/crate-operator

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Continuous Integration Docker Build Documentation Docker Hub

βš™οΈ CrateDB Kubernetes Operator

The CrateDB Kubernetes Operator provides convenient way to run CrateDB clusters inside Kubernetes. It is built on top of the Kopf: Kubernetes Operators Framework.

πŸ—’οΈ Contents

🀹 Usage

A minimal custom resource for a 3 node CrateDB cluster may look like this:

dev-cluster.yaml:

apiVersion: cloud.crate.io/v1
kind: CrateDB
metadata:
  name: my-cluster
  namespace: dev
spec:
  cluster:
    imageRegistry: crate
    name: crate-dev
    version: 4.3.1
  nodes:
    data:
    - name: hot
      replicas: 3
      resources:
        limits:
          cpu: 4
          memory: 4Gi
        disk:
          count: 1
          size: 128GiB
          storageClass: default
        heapRatio: 0.5
$ kubectl --namespace dev create -f dev-cluster.yaml
...

$ kubectl --namespace dev get cratedbs
NAMESPACE   NAME         AGE
dev         my-cluster   36s

πŸŽ‰ Features

  • "all equal nodes" cluster setup
  • "master + data nodes" cluster setup
  • safe scaling of clusters
  • safe rolling version upgrades for clusters
  • SSL for HTTP and PG connections via Let's Encrypt certificate
  • custom node settings
  • custom cluster settings
  • custom storage classes
  • region/zone awareness for AWS and Azure

πŸ’½ Installation

Installation with Helm

To be able to deploy the custom resource CrateDB to a Kubernetes cluster, the API needs to be extended with a Custom Resource Definition (CRD). It can be installed separately by installing the CRD Helm Chart or as a dependency of the Operator Helm Chart.

helm repo add crate-operator https://crate.github.io/crate-operator
helm install crate-operator crate-operator/crate-operator

To override the environment variables from values.yaml, please refer to the configuration documentation.

Installation with kubectl

To be able to deploy the custom resource CrateDB to a Kubernetes cluster, the API needs to be extended with a Custom Resource Definition (CRD). The CRD for CrateDB can be found in the deploy/ folder and can be applied (assuming sufficient privileges).

$ kubectl apply -f deploy/crd.yaml
customresourcedefinition.apiextensions.k8s.io/cratedbs.cloud.crate.io created

Once the CRD is installed, the operator itself can be deployed using a Deployment in the crate-operator namespace.

$ kubectl create namespace crate-operator
...
$ kubectl create -f deploy/rbac.yaml
...
$ kubectl create -f deploy/deployment.yaml
...

Please refer to the configuration documentation for further details.

πŸ’» Development

Please refer to the Working on the operator section of the documentation.