Skip to content

Commit

Permalink
Merge pull request #97 from sagikazarmark/rabbitmq-operator
Browse files Browse the repository at this point in the history
Add RabbitMQ operator chart
  • Loading branch information
sagikazarmark authored Jun 20, 2021
2 parents 35405ad + f84221e commit b1895bc
Show file tree
Hide file tree
Showing 18 changed files with 4,420 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ chart/dex-k8s-authenticator:
chart/kube-secrets-init:
- charts/kube-secrets-init/**/*

chart/rabbitmq-operator:
- charts/rabbitmq-operator/**/*

chart/sftpgo:
- charts/sftpgo/**/*

Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Exclude unsupported charts
id: exclusions
env:
DOCKER_IMAGES: "ghcr.io/${{ github.repository }}"
run: |
CHARTS=()
for chart in $(ct list-changed); do
if cat exclusions | grep "${chart} ${{ matrix.kube }}" > /dev/null; then
echo "Excluding chart from testing: ${chart}"
CHARTS+=("${chart#charts/}")
fi
done
echo ::set-output name=charts::$(IFS=,; echo "${CHARTS[*]}")
# See https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.1
- name: Determine KinD node image version
id: node_image
Expand Down Expand Up @@ -102,4 +118,4 @@ jobs:
node_image: ${{ steps.node_image.outputs.image }}

- name: Test
run: ct install
run: ct install --excluded-charts "${{ steps.exclusions.outputs.charts }}"
1 change: 1 addition & 0 deletions charts/rabbitmq-operator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tmp/
26 changes: 26 additions & 0 deletions charts/rabbitmq-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

ci/
README.md.gotmpl
45 changes: 45 additions & 0 deletions charts/rabbitmq-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v2
type: application
name: rabbitmq-operator
version: 0.0.1
appVersion: 1.7.0
kubeVersion: ">=1.18.0-0"
description: Kubernetes operator to deploy and manage RabbitMQ clusters.
icon: https://bitnami.com/assets/stacks/rabbitmq/img/rabbitmq-stack-220x234.png
keywords:
- rabbitmq
- message queue
- AMQP
- operator
home: https://www.rabbitmq.com/kubernetes/operator/operator-overview.html
sources:
- https://github.com/rabbitmq/cluster-operator
- https://github.com/sagikazarmark/helm-charts/tree/master/charts/rabbitmq-operator
maintainers:
- name: sagikazarmark
email: [email protected]
url: https://sagikazarmark.hu
annotations:
artifacthub.io/changes: |
- kind: added
description: Initial version
artifacthub.io/images: |
- name: operator
image: rabbitmqoperator/cluster-operator:1.7.0
- name: rabbitmq
image: rabbitmq:3.8.16-management
artifacthub.io/operator: "true"
artifacthub.io/operatorCapabilities: "Full Lifecycle"
artifacthub.io/crds: |
- kind: RabbitmqCluster
version: rabbitmq.com/v1beta1
name: rabbitmqcluster
displayName: RabbitMQ cluster
description: Lifecycle (creation, upgrade, graceful shutdown) of a RabbitMQ cluster.
artifacthub.io/crdsExamples: |
- apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: my-cluster
spec:
replicas: 1
19 changes: 19 additions & 0 deletions charts/rabbitmq-operator/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2021 Márk Sági-Kazár <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
80 changes: 80 additions & 0 deletions charts/rabbitmq-operator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# rabbitmq-operator

