Skip to content

Commit

Permalink
New quick start (#358)
Browse files Browse the repository at this point in the history
* Simplify README
* new, simpler, installation process
* move more complex stuff to the contributor's guide
  • Loading branch information
mkuratczyk committed Sep 24, 2020
1 parent 56e2f09 commit 9b821d3
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 62 deletions.
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,50 @@ list][rmq-users]. This would include YAML manifests, Kubernetes version,
RabbitMQ Operator logs and any other relevant information that might help
to diagnose the problem.

## Makefile

This project contains a Makefile to perform common development operation. If you want to build, test or deploy a local copy of the repository, keep reading.

### Required environment variables

The following environment variables are required by many of the `make` targets to access a custom-built image:

- DOCKER_REGISTRY_SERVER: URL of docker registry containing the Operator image (e.g. `registry.my-company.com`)
- OPERATOR_IMAGE: path to the Operator image within the registry specified in DOCKER_REGISTRY_SERVER (e.g. `rabbitmq/cluster-operator`). Note: OPERATOR_IMAGE should **not** include a leading slash (`/`)

When running `make deploy-dev`, additionally:

- DOCKER_REGISTRY_USERNAME: Username for accessing the docker registry
- DOCKER_REGISTRY_PASSWORD: Password for accessing the docker registry
- DOCKER_REGISTRY_SECRET: Name of Kubernetes secret in which to store the Docker registry username and password

#### Make targets

- **controller-gen** Download controller-gen if not in $PATH
- **deploy** Deploy operator in the configured Kubernetes cluster in ~/.kube/config
- **deploy-dev** Deploy operator in the configured Kubernetes cluster in ~/.kube/config, with local changes
- **deploy-kind** Load operator image and deploy operator into current KinD cluster
- **deploy-sample** Deploy RabbitmqCluster defined in config/sample/base
- **destroy** Cleanup all operator artefacts
- **kind-prepare** Prepare KinD to support LoadBalancer services, and local-path StorageClass
- **kind-unprepare** Remove KinD support for LoadBalancer services, and local-path StorageClass
- **list** List Makefile targets
- **run** Run operator binary locally against the configured Kubernetes cluster in ~/.kube/config
- **unit-tests** Run unit tests
- **integration-tests** Run integration tests
- **system-tests** Run end-to-end tests against Kubernetes cluster defined in ~/.kube/config

### Testing

Before submitting a pull request, ensure all local tests pass:
- `make unit-tests`
- `make integration-tests`

<!-- TODO: generalise deployment process: make DOCKER_REGISTRY_SECRET and DOCKER_REGISTRY_SERVER configurable -->
Also, run the system tests with your local changes against a Kubernetes cluster:
- `make deploy-dev`
- `make system-tests`

## Pull Requests

RabbitMQ Operator project uses pull requests to discuss, collaborate on and accept code contributions.
Expand All @@ -40,6 +84,10 @@ Here's the recommended workflow:
If what you are going to work on is a substantial change, please first
ask the core team for their opinion on the [RabbitMQ users mailing list][rmq-users].

### Code Conventions

