Skip to content
Kubernetes operator for M3DB
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildkite [api] support custom node affinity per-isogroup (#106) Mar 22, 2019
.ci @ 5ebad82 [ci] build + release w/ go 1.12 (#114) Apr 7, 2019
.github [github] ask for operator version in issue tmpl (#129) Apr 25, 2019
assets [config] set new default m3db bootstrapper config (#112) Apr 5, 2019
build [api] cluster spec etcd endpts; per-cluster envs (#99) Mar 12, 2019
cmd [controller] fix pod removal when diff > 1 (#125) Apr 19, 2019
docker [ci] use m3 common docker build scripts (#102) Mar 13, 2019
docs Fix the docs and add better error messages for time parsing from yaml… May 19, 2019
example [docs] include prometheus monitoring instructions (#140) May 13, 2019
generated/mocks [api] make pod identity configurable (#63) Dec 5, 2018
hack [api] v1 -> v1alpha1 (#71) Dec 12, 2018
helm/m3db-operator [release] 0.2.0 release (#139) May 13, 2019
integration [api] expand node affinity; support multiple reqs (#131) Apr 30, 2019
pkg Fix the docs and add better error messages for time parsing from yaml… May 19, 2019
scripts fix migration script (#143) May 17, 2019
.codecov.yml Fix test Sep 21, 2018
.excludecoverage [tests] add e2e integration framework + tests (#61) Dec 4, 2018
.excludelint Adding ci bits Sep 17, 2018
.excludemetalint [api] allow customizing configmap; add default (#65) Dec 11, 2018
.gitattributes [k8sops] move readiness probes to new script (#18) Oct 1, 2018
.gitignore [docs] Add starter docs; upgrade helm chart (#66) Dec 13, 2018
.gitmodules Fix test Sep 21, 2018
.metalinter.json [ci] metalint all the things; enable in CI (#46) Oct 15, 2018
.travis.yml [ci] build container image locally on travis (#15) Oct 1, 2018
CHANGELOG.md [docs] node affinity docs; 0.2.0 release prep (#133) May 13, 2019
CODE_OF_CONDUCT.md Add a Code of Conduct (#72) Dec 12, 2018
CONTRIBUTING.md [docs] Add starter docs; upgrade helm chart (#66) Dec 13, 2018
Dockerfile [ci] build + release w/ go 1.12 (#114) Apr 7, 2019
Gopkg.lock [k8sops] clean up unused functions (#134) May 2, 2019
Gopkg.toml [build] update build dependencies (#120) Apr 11, 2019
LICENSE Initial commit Jul 19, 2018
Makefile [ci] build + release w/ go 1.12 (#114) Apr 7, 2019
NOTICE.txt [docs] Add starter docs; upgrade helm chart (#66) Dec 13, 2018
README.md [release] 0.2.0 release (#139) May 13, 2019
bundle.yaml [release] 0.2.0 release (#139) May 13, 2019
mkdocs.yml [docs] include prometheus monitoring instructions (#140) May 13, 2019
tools.json [ci] validate helm bundle in CI (#103) Mar 14, 2019

README.md

M3DB Operator e2e Build status codecov

Project Status: Alpha

The M3DB Operator is a project dedicated to setting up M3DB on Kubernetes. It aims to automate everyday tasks around managing M3DB. Specifically, it aims to automate:

  • Creating M3DB clusters
  • Destroying M3DB clusters
  • Expanding clusters (adding instances)
  • Shrinking clusters (removing instances)
  • Replacing failed instances

More information:

Getting Started

The following instructions serve as a quickstart to get an M3DB cluster up and running in your Kubernetes cluster. This setup is not for production use, as there's no persistent storage. More information on production-grade clusters can be found in our docs.

Kubernetes Cluster Prerequisites

The M3DB operator targets Kubernetes 1.10 and 1.11. We generally aim to target the latest two minor versions supported by GKE but welcome community contributions to support more versions!

The M3DB operator is intended for creating highly available clusters across distinct failure domains. For this reason we currently only support Kubernetes clusters with nodes in at least 3 zones, but support for zonal clusters is coming soon.

When running on GKE, the user applying the manifests will need the ability to allow cluster-admin-binding during the installation. Use the following ClusterRoleBinding with the user name provided by gcloud:

kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=<name@domain.com>

Installing the M3DB Operator

With Helm:

helm repo add m3db https://s3.amazonaws.com/m3-helm-charts-repository/stable;
helm install m3db/m3db-operator --namespace m3db-operator

With kubectl (will install in the default namespace):

kubectl apply -f https://raw.githubusercontent.com/m3db/m3db-operator/v0.2.0/bundle.yaml

Managing Clusters

Creating a Cluster

Create a simple etcd cluster to store M3DB's topology:

kubectl apply -f https://raw.githubusercontent.com/m3db/m3db-operator/v0.2.0/example/etcd/etcd-basic.yaml

Apply manifest with your zones specified for isolation groups:

apiVersion: operator.m3db.io/v1alpha1
kind: M3DBCluster
metadata:
  name: simple-cluster
spec:
  image: quay.io/m3db/m3dbnode:latest
  replicationFactor: 3
  numberOfShards: 256
  # Default endpoints if using provided etcd manifests.
  etcdEndpoints:
  - http://etcd-0.etcd:2379
  - http://etcd-1.etcd:2379
  - http://etcd-2.etcd:2379
  isolationGroups:
  - name: group1
    numInstances: 1
    nodeAffinityTerms:
    - key: failure-domain.beta.kubernetes.io/zone
      values:
      - <zone-a>
  - name: group2
    numInstances: 1
    nodeAffinityTerms:
    - key: failure-domain.beta.kubernetes.io/zone
      values:
      - <zone-b>
  - name: group3
    numInstances: 1
    nodeAffinityTerms:
    - key: failure-domain.beta.kubernetes.io/zone
      values:
      - <zone-c>
  podIdentityConfig:
    sources: []
  namespaces:
    - name: metrics-10s:2d
      preset: 10s:2d
  dataDirVolumeClaimTemplate:
    metadata:
      name: m3db-data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 100Gi

Resizing a Cluster

To resize a cluster, specify the new number of instances you want in each zone either by reapplying your manifest or using kubectl edit. The operator will safely scale up or scale down your cluster.

Deleting a Cluster

Delete a cluster using kubectl delete. You will to remove the etcd data as well, or wipe the data generated by the operator if you intend to reuse the etcd cluster for another M3DB cluster:

kubectl exec etcd-0 -- env ETCDCTL_API=3 etcdctl del --keys-only --prefix ""

Contributing

We welcome community contributions to to the M3DB operator! Please see CONTRIBUTING.md for more information. Please note that on creating a pull request you will be asked to agree to the Uber CLA before we can accept your contribution.

License

This project is licensed under the Apache license -- see the LICENSE file for details.

You can’t perform that action at this time.