-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add starter docs; upgrade helm chart (#66)
Adds very basic docs with an introduction to the operator and instructions to install it. Auto-generates API docs. Also ensures that `bundle.yaml` is up-to-date via CI, which necessitates installing helm in our CI image. Preparing for initial release!!
- Loading branch information
Showing
60 changed files
with
1,427 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM golang:1.10.4-stretch | ||
|
||
RUN mkdir /helm && \ | ||
cd /helm && \ | ||
wget -q -O helm.tgz https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gz && \ | ||
tar xzvf helm.tgz && \ | ||
mv linux-amd64/helm /bin && \ | ||
rm -rf /helm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
app: | ||
image: golang:1.10.4-stretch | ||
volumes: | ||
- ../:/go/src/github.com/m3db/m3db-operator | ||
environment: | ||
- CI | ||
- BUILDKITE | ||
- BUILDKITE_AGENT_ACCESS_TOKEN | ||
- BUILDKITE_JOB_ID | ||
- BUILDKITE_BUILD_ID | ||
- BUILDKITE_BUILD_NUMBER | ||
- BUILDKITE_BRANCH | ||
- BUILDKITE_BUILD_URL | ||
- BUILDKITE_PROJECT_SLUG | ||
- BUILDKITE_COMMIT | ||
- BUILDKITE_PULL_REQUEST | ||
- BUILDKITE_TAG | ||
- CODECOV_TOKEN | ||
version: '3' | ||
services: | ||
app: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile-ci | ||
volumes: | ||
- ../:/go/src/github.com/m3db/m3db-operator | ||
environment: | ||
- CI | ||
- BUILDKITE | ||
- BUILDKITE_AGENT_ACCESS_TOKEN | ||
- BUILDKITE_JOB_ID | ||
- BUILDKITE_BUILD_ID | ||
- BUILDKITE_BUILD_NUMBER | ||
- BUILDKITE_BRANCH | ||
- BUILDKITE_BUILD_URL | ||
- BUILDKITE_PROJECT_SLUG | ||
- BUILDKITE_COMMIT | ||
- BUILDKITE_PULL_REQUEST | ||
- BUILDKITE_TAG | ||
- CODECOV_TOKEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Contributing | ||
============ | ||
|
||
We'd love your help building the M3DB Operator! | ||
|
||
## Getting Started | ||
|
||
M3DB Operator uses `dep` to manage dependencies. To get started: | ||
|
||
```bash | ||
git submodule update --init --recursive | ||
make dep-ensure | ||
``` | ||
|
||
## Making A Change | ||
|
||
* Before making any significant changes, please [open an issue](https://github.com/m3db/m3db-operator/issues) | ||
|
||
* Discussing your proposed changes ahead of time will make the contribution process smooth for everyone. | ||
|
||
Once we've discussed your changes and you've got your code ready, make sure that tests are passing: | ||
|
||
```bash | ||
make test-all | ||
``` | ||
|
||
Your pull request is most likely to be accepted if it: | ||
|
||
* Includes tests for new functionality. | ||
* Follows the guidelines in [Effective Go](https://golang.org/doc/effective_go.html) and the [Go team's common code | ||
review comments](https://github.com/golang/go/wiki/CodeReviewComments). | ||
* Has a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
M3DB Operator includes derived work from Prometheus Operator | ||
(https://github.com/coreos/prometheus-operator) under the Apache License 2.0: | ||
|
||
Copyright 2016 The prometheus-operator Authors | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
The derived work can be found in the files: | ||
- cmd/docgen/main.go | ||
- cmd/docgen/api.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,39 +10,35 @@ The M3DB Operator is a project dedicated to setting up M3DB on Kubernetes. It ai | |
* Shrinking clusters (removing instances) | ||
* Replacing failed instances | ||
|
||
More information: | ||
|
||
- [Documentation][docs] | ||
- [Gitter room](https://gitter.im/m3db/kubernetes) | ||
- [M3DB Google Group](https://groups.google.com/forum/#!forum/m3db) | ||
|
||
## Getting Started | ||
|
||
The following instructions serve as a quickstart to get an M3DB cluster up and running in your Kubernetes cluster. | ||
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][docs]. | ||
|
||
### Kubernetes Cluster Prerequisites | ||
|
||
## Cloud (GKE) Prerequisites | ||
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: | ||
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! | ||
|
||
``` | ||
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=<[email protected]> | ||
``` | ||
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][zonal] for zonal clusters is | ||
coming soon. | ||
|
||
Apply the persistent disk storage resource: | ||
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 apply -f example/storage-fast-gcp.yaml | ||
``` | ||
|
||
## etcd Cluster | ||
|
||
M3DB stores its topology in etcd, so it is necessary to deploy an etcd cluster for a healthy deployment of M3DB. | ||
|
||
Apply the `etcd` cluster: | ||
|
||
``` | ||
kubectl apply -f example/etcd.yaml | ||
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=<[email protected]> | ||
``` | ||
|
||
## Installing the M3DB Operator | ||
### Installing the M3DB Operator | ||
|
||
With Helm: | ||
|
||
|
@@ -53,20 +49,21 @@ helm install m3db/m3db-operator --namespace m3db-operator | |
|
||
With `kubectl`: | ||
|
||
`kubectl apply -f https://raw.githubusercontent.com/m3db/m3db-operator/master/bundle.yaml` | ||
|
||
``` | ||
kubectl apply -f https://raw.githubusercontent.com/m3db/m3db-operator/v0.1.0/bundle.yaml | ||
``` | ||
|
||
## Managing Clusters | ||
|
||
### Creating a Cluster | ||
|
||
Apply the `m3db` cluster: | ||
Create a simple etcd cluster to store M3DB's topology: | ||
|
||
``` | ||
kubectl apply -f https://github.com/m3db/m3db-operator/tree/master/example/etcd/etcd-basic.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/m3db/m3db-operator/v0.1.0/example/etcd/etcd-basic.yaml | ||
``` | ||
|
||
Apply manifest with your zones specified for isolation groups: | ||
Apply manifest with your zones specified for isolation groups: | ||
|
||
``` | ||
apiVersion: operator.m3db.io/v1alpha1 | ||
|
@@ -92,20 +89,28 @@ spec: | |
preset: 10s:2d | ||
``` | ||
|
||
### Help | ||
``` | ||
>make help | ||
### 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. | ||
|
||
Usage: | ||
make <target> | ||
### Deleting a Cluster | ||
|
||
Targets: | ||
build-bin Build m3db-operator binary | ||
build-docker Build m3db-operator docker image with go binary | ||
code-gen Generate boilerplate code for kubernetes packages | ||
dep-ensure Run dep ensure to generate vendor directory | ||
dep-install Ensure dep is installed | ||
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 "" | ||
``` | ||
|
||
### License | ||
This project is licensed under the Apache license -- see the [LICENSE](https://github.com/m3db/m3db-operator/blob/master/LICENSE) file for details. | ||
## Contributing | ||
|
||
We welcome community contributions to to the M3DB operator! Please see [CONTRIBUTING.md](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](https://github.com/m3db/m3db-operator/blob/master/LICENSE) file for details. | ||
|
||
[docs]: https://operator.m3db.io/ | ||
[zonal]: https://github.com/m3db/m3db-operator/issues/68 |
Oops, something went wrong.