This project follows the [Kubernetes Code Conventions for Go](https://github.com/kubernetes/community/blob/master/contributors/guide/coding-conventions.md#code-conventions), which in turn mostly refer to [Effective Go](https://golang.org/doc/effective_go.html) and [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments). Please ensure your pull requests follow these guidelines.

## Code reviews

All submissions, including submissions by project members, require review. We
Expand Down
83 changes: 21 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
# RabbitMQ Cluster Kubernetes Operator

Manage [RabbitMQ](https://www.rabbitmq.com/) clusters deployed to [Kubernetes](https://kubernetes.io/). The RabbitMQ Cluster Kubernetes Operator has been built using the [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) implementation of the [operator pattern](https://coreos.com/blog/introducing-operators.html). This repository contains a [custom controller](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#custom-controllers) and [custom resource definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) designed for the lifecyle (creation, upgrade, graceful shutdown) of a RabbitMQ cluster.
Kubernetes operator to deploy and manage [RabbitMQ](https://www.rabbitmq.com/) clusters. This repository contains a [custom controller](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#custom-controllers) and [custom resource definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) designed for the lifecyle (creation, upgrade, graceful shutdown) of a RabbitMQ cluster.

**Note**: this repository is under active development and is provided as **beta** software. Official support for this software is not provided; if you encounter any issues running this software, please feel free to [contribute to the project](#contributing).

## Supported Versions

The operator deploys RabbitMQ `3.8.8` by default, and supports versions from `3.8.4` upwards. The operator requires a Kubernetes cluster of `1.16` or above.

## Versioning

RabbitMQ Cluster Kubernetes Operator follows non-strict [semver](https://semver.org/).

[The versioning guidelines document](version_guidelines.md) contains guidelines
on how we implement non-strict semver. The version number MAY or MAY NOT follow the semver rules. Hence, we highly recommend to read
the release notes to understand the changes and their potential impact for any release.

## Quickstart

### Deploying on KinD
If you have a running Kubernetes cluster and `kubectl` configured to access it, run the following command to install the operator:

```bash
kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
```

The easiest way to set up a local development environment for running the RabbitMQ operator is using [KinD](https://kind.sigs.k8s.io/):
Then you can deploy a RabbitMQ cluster:

1. Follow the KinD [installation guide](https://kind.sigs.k8s.io/#installation-and-usage) to deploy a Kubernetes cluster
1. Ensure that all [Required environment variables](#required-environment-variables) are set in your environment
1. Run `make deploy-kind`
1. Check that the operator is running by running `kubectl get all --namespace=rabbitmq-system`
1. Deploy a `RabbitmqCluster` custom resource. Refer to the [example YAML](./cr-example.yaml) and [documentation](https://docs.pivotal.io/rabbitmq-kubernetes/0-7/using.html#configure) for available CR attributes
1. Due to resource limitations on your Docker daemon, the Kubernetes might not be able to schedule all `RabbitmqCluster` nodes. Either [increase your Docker daemon's resource limits](https://docs.docker.com/docker-for-mac/#resources) or deploy the `RabbitmqCluster` custom resource with `resources: {}` to remove default `memory` and `cpu` resource settings.
1. If you set the `serviceType` to `LoadBalancer`, run `make kind-prepare` to deploy a [MetalLB](https://metallb.universe.tf/) load balancer. This will allow the operator to complete the `RabbitmqCluster` provisioning by assign an arbitrary local IP address to the cluster's client service. Proper [network configuration](https://metallb.universe.tf/installation/network-addons/) is required to route traffic via the assigned IP address.
```bash
kubectl apply -f https://raw.githubusercontent.com/rabbitmq/cluster-operator/main/docs/examples/hello-world/rabbitmq.yaml
```

<p align="center">
<img width="100%" src="./docs/demos/installation.svg">
</p>

## Documentation

Expand All @@ -46,54 +37,23 @@ In addition, a number of [examples](./docs/examples) can be found in this reposi
The doc guides are open source. The source can be found in the [RabbitMQ website repository](https://github.com/rabbitmq/rabbitmq-website/)
under `site/kubernetes`.

## Supported Versions

## Makefile

#### Required environment variables

- DOCKER_REGISTRY_SERVER: URL of docker registry containing the Operator image (e.g. `registry.my-company.com`)
- OPERATOR_IMAGE: path to the Operator image within the registry specified in DOCKER_REGISTRY_SERVER (e.g. `rabbitmq/cluster-operator`). Note: OPERATOR_IMAGE should **not** include a leading slash (`/`)

When running `make deploy-dev`, additionally:
The operator deploys RabbitMQ `3.8.8` by default, and supports versions from `3.8.4` upwards. The operator requires Kubernetes `1.16` or newer.

- DOCKER_REGISTRY_USERNAME: Username for accessing the docker registry
- DOCKER_REGISTRY_PASSWORD: Password for accessing the docker registry
- DOCKER_REGISTRY_SECRET: Name of Kubernetes secret in which to store the Docker registry username and password
## Versioning

#### Make targets
RabbitMQ Cluster Kubernetes Operator follows non-strict [semver](https://semver.org/).

- **controller-gen** Download controller-gen if not in $PATH
- **deploy** Deploy operator in the configured Kubernetes cluster in ~/.kube/config
- **deploy-dev** Deploy operator in the configured Kubernetes cluster in ~/.kube/config, with local changes
- **deploy-kind** Load operator image and deploy operator into current KinD cluster
- **deploy-sample** Deploy RabbitmqCluster defined in config/sample/base
- **destroy** Cleanup all operator artefacts
- **kind-prepare** Prepare KinD to support LoadBalancer services, and local-path StorageClass
- **kind-unprepare** Remove KinD support for LoadBalancer services, and local-path StorageClass
- **list** List Makefile targets
- **run** Run operator binary locally against the configured Kubernetes cluster in ~/.kube/config
- **unit-tests** Run unit tests
- **integration-tests** Run integration tests
- **system-tests** Run end-to-end tests against Kubernetes cluster defined in ~/.kube/config
[The versioning guidelines document](version_guidelines.md) contains guidelines
on how we implement non-strict semver. The version number MAY or MAY NOT follow the semver rules. Hence, we highly recommend to read
the release notes to understand the changes and their potential impact for any release.

## Contributing

This project follows the typical GitHub pull request model. Before starting any work, please either comment on an [existing issue](https://github.com/rabbitmq/cluster-operator/issues), or file a new one.

### Testing

Before submitting a pull request, ensure all local tests pass:
- `make unit-tests`
- `make integration-tests`

<!-- TODO: generalise deployment process: make DOCKER_REGISTRY_SECRET and DOCKER_REGISTRY_SERVER configurable -->
Also, run the system tests with your local changes against a Kubernetes cluster:
- `make deploy-dev`
- `make system-tests`

### Code Conventions

This project follows the [Kubernetes Code Conventions for Go](https://github.com/kubernetes/community/blob/master/contributors/guide/coding-conventions.md#code-conventions), which in turn mostly refer to [Effective Go](https://golang.org/doc/effective_go.html) and [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments). Please ensure your pull requests follow these guidelines.
Please read [contribution guidelines](CONTRIBUTING.md) if you are interested in contributing to this project.

## License

Expand All @@ -102,4 +62,3 @@ This project follows the [Kubernetes Code Conventions for Go](https://github.com
## Copyright

Copyright 2020 VMware, Inc. All Rights Reserved.

1 change: 1 addition & 0 deletions docs/demos/installation.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9b821d3

Please sign in to comment.