Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions chart/templates/helpers/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,7 @@ Pod SecurityContext of lightrun mysql
{{- end -}}

{{- define "lightrun-mq.storage.name" -}}
{{- if and .Values.general.mq.pvc_name (ne (.Values.general.mq.storage | toString) "0") -}}
{{ .Values.general.mq.pvc_name }}
{{- else -}}
{{ include "lightrun-mq.name" . }}-data
{{- end -}}
{{ include "lightrun-mq.name" . }}-data
{{- end -}}

{{- define "lightrun-mq.endpoint" -}}
Expand Down
16 changes: 0 additions & 16 deletions chart/templates/rabbitmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ metadata:
labels:
app: {{ include "lightrun-mq.name" . }}
spec:
{{- with .Values.general.mq.persistentVolumeClaimRetentionPolicy }}
persistentVolumeClaimRetentionPolicy:
{{ . | toYaml | nindent 4 }}
{{- end }}
replicas: 1
selector:
matchLabels:
Expand Down Expand Up @@ -200,20 +196,8 @@ spec:
secretName: {{ .Values.general.internal_tls.certificates.existing_certificates.rabbitmq }}
{{- end }}
{{- end }}
{{- if eq (.Values.general.mq.storage | toString) "0" }}
- name: {{ include "lightrun-mq.storage.name" . }}
emptyDir:
sizeLimit: {{ .Values.deployments.rabbitmq.emptyDir.sizeLimit }}
{{- else }}
volumeClaimTemplates:
- metadata:
name: {{ include "lightrun-mq.storage.name" . }}
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.general.mq.storageClassName }}
resources:
requests:
storage: {{ .Values.general.mq.storage }}
{{- end }}

{{ end }}
18 changes: 1 addition & 17 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ general:

statefulset:
## Details of the database's stateful set, if any.
## If `enabled: false`, a regular depolyment will be created.
## If `enabled: false`, a regular deployment will be created.
## if `db_local: false`, a stateful set will not be created.
enabled: true
pvc_name: ""
Expand Down Expand Up @@ -110,22 +110,6 @@ general:
## if `local: true`, a mq_endpoint will be ignored.
port: "5672"

##
## if `local: false`, all properties below will be ignored
##
persistentVolumeClaimRetentionPolicy:
{}
# whenDeleted: "Retain"
# whenScaled: "Retain"
storageClassName: "gp2"
## adjust to proper class
# AWS - `gp2`
# GCP - `standard`
storage: "0"
## For environments requiring persistent storage, set to "10Gi" or higher
## For environments without PV/PVC access, keep as "0" to use ephemeral storage (EmptyDir)
pvc_name: ""
## If empty, will be set to default: {{ .Release.Name }}-mq-data
metrics: false
## If true, will enable prometheus plugin of RabbitMQ
## metrics will be served on mq service, port 15692
Expand Down
108 changes: 75 additions & 33 deletions docs/components/rabbitmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,30 +117,6 @@ general:

This configuration **prevents queue overload** and ensures messages are retained only as needed.


#### **Storage Configuration (Only if `general.mq.local: true`)**

```yaml
general:
mq:
persistentVolumeClaimRetentionPolicy:
whenDeleted: "Retain"
whenScaled: "Retain"
storageClassName: "gp3"
storage: "10Gi"
pvc_name: ""
```

|Property|Description|
|---|---|
|**`storageClassName: "gp3"`**|The storage class for the PersistentVolumeClaim (PVC).|
|**`storage: "10Gi"`**|Amount of storage allocated for RabbitMQ.|
|**`pvc_name: ""`**|PVC name (default: `{{ .Release.Name }}-mq-data`).|
|**`persistentVolumeClaimRetentionPolicy`**|Controls PVC retention when the StatefulSet is deleted or scaled down.|

> [!WARNING]
> To **disable persistent storage**, set `storage: "0"` (all data will be lost on pod restart). This creates a deployment instead of statefulset.

#### **Metrics Configuration**

