From fd92c707c873598442e5d80045285c6a158f2513 Mon Sep 17 00:00:00 2001 From: yonik-lr Date: Tue, 9 Dec 2025 15:29:01 +0200 Subject: [PATCH 1/2] remove pvc usage --- chart/templates/helpers/_helpers.tpl | 6 +---- chart/templates/rabbitmq.yaml | 16 ------------- chart/values.yaml | 18 +------------- docs/components/rabbitmq.md | 35 ---------------------------- docs/installation/cloud/openshift.md | 8 ------- 5 files changed, 2 insertions(+), 81 deletions(-) diff --git a/chart/templates/helpers/_helpers.tpl b/chart/templates/helpers/_helpers.tpl index 9e6ae47..e4ba101 100644 --- a/chart/templates/helpers/_helpers.tpl +++ b/chart/templates/helpers/_helpers.tpl @@ -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" -}} diff --git a/chart/templates/rabbitmq.yaml b/chart/templates/rabbitmq.yaml index 78d6454..de1aedc 100644 --- a/chart/templates/rabbitmq.yaml +++ b/chart/templates/rabbitmq.yaml @@ -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: @@ -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 }} diff --git a/chart/values.yaml b/chart/values.yaml index 44729c7..9a013ba 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -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: "" @@ -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 diff --git a/docs/components/rabbitmq.md b/docs/components/rabbitmq.md index b3ffa00..7033c7a 100644 --- a/docs/components/rabbitmq.md +++ b/docs/components/rabbitmq.md @@ -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**. @@ -232,14 +208,3 @@ 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 -``` diff --git a/docs/installation/cloud/openshift.md b/docs/installation/cloud/openshift.md index 65027ab..ee480ca 100644 --- a/docs/installation/cloud/openshift.md +++ b/docs/installation/cloud/openshift.md @@ -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). \ No newline at end of file From 8e8d8fbfd219071a4aaa7ad6b02c29771d7b7bd2 Mon Sep 17 00:00:00 2001 From: yonik-lr Date: Mon, 15 Dec 2025 12:24:36 +0200 Subject: [PATCH 2/2] add documentation --- docs/components/rabbitmq.md | 77 +++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/docs/components/rabbitmq.md b/docs/components/rabbitmq.md index 7033c7a..c56cf64 100644 --- a/docs/components/rabbitmq.md +++ b/docs/components/rabbitmq.md @@ -208,3 +208,80 @@ deployments: ``` #### **Example of Local RabbitMQ Configuration** + + +## 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 --replicas=0 -n + +# Verify pods are fully terminated +kubectl get pods -n + +# Delete the StatefulSet +kubectl delete statefulset -n + +# Delete the associated PVC (optional, but recommended to free up storage) +kubectl delete pvc -n +``` + +**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 . -n + +# Verify the pod is using emptyDir (not PVC) +kubectl describe pod -n +# Check the "Volumes" section to confirm no PVC is mounted +```