Skip to content

Commit

Permalink
Fix yamls
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan committed Sep 10, 2024
1 parent fc09a85 commit 07ca8c8
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 1,661 deletions.
17 changes: 9 additions & 8 deletions docs/guides/rabbitmq/concepts/appbinding.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: AppBinding CRD
menu:
docs_{{ .version }}:
identifier: rm-appbinding-concepts
identifier: rm-appbinding
name: AppBinding
parent: rm-concepts-guides
weight: 20
Expand Down Expand Up @@ -32,36 +32,37 @@ kind: AppBinding
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"kubedb.com/v1alpha2","kind":"RabbitMQ","metadata":{"annotations":{},"name":"rabbitmq","namespace":"demo"},"spec":{"deletionPolicy":"WipeOut","replicas":3,"storage":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"standard"},"storageType":"Durable","version":"3.13.2"}}
creationTimestamp: "2024-07-09T10:16:01Z"
{"apiVersion":"kubedb.com/v1alpha2","kind":"RabbitMQ","metadata":{"annotations":{},"name":"rabbitmq","namespace":"rabbit"},"spec":{"deletionPolicy":"WipeOut","podTemplate":{"spec":{"containers":[{"name":"rabbitmq","resources":{"limits":{"cpu":"600m","memory":"1.5Gi"},"requests":{"cpu":"500m"}}}]}},"replicas":3,"storage":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"standard"},"storageType":"Durable","version":"3.13.2"}}
creationTimestamp: "2024-09-05T19:30:24Z"
generation: 1
labels:
app.kubernetes.io/component: database
app.kubernetes.io/instance: rabbitmq
app.kubernetes.io/managed-by: kubedb.com
app.kubernetes.io/name: rabbitmqs.kubedb.com
name: rabbitmq
namespace: demo
namespace: rabbit
ownerReferences:
- apiVersion: kubedb.com/v1alpha2
blockOwnerDeletion: true
controller: true
kind: RabbitMQ
name: rabbitmq
uid: a8c4e284-e9ec-41d1-ad5e-646e3209d3bf
resourceVersion: "289308"
uid: 55b11491-9c3b-4aaf-93a3-17deb62593f0
uid: 5555cd04-d124-42c4-93b7-6a71f9fdd653
resourceVersion: "262736"
uid: 95801d5d-1d25-4251-88c2-27dd2ea9860e
spec:
appRef:
apiGroup: kubedb.com
kind: RabbitMQ
name: rabbitmq
namespace: demo
namespace: rabbit
clientConfig:
service:
name: rabbitmq
port: 5672
scheme: http
url: amqp://<username>:<password>@rabbitmq.rabbit.svc.cluster.local:5672/
secret:
name: rabbitmq-admin-cred
type: kubedb.com/rabbitmq
Expand Down
163 changes: 18 additions & 145 deletions docs/guides/rabbitmq/concepts/autoscaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: RabbitMQAutoscaler CRD
menu:
docs_{{ .version }}:
identifier: rm-autoscaler-concepts
identifier: rm-autoscaler
name: RabbitMQAutoscaler
parent: rm-concepts-guides
weight: 26
Expand All @@ -24,147 +24,39 @@ Like any official Kubernetes resource, a `RabbitMQAutoscaler` has `TypeMeta`, `O

Here, some sample `RabbitMQAutoscaler` CROs for autoscaling different components of database is given below:

**Sample `RabbitMQAutoscaler` for standalone database:**
**Sample `RabbitMQAutoscaler`:**

```yaml
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: RabbitMQAutoscaler
metadata:
name: mg-as
namespace: demo
name: rabbitmq-autoscaler
namespace: rabbit
spec:
databaseRef:
name: mg-standalone
name: rabbitmq
opsRequestOptions:
readinessCriteria:
oplogMaxLagSeconds: 20
objectsCountDiffPercentage: 10
timeout: 3m
apply: IfReady
compute:
standalone:
rabbitmq:
trigger: "On"
podLifeTimeThreshold: 24h
podLifeTimeThreshold: 5m
resourceDiffPercentage: 20
minAllowed:
cpu: 250m
memory: 350Mi
maxAllowed:
cpu: 1
memory: 1Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
resourceDiffPercentage: 10
storage:
standalone:
expansionMode: "Online"
trigger: "On"
usageThreshold: 60
scalingThreshold: 50
```
**Sample `RabbitMQAutoscaler` for replicaset database:**

```yaml
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: RabbitMQAutoscaler
metadata:
name: mg-as-rs
namespace: demo
spec:
databaseRef:
name: mg-rs
opsRequestOptions:
readinessCriteria:
oplogMaxLagSeconds: 20
objectsCountDiffPercentage: 10
timeout: 3m
apply: IfReady
compute:
replicaSet:
trigger: "On"
podLifeTimeThreshold: 24h
minAllowed:
cpu: 200m
memory: 300Mi
maxAllowed:
cpu: 1
memory: 1Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
resourceDiffPercentage: 10
storage:
replicaSet:
expansionMode: "Online"
trigger: "On"
usageThreshold: 60
scalingThreshold: 50
```

**Sample `RabbitMQAutoscaler` for sharded database:**

```yaml
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: RabbitMQAutoscaler
metadata:
name: mg-as-sh
namespace: demo
spec:
databaseRef:
name: mg-sh
opsRequestOptions:
readinessCriteria:
oplogMaxLagSeconds: 20
objectsCountDiffPercentage: 10
timeout: 3m
apply: IfReady
compute:
shard:
trigger: "On"
podLifeTimeThreshold: 24h
minAllowed:
cpu: 250m
memory: 350Mi
maxAllowed:
cpu: 1
memory: 1Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
resourceDiffPercentage: 10
configServer:
trigger: "On"
podLifeTimeThreshold: 24h
minAllowed:
cpu: 250m
memory: 350Mi
maxAllowed:
cpu: 1
memory: 1Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
resourceDiffPercentage: 10
mongos:
trigger: "On"
podLifeTimeThreshold: 24h
minAllowed:
cpu: 250m
memory: 350Mi
memory: "1.5Gi"
maxAllowed:
cpu: 1
memory: 1Gi
cpu: 2
memory: 5Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
resourceDiffPercentage: 10
storage:
shard:
expansionMode: "Online"
trigger: "On"
usageThreshold: 60
scalingThreshold: 50
configServer:
expansionMode: "Online"
rabbitmq:
expansionMode: "Offline"
trigger: "On"
usageThreshold: 60
scalingThreshold: 50
usageThreshold: 20
scalingThreshold: 30
```
Here, we are going to describe the various sections of a `RabbitMQAutoscaler` crd.
Expand All @@ -173,25 +65,13 @@ A `RabbitMQAutoscaler` object has the following fields in the `spec` section.

### spec.databaseRef

`spec.databaseRef` is a required field that point to the [RabbitMQ](/docs/guides/RabbitMQ/concepts/RabbitMQ.md) object for which the autoscaling will be performed. This field consists of the following sub-field:
`spec.databaseRef` is a required field that point to the [RabbitMQ](/docs/guides/rabbitmq/concepts/rabbitmq.md) object for which the autoscaling will be performed. This field consists of the following sub-field:

- **spec.databaseRef.name :** specifies the name of the [RabbitMQ](/docs/guides/RabbitMQ/concepts/RabbitMQ.md) object.

### spec.opsRequestOptions
These are the options to pass in the internally created opsRequest CRO. `opsRequestOptions` has three fields. They have been described in details [here](/docs/guides/RabbitMQ/concepts/opsrequest.md#specreadinesscriteria).
- **spec.databaseRef.name :** specifies the name of the [RabbitMQ](/docs/guides/rabbitmq/concepts/rabbitmq.md) object.

### spec.compute

`spec.compute` specifies the autoscaling configuration for the compute resources i.e. cpu and memory of the database components. This field consists of the following sub-field:

- `spec.compute.standalone` indicates the desired compute autoscaling configuration for a standalone RabbitMQ database.
- `spec.compute.replicaSet` indicates the desired compute autoscaling configuration for replicaSet of a RabbitMQ database.
- `spec.compute.configServer` indicates the desired compute autoscaling configuration for config servers of a sharded RabbitMQ database.
- `spec.compute.mongos` indicates the desired compute autoscaling configuration for the mongos nodes of a sharded RabbitMQ database.
- `spec.compute.shard` indicates the desired compute autoscaling configuration for the shard nodes of a sharded RabbitMQ database.
- `spec.compute.arbiter` indicates the desired compute autoscaling configuration for the arbiter node.

All of them has the following sub-fields:
`spec.compute` specifies the autoscaling configuration for the compute resources i.e. cpu and memory of the database components. It has the following sub-fields:

- `trigger` indicates if compute autoscaling is enabled for this component of the database. If "On" then compute autoscaling is enabled. If "Off" then compute autoscaling is disabled.
- `minAllowed` specifies the minimal amount of resources that will be recommended, default is no minimum.
Expand All @@ -209,13 +89,6 @@ There are two more fields, those are only specifiable for the percona variant in

`spec.compute` specifies the autoscaling configuration for the storage resources of the database components. This field consists of the following sub-field:

- `spec.compute.standalone` indicates the desired storage autoscaling configuration for a standalone RabbitMQ database.
- `spec.compute.replicaSet` indicates the desired storage autoscaling configuration for replicaSet of a RabbitMQ database.
- `spec.compute.configServer` indicates the desired storage autoscaling configuration for config servers of a sharded RabbitMQ database.
- `spec.compute.shard` indicates the desired storage autoscaling configuration for the shard nodes of a sharded RabbitMQ database.

All of them has the following sub-fields:

- `trigger` indicates if storage autoscaling is enabled for this component of the database. If "On" then storage autoscaling is enabled. If "Off" then storage autoscaling is disabled.
- `usageThreshold` indicates usage percentage threshold, if the current storage usage exceeds then storage autoscaling will be triggered.
- `scalingThreshold` indicates the percentage of the current storage that will be scaled.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/rabbitmq/concepts/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: RabbitMQVersion CRD
menu:
docs_{{ .version }}:
identifier: mg-catalog-concepts
identifier: rm-catalog
name: RabbitMQVersion
parent: mg-concepts-RabbitMQ
parent: rm-concepts-guides
weight: 15
menu_name: docs_{{ .version }}
section_menu_id: guides
Expand Down
Loading

0 comments on commit 07ca8c8

Please sign in to comment.