- **`general.mq.metrics: false`** – If `true`, enables the **RabbitMQ Prometheus plugin**.
Expand Down Expand Up @@ -233,13 +209,79 @@ deployments:

#### **Example of Local RabbitMQ Configuration**

#### **Deploy a Local RabbitMQ Instance with 10Gi Storage**
```yaml
general:
mq:
enabled: true
local: true
storageClassName: "gp3"
storage: "10Gi"
metrics: true

## PVC Removal in Chart Version 3.32.1

Starting with chart version 3.32.1, Persistent Volume Claim (PVC) support has been removed for RabbitMQ. RabbitMQ now exclusively uses ephemeral storage (`emptyDir`) for all data persistence.

### **What Changed**

- **Removed PVC Support**: RabbitMQ now exclusively uses ephemeral storage (`emptyDir`) for data persistence. The `general.mq.storage` configuration value no longer creates PVCs.
- **Deprecated Configuration Options**: The following configuration properties are no longer supported and should be removed from your `values.yaml`:
- `general.mq.persistentVolumeClaimRetentionPolicy`
- `general.mq.storageClassName`
- `general.mq.storage` (no longer creates PVCs)
- `general.mq.pvc_name`

### **Impact**

- **Data Persistence**: RabbitMQ data is stored in ephemeral storage only. **All data will be lost** when the pod is restarted or deleted.
- **Storage Configuration**: The `general.mq.storage` setting in `values.yaml` is now ignored. RabbitMQ uses the `emptyDir` size limit defined in `deployments.rabbitmq.emptyDir.sizeLimit` (default: `5Gi`).

### **Upgrade Considerations**

> [!WARNING]
> **Direct Helm Upgrade Will Fail**: Attempting to upgrade directly from a version using PVCs to version 3.32.1 will result in an error.

If you attempt a direct upgrade, you will encounter an error similar to:

```
Error: UPGRADE FAILED: cannot patch "lightrun-mq" with kind StatefulSet:
StatefulSet.apps "lightrun-mq" is invalid: spec: Forbidden: updates to statefulset spec
for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy',
'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
```

### **Migration Process**

If you are upgrading from a previous version that used PVCs, follow these steps to migrate to ephemeral storage:

**Step 1: Scale Down and Remove Existing Resources**

Scale down the StatefulSet, wait for pods to terminate, then delete the StatefulSet and associated PVC:

```bash
# Scale down the StatefulSet
kubectl scale statefulset <STATEFULSET_NAME> --replicas=0 -n <NAMESPACE>

# Verify pods are fully terminated
kubectl get pods -n <NAMESPACE>

# Delete the StatefulSet
kubectl delete statefulset <STATEFULSET_NAME> -n <NAMESPACE>

# Delete the associated PVC (optional, but recommended to free up storage)
kubectl delete pvc <PVC_NAME> -n <NAMESPACE>
```

**Step 2: Update Configuration**

Remove the following deprecated values from your `values.yaml`:

- `general.mq.persistentVolumeClaimRetentionPolicy`
- `general.mq.storageClassName`
- `general.mq.storage`
- `general.mq.pvc_name`

**Step 3: Upgrade Helm Release**

Upgrade your Helm release and verify the new deployment:

```bash
# Upgrade the Helm release
helm upgrade --install <RELEASE> . -n <NAMESPACE>

# Verify the pod is using emptyDir (not PVC)
kubectl describe pod <LIGHTRUN-MQ-POD> -n <NAMESPACE>
# Check the "Volumes" section to confirm no PVC is mounted
```
8 changes: 0 additions & 8 deletions docs/installation/cloud/openshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ general:
storageClassName: gp3
```

#### RabbitMQ Configuration (If used locally):

```yaml
general:
mq:
storageClassName: gp3
```

### 4. Configure OpenShift Ingress (HAProxy)

If using OpenShift's default HAProxy ingress controller, adjust the router configuration accordingly. Follow the guide: [Install Lightrun Router on openshift with HAProxy](openshift_haproxy.md).
Loading