Skip to content

Commit 3a1c56d

Browse files
authored
Add example for statefulSetOverride (#195)
- related to issue #143 - add reasoning about why the CRD won't install in a 1.18 k8s cluster - move Override KEP into proposals/implemented
1 parent 34ca8bd commit 3a1c56d

File tree

4 files changed

+63
-8
lines changed

4 files changed

+63
-8
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Manage [RabbitMQ](https://www.rabbitmq.com/) clusters deployed to [Kubernetes](h
66

77
## Supported Versions
88

9-
The operator deploys RabbitMQ `3.8.5`, and requires a Kubernetes cluster of `1.16` or above.
9+
The operator deploys RabbitMQ `3.8.5`, and requires a Kubernetes cluster of `1.16` or `1.17`.
10+
`RabbitmqCluster` CRD cannot be installed in a kuberentes `1.18` cluster because of a schema validation that ensures that properties defined as `list-map-keys` must either be required or have a default value ([related github issue](https://github.com/kubernetes/kubernetes/issues/91395)).
1011

1112
## Quickstart
1213

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Additional PersistentVolumeClaim Example
2+
3+
You can leverage StatefulSet override (`spec.Override.StatefulSet`) to modify any property of the statefulSet deployed as part of a RabbitmqCluster instance. `spec.Override.StatefulSet` is in the format of appsv1.StatefulSetSpec. When provided, it will be applied as a patch to the RabbitmqCluster instance StatefulSet definition, using kubernetes [Strategic Merge Patch](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/strategic-merge-patch.md).
4+
5+
The example creates two PersistentVolumeClaim and mounts the additional PersistentVolumeClaim to the `rabbitmq` container.
6+
7+
8+
```shell
9+
kubectl apply -f rabbitmq.yaml
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: rabbitmq.com/v1beta1
2+
kind: RabbitmqCluster
3+
metadata:
4+
name: sample
5+
spec:
6+
replicas: 1
7+
override:
8+
statefulSet:
9+
spec:
10+
template:
11+
spec:
12+
containers:
13+
- name: rabbitmq
14+
volumeMounts:
15+
- name: additional-disk
16+
mountPath: /var/lib/log
17+
volumeClaimTemplates:
18+
- apiVersion: v1
19+
kind: PersistentVolumeClaim
20+
metadata:
21+
name: persistence
22+
namespace: rabbitmq-system
23+
labels:
24+
"app.kubernetes.io/name": "sample"
25+
spec:
26+
storageClassName: standard
27+
accessModes:
28+
- ReadWriteOnce
29+
resources:
30+
requests:
31+
storage: 3Gi
32+
- apiVersion: v1
33+
kind: PersistentVolumeClaim
34+
metadata:
35+
name: persistence-foo
36+
namespace: rabbitmq-system
37+
labels:
38+
"app.kubernetes.io/name": "sample"
39+
spec:
40+
storageClassName: standard
41+
accessModes:
42+
- ReadWriteOnce
43+
resources:
44+
requests:
45+
storage: 1Gi

docs/proposals/20200310-crd-spec-configurability.md renamed to docs/proposals/implemented/20200310-crd-spec-configurability.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
title: CRD Spec Refactor
33
authors:
44
- "@ChunyiLyu"
5-
reviewers:
6-
-
75
creation-date: 2020-03-10
8-
last-updated: 2020-05-12
9-
status: provisional
10-
see-also:
11-
replaces:
12-
superseded-by:
6+
last-updated: 2020-07-10
7+
status: implemented
138
---
149

1510
# CRD Spec Refactor
1611

12+
## Status
13+
14+
This KEP has already been implemented. Different from what's outlined in this KEP, we had to define some custome types instead of using `appsv1.StatefulSet` directly. For updated implementation details, refer to [PR #175](https://github.com/rabbitmq/cluster-operator/pull/175).
15+
1716
## Table of Contents
1817

1918
- [CRD Spec Refactor](#crd-spec-refactor)

0 commit comments

Comments
 (0)