![version: 0.0.1](https://img.shields.io/badge/version-0.0.1-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 1.7.0](https://img.shields.io/badge/app%20version-1.7.0-informational?style=flat-square) ![kube version: >=1.18.0-0](https://img.shields.io/badge/kube%20version->=1.18.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-rabbitmq--operator-informational?style=flat-square)](https://artifacthub.io/packages/helm/sagikazarmark/rabbitmq-operator)

Kubernetes operator to deploy and manage RabbitMQ clusters.

**Homepage:** <https://www.rabbitmq.com/kubernetes/operator/operator-overview.html>

## TL;DR;

```bash
helm repo add skm https://charts.sagikazarmark.dev
helm install --generate-name --wait skm/rabbitmq-operator
```

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| replicaCount | int | `1` | Number of replicas (pods) to launch. |
| image.repository | string | `"rabbitmqoperator/cluster-operator"` | Name of the image repository to pull the container image from. |
| image.pullPolicy | string | `"IfNotPresent"` | [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) for updating already existing images on a node. |
| image.tag | string | `""` | Image tag override for the default value (chart appVersion). |
| imagePullSecrets | list | `[]` | Reference to one or more secrets to be used when [pulling images](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-pod-that-uses-your-secret) (from private registries). |
| nameOverride | string | `""` | A name in place of the chart name for `app:` labels. |
| fullnameOverride | string | `""` | A name to substitute for the full names of resources. |
| serviceAccount.create | bool | `true` | Enable service account creation. |
| serviceAccount.annotations | object | `{}` | Annotations to be added to the service account. |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template. |
| rbac.create | bool | `true` | Enable the creation of RBAC resources. If disabled, the operator (ie. the person installing the chart) is responsible for creating the necessary resources based on the templates. |
| podAnnotations | object | `{}` | Annotations to be added to pods. |
| priorityClassName | string | `""` | Specify a priority class name to set [pod priority](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority). |
| podSecurityContext | object | `{}` | Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) for details. |
| securityContext | object | `{}` | Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) for details. |
| podMonitor.enabled | bool | `false` | Enable Prometheus PodMonitor to monitor the operator. |
| podMonitor.interval | string | `"30s"` | Interval at which metrics should be scraped. |
| resources | object | No requests or limits. | Container resource [requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#resources) for details. |
| nodeSelector | object | `{}` | [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) configuration. |
| tolerations | list | `[]` | [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for node taints. See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling) for details. |
| affinity | object | `{}` | [Affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) configuration. See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling) for details. |
| rabbitmq.serviceMonitor.enabled | bool | `false` | Enable Prometheus ServiceMonitor to monitor RabbitMQ clusters created by the operator. |
| rabbitmq.serviceMonitor.interval | string | `"30s"` | Interval at which metrics should be scraped. |

## Development

### Updating the operator

Always start by getting the latest manifest for the operator:

```bash
VERSION="1.7.0"

mkdir tmp

curl -L "https://github.com/rabbitmq/cluster-operator/releases/download/v${VERSION}/cluster-operator.yml" > tmp/cluster-operator.yaml
```

Download the k8split tool:

```bash
go get github.com/brendanjryan/k8split
```

Split up the resources:

```bash
k8split -o tmp tmp/cluster-operator.yaml
```

Update the templates based on the created resources.

Finally, clean up the resources:

```bash
rm -rf tmp
```

## Attribution

This chart is created from the "remains" of the official chart removed in [#296](https://github.com/rabbitmq/cluster-operator/pull/296).
41 changes: 41 additions & 0 deletions charts/rabbitmq-operator/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{ template "chart.baseHead" . }}

{{ template "chart.valuesSection" . }}

## Development

### Updating the operator

Always start by getting the latest manifest for the operator:

```bash
VERSION="1.7.0"

mkdir tmp

curl -L "https://github.com/rabbitmq/cluster-operator/releases/download/v${VERSION}/cluster-operator.yml" > tmp/cluster-operator.yaml
```

Download the k8split tool:

```bash
go get github.com/brendanjryan/k8split
```

Split up the resources:

```bash
k8split -o tmp tmp/cluster-operator.yaml
```

Update the templates based on the created resources.

Finally, clean up the resources:

```bash
rm -rf tmp
```

## Attribution

This chart is created from the "remains" of the official chart removed in [#296](https://github.com/rabbitmq/cluster-operator/pull/296).
Loading

0 comments on commit b1895bc

Please sign in to